OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. | 484 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. |
485 if (!name->IsUniqueName()) { | 485 if (!name->IsUniqueName()) { |
486 DCHECK(name->IsString()); | 486 DCHECK(name->IsString()); |
487 name = factory()->InternalizeString(Handle<String>::cast(name)); | 487 name = factory()->InternalizeString(Handle<String>::cast(name)); |
488 } | 488 } |
489 DCHECK(current.is_null() || | 489 DCHECK(current.is_null() || |
490 current->property_dictionary()->FindEntry(name) == | 490 current->property_dictionary()->FindEntry(name) == |
491 NameDictionary::kNotFound); | 491 NameDictionary::kNotFound); |
492 | 492 |
493 if (depth > 1) { | 493 if (depth > 1) { |
494 // TODO(jkummerow): Cache and re-use weak cell. | 494 Handle<WeakCell> weak_cell = |
495 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 495 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 496 __ LoadWeakValue(reg, weak_cell, miss); |
496 } | 497 } |
497 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 498 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
498 scratch2); | 499 scratch2); |
499 } | 500 } |
500 | 501 |
501 reg = holder_reg; // From now on the object will be in holder_reg. | 502 reg = holder_reg; // From now on the object will be in holder_reg. |
502 // Go to the next object in the prototype chain. | 503 // Go to the next object in the prototype chain. |
503 current = prototype; | 504 current = prototype; |
504 current_map = handle(current->map()); | 505 current_map = handle(current->map()); |
505 } | 506 } |
506 | 507 |
507 DCHECK(!current_map->IsJSGlobalProxyMap()); | 508 DCHECK(!current_map->IsJSGlobalProxyMap()); |
508 | 509 |
509 // Log the check depth. | 510 // Log the check depth. |
510 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 511 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
511 | 512 |
512 bool return_holder = return_what == RETURN_HOLDER; | 513 bool return_holder = return_what == RETURN_HOLDER; |
513 if (return_holder && depth != 0) { | 514 if (return_holder && depth != 0) { |
514 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 515 Handle<WeakCell> weak_cell = |
| 516 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 517 __ LoadWeakValue(reg, weak_cell, miss); |
515 } | 518 } |
516 | 519 |
517 // Return the register containing the holder. | 520 // Return the register containing the holder. |
518 return return_holder ? reg : no_reg; | 521 return return_holder ? reg : no_reg; |
519 } | 522 } |
520 | 523 |
521 | 524 |
522 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 525 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
523 if (!miss->is_unused()) { | 526 if (!miss->is_unused()) { |
524 Label success; | 527 Label success; |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 // Return the generated code. | 719 // Return the generated code. |
717 return GetCode(kind(), name); | 720 return GetCode(kind(), name); |
718 } | 721 } |
719 | 722 |
720 | 723 |
721 #undef __ | 724 #undef __ |
722 } // namespace internal | 725 } // namespace internal |
723 } // namespace v8 | 726 } // namespace v8 |
724 | 727 |
725 #endif // V8_TARGET_ARCH_X87 | 728 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |