| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/code-stub-assembler.h" | 5 #include "src/code-stub-assembler.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 #include "src/frames.h" | 8 #include "src/frames.h" |
| 9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
| 10 | 10 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 Node* CodeStubAssembler::LoadMapInobjectProperties(Node* map) { | 560 Node* CodeStubAssembler::LoadMapInobjectProperties(Node* map) { |
| 561 // See Map::GetInObjectProperties() for details. | 561 // See Map::GetInObjectProperties() for details. |
| 562 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | 562 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
| 563 Assert(Int32GreaterThanOrEqual(LoadMapInstanceType(map), | 563 Assert(Int32GreaterThanOrEqual(LoadMapInstanceType(map), |
| 564 Int32Constant(FIRST_JS_OBJECT_TYPE))); | 564 Int32Constant(FIRST_JS_OBJECT_TYPE))); |
| 565 return LoadObjectField( | 565 return LoadObjectField( |
| 566 map, Map::kInObjectPropertiesOrConstructorFunctionIndexOffset, | 566 map, Map::kInObjectPropertiesOrConstructorFunctionIndexOffset, |
| 567 MachineType::Uint8()); | 567 MachineType::Uint8()); |
| 568 } | 568 } |
| 569 | 569 |
| 570 Node* CodeStubAssembler::LoadMapConstructor(Node* map) { |
| 571 Variable result(this, MachineRepresentation::kTagged); |
| 572 result.Bind(LoadObjectField(map, Map::kConstructorOrBackPointerOffset)); |
| 573 |
| 574 Label done(this), loop(this, &result); |
| 575 Goto(&loop); |
| 576 Bind(&loop); |
| 577 { |
| 578 GotoIf(WordIsSmi(result.value()), &done); |
| 579 Node* is_map_type = |
| 580 Word32Equal(LoadInstanceType(result.value()), Int32Constant(MAP_TYPE)); |
| 581 GotoUnless(is_map_type, &done); |
| 582 result.Bind( |
| 583 LoadObjectField(result.value(), Map::kConstructorOrBackPointerOffset)); |
| 584 Goto(&loop); |
| 585 } |
| 586 Bind(&done); |
| 587 return result.value(); |
| 588 } |
| 589 |
| 570 Node* CodeStubAssembler::LoadNameHashField(Node* name) { | 590 Node* CodeStubAssembler::LoadNameHashField(Node* name) { |
| 571 return LoadObjectField(name, Name::kHashFieldOffset, MachineType::Uint32()); | 591 return LoadObjectField(name, Name::kHashFieldOffset, MachineType::Uint32()); |
| 572 } | 592 } |
| 573 | 593 |
| 574 Node* CodeStubAssembler::LoadNameHash(Node* name, Label* if_hash_not_computed) { | 594 Node* CodeStubAssembler::LoadNameHash(Node* name, Label* if_hash_not_computed) { |
| 575 Node* hash_field = LoadNameHashField(name); | 595 Node* hash_field = LoadNameHashField(name); |
| 576 if (if_hash_not_computed != nullptr) { | 596 if (if_hash_not_computed != nullptr) { |
| 577 GotoIf(WordEqual( | 597 GotoIf(WordEqual( |
| 578 Word32And(hash_field, Int32Constant(Name::kHashNotComputedMask)), | 598 Word32And(hash_field, Int32Constant(Name::kHashNotComputedMask)), |
| 579 Int32Constant(0)), | 599 Int32Constant(0)), |
| (...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2780 } | 2800 } |
| 2781 Bind(&miss); | 2801 Bind(&miss); |
| 2782 { | 2802 { |
| 2783 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, | 2803 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, |
| 2784 p->vector); | 2804 p->vector); |
| 2785 } | 2805 } |
| 2786 } | 2806 } |
| 2787 | 2807 |
| 2788 } // namespace internal | 2808 } // namespace internal |
| 2789 } // namespace v8 | 2809 } // namespace v8 |
| OLD | NEW |