OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. | 454 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. |
455 if (!name->IsUniqueName()) { | 455 if (!name->IsUniqueName()) { |
456 DCHECK(name->IsString()); | 456 DCHECK(name->IsString()); |
457 name = factory()->InternalizeString(Handle<String>::cast(name)); | 457 name = factory()->InternalizeString(Handle<String>::cast(name)); |
458 } | 458 } |
459 DCHECK(current.is_null() || | 459 DCHECK(current.is_null() || |
460 current->property_dictionary()->FindEntry(name) == | 460 current->property_dictionary()->FindEntry(name) == |
461 NameDictionary::kNotFound); | 461 NameDictionary::kNotFound); |
462 | 462 |
463 if (depth > 1) { | 463 if (depth > 1) { |
464 // TODO(jkummerow): Cache and re-use weak cell. | 464 Handle<WeakCell> weak_cell = |
465 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 465 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 466 __ LoadWeakValue(reg, weak_cell, miss); |
466 } | 467 } |
467 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, | 468 GenerateDictionaryNegativeLookup(masm(), miss, reg, name, scratch1, |
468 scratch2); | 469 scratch2); |
469 } | 470 } |
470 | 471 |
471 reg = holder_reg; // From now on the object will be in holder_reg. | 472 reg = holder_reg; // From now on the object will be in holder_reg. |
472 // Go to the next object in the prototype chain. | 473 // Go to the next object in the prototype chain. |
473 current = prototype; | 474 current = prototype; |
474 current_map = handle(current->map()); | 475 current_map = handle(current->map()); |
475 } | 476 } |
476 | 477 |
477 DCHECK(!current_map->IsJSGlobalProxyMap()); | 478 DCHECK(!current_map->IsJSGlobalProxyMap()); |
478 | 479 |
479 // Log the check depth. | 480 // Log the check depth. |
480 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 481 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
481 | 482 |
482 bool return_holder = return_what == RETURN_HOLDER; | 483 bool return_holder = return_what == RETURN_HOLDER; |
483 if (return_holder && depth != 0) { | 484 if (return_holder && depth != 0) { |
484 __ LoadWeakValue(reg, isolate()->factory()->NewWeakCell(current), miss); | 485 Handle<WeakCell> weak_cell = |
| 486 Map::GetOrCreatePrototypeWeakCell(current, isolate()); |
| 487 __ LoadWeakValue(reg, weak_cell, miss); |
485 } | 488 } |
486 | 489 |
487 // Return the register containing the holder. | 490 // Return the register containing the holder. |
488 return return_holder ? reg : no_reg; | 491 return return_holder ? reg : no_reg; |
489 } | 492 } |
490 | 493 |
491 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { | 494 void NamedLoadHandlerCompiler::FrontendFooter(Handle<Name> name, Label* miss) { |
492 if (!miss->is_unused()) { | 495 if (!miss->is_unused()) { |
493 Label success; | 496 Label success; |
494 __ b(&success); | 497 __ b(&success); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 656 |
654 // Return the generated code. | 657 // Return the generated code. |
655 return GetCode(kind(), name); | 658 return GetCode(kind(), name); |
656 } | 659 } |
657 | 660 |
658 #undef __ | 661 #undef __ |
659 } // namespace internal | 662 } // namespace internal |
660 } // namespace v8 | 663 } // namespace v8 |
661 | 664 |
662 #endif // V8_TARGET_ARCH_ARM | 665 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |