| 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/ic/keyed-store-generic.h" | 5 #include "src/ic/keyed-store-generic.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
| 9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/ic/accessor-assembler-impl.h" | 10 #include "src/ic/accessor-assembler-impl.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Found a supported transition target map, perform the transition! | 143 // Found a supported transition target map, perform the transition! |
| 144 Bind(&perform_transition); | 144 Bind(&perform_transition); |
| 145 { | 145 { |
| 146 if (IsFastDoubleElementsKind(from_kind) != | 146 if (IsFastDoubleElementsKind(from_kind) != |
| 147 IsFastDoubleElementsKind(to_kind)) { | 147 IsFastDoubleElementsKind(to_kind)) { |
| 148 Node* capacity = SmiUntag(LoadFixedArrayBaseLength(elements)); | 148 Node* capacity = SmiUntag(LoadFixedArrayBaseLength(elements)); |
| 149 GrowElementsCapacity(receiver, elements, from_kind, to_kind, capacity, | 149 GrowElementsCapacity(receiver, elements, from_kind, to_kind, capacity, |
| 150 capacity, INTPTR_PARAMETERS, bailout); | 150 capacity, INTPTR_PARAMETERS, bailout); |
| 151 } | 151 } |
| 152 StoreObjectField(receiver, JSObject::kMapOffset, var_target_map.value()); | 152 StoreMap(receiver, var_target_map.value()); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 void KeyedStoreGenericAssembler::TryChangeToHoleyMapHelper( | 156 void KeyedStoreGenericAssembler::TryChangeToHoleyMapHelper( |
| 157 Node* receiver, Node* receiver_map, Node* native_context, | 157 Node* receiver, Node* receiver_map, Node* native_context, |
| 158 ElementsKind packed_kind, ElementsKind holey_kind, Label* done, | 158 ElementsKind packed_kind, ElementsKind holey_kind, Label* done, |
| 159 Label* map_mismatch, Label* bailout) { | 159 Label* map_mismatch, Label* bailout) { |
| 160 Node* packed_map = | 160 Node* packed_map = |
| 161 LoadContextElement(native_context, Context::ArrayMapIndex(packed_kind)); | 161 LoadContextElement(native_context, Context::ArrayMapIndex(packed_kind)); |
| 162 GotoIf(WordNotEqual(receiver_map, packed_map), map_mismatch); | 162 GotoIf(WordNotEqual(receiver_map, packed_map), map_mismatch); |
| 163 if (AllocationSite::GetMode(packed_kind, holey_kind) == | 163 if (AllocationSite::GetMode(packed_kind, holey_kind) == |
| 164 TRACK_ALLOCATION_SITE) { | 164 TRACK_ALLOCATION_SITE) { |
| 165 TrapAllocationMemento(receiver, bailout); | 165 TrapAllocationMemento(receiver, bailout); |
| 166 } | 166 } |
| 167 Node* holey_map = | 167 Node* holey_map = |
| 168 LoadContextElement(native_context, Context::ArrayMapIndex(holey_kind)); | 168 LoadContextElement(native_context, Context::ArrayMapIndex(holey_kind)); |
| 169 StoreObjectField(receiver, JSObject::kMapOffset, holey_map); | 169 StoreMap(receiver, holey_map); |
| 170 Goto(done); | 170 Goto(done); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void KeyedStoreGenericAssembler::TryChangeToHoleyMap( | 173 void KeyedStoreGenericAssembler::TryChangeToHoleyMap( |
| 174 Node* receiver, Node* receiver_map, Node* current_elements_kind, | 174 Node* receiver, Node* receiver_map, Node* current_elements_kind, |
| 175 Node* context, ElementsKind packed_kind, Label* bailout) { | 175 Node* context, ElementsKind packed_kind, Label* bailout) { |
| 176 ElementsKind holey_kind = GetHoleyElementsKind(packed_kind); | 176 ElementsKind holey_kind = GetHoleyElementsKind(packed_kind); |
| 177 Label already_holey(this); | 177 Label already_holey(this); |
| 178 | 178 |
| 179 GotoIf(Word32Equal(current_elements_kind, Int32Constant(holey_kind)), | 179 GotoIf(Word32Equal(current_elements_kind, Int32Constant(holey_kind)), |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 Bind(&slow); | 779 Bind(&slow); |
| 780 { | 780 { |
| 781 Comment("KeyedStoreGeneric_slow"); | 781 Comment("KeyedStoreGeneric_slow"); |
| 782 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, | 782 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, |
| 783 SmiConstant(language_mode)); | 783 SmiConstant(language_mode)); |
| 784 } | 784 } |
| 785 } | 785 } |
| 786 | 786 |
| 787 } // namespace internal | 787 } // namespace internal |
| 788 } // namespace v8 | 788 } // namespace v8 |
| OLD | NEW |