OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3541 } | 3541 } |
3542 return ast_context()->ReturnValue(Pop()); | 3542 return ast_context()->ReturnValue(Pop()); |
3543 } | 3543 } |
3544 | 3544 |
3545 | 3545 |
3546 // Sets the lookup result and returns true if the store can be inlined. | 3546 // Sets the lookup result and returns true if the store can be inlined. |
3547 static bool ComputeStoredField(Handle<Map> type, | 3547 static bool ComputeStoredField(Handle<Map> type, |
3548 Handle<String> name, | 3548 Handle<String> name, |
3549 LookupResult* lookup) { | 3549 LookupResult* lookup) { |
3550 type->LookupInDescriptors(NULL, *name, lookup); | 3550 type->LookupInDescriptors(NULL, *name, lookup); |
3551 if (!lookup->IsPropertyOrTransition()) return false; | 3551 if (!lookup->IsFound()) return false; |
3552 if (lookup->type() == FIELD) return true; | 3552 if (lookup->type() == FIELD) return true; |
3553 return (lookup->type() == MAP_TRANSITION) && | 3553 return (lookup->type() == MAP_TRANSITION) && |
3554 (type->unused_property_fields() > 0); | 3554 (type->unused_property_fields() > 0); |
3555 } | 3555 } |
3556 | 3556 |
3557 | 3557 |
3558 static int ComputeStoredFieldIndex(Handle<Map> type, | 3558 static int ComputeStoredFieldIndex(Handle<Map> type, |
3559 Handle<String> name, | 3559 Handle<String> name, |
3560 LookupResult* lookup) { | 3560 LookupResult* lookup) { |
3561 ASSERT(lookup->type() == FIELD || lookup->type() == MAP_TRANSITION); | 3561 ASSERT(lookup->type() == FIELD || lookup->type() == MAP_TRANSITION); |
(...skipping 3846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7408 } | 7408 } |
7409 } | 7409 } |
7410 | 7410 |
7411 #ifdef DEBUG | 7411 #ifdef DEBUG |
7412 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7412 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
7413 if (allocator_ != NULL) allocator_->Verify(); | 7413 if (allocator_ != NULL) allocator_->Verify(); |
7414 #endif | 7414 #endif |
7415 } | 7415 } |
7416 | 7416 |
7417 } } // namespace v8::internal | 7417 } } // namespace v8::internal |
OLD | NEW |