| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. | 474 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. |
| 475 if (!name->IsUniqueName()) { | 475 if (!name->IsUniqueName()) { |
| 476 DCHECK(name->IsString()); | 476 DCHECK(name->IsString()); |
| 477 name = factory()->InternalizeString(Handle<String>::cast(name)); | 477 name = factory()->InternalizeString(Handle<String>::cast(name)); |
| 478 } | 478 } |
| 479 DCHECK(current.is_null() || | 479 DCHECK(current.is_null() || |
| 480 current->property_dictionary()->FindEntry(name) == | 480 current->property_dictionary()->FindEntry(name) == |
| 481 NameDictionary::kNotFound); | 481 NameDictionary::kNotFound); |
| 482 | 482 |
| 483 if (depth > 1) { | 483 if (depth > 1) { |
| 484 // TODO(jkummerow): Cache and re-use weak cell. | 484 Handle<WeakCell> weak_cell = |
| 485 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 485 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 486 __ LoadWeakValue(reg, weak_cell, miss); |
| 486 } | 487 } |
| 487 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 488 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
| 488 scratch2); | 489 scratch2); |
| 489 } | 490 } |
| 490 | 491 |
| 491 reg = holder_reg; // From now on the object will be in holder_reg. | 492 reg = holder_reg; // From now on the object will be in holder_reg. |
| 492 // Go to the next object in the prototype chain. | 493 // Go to the next object in the prototype chain. |
| 493 current = prototype; | 494 current = prototype; |
| 494 current_map = handle(current->map()); | 495 current_map = handle(current->map()); |
| 495 } | 496 } |
| 496 | 497 |
| 497 DCHECK(!current_map->IsJSGlobalProxyMap()); | 498 DCHECK(!current_map->IsJSGlobalProxyMap()); |
| 498 | 499 |
| 499 // Log the check depth. | 500 // Log the check depth. |
| 500 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 501 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
| 501 | 502 |
| 502 bool return_holder = return_what == RETURN_HOLDER; | 503 bool return_holder = return_what == RETURN_HOLDER; |
| 503 if (return_holder && depth != 0) { | 504 if (return_holder && depth != 0) { |
| 504 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 505 Handle<WeakCell> weak_cell = |
| 506 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 507 __ LoadWeakValue(reg, weak_cell, miss); |
| 505 } | 508 } |
| 506 | 509 |
| 507 // Return the register containing the holder. | 510 // Return the register containing the holder. |
| 508 return return_holder ? reg : no_reg; | 511 return return_holder ? reg : no_reg; |
| 509 } | 512 } |
| 510 | 513 |
| 511 | 514 |
| 512 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 515 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
| 513 if (!miss->is_unused()) { | 516 if (!miss->is_unused()) { |
| 514 Label success; | 517 Label success; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 // Return the generated code. | 686 // Return the generated code. |
| 684 return GetCode(kind(), name); | 687 return GetCode(kind(), name); |
| 685 } | 688 } |
| 686 | 689 |
| 687 | 690 |
| 688 #undef __ | 691 #undef __ |
| 689 } // namespace internal | 692 } // namespace internal |
| 690 } // namespace v8 | 693 } // namespace v8 |
| 691 | 694 |
| 692 #endif // V8_TARGET_ARCH_ARM | 695 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |