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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 Return(value); | 218 Return(value); |
219 } | 219 } |
220 | 220 |
221 void KeyedStoreGenericAssembler::StoreElementWithCapacity( | 221 void KeyedStoreGenericAssembler::StoreElementWithCapacity( |
222 Node* receiver, Node* receiver_map, Node* elements, Node* elements_kind, | 222 Node* receiver, Node* receiver_map, Node* elements, Node* elements_kind, |
223 Node* intptr_index, Node* value, Node* context, Label* slow, | 223 Node* intptr_index, Node* value, Node* context, Label* slow, |
224 UpdateLength update_length) { | 224 UpdateLength update_length) { |
225 if (update_length != kDontChangeLength) { | 225 if (update_length != kDontChangeLength) { |
226 CSA_ASSERT(this, Word32Equal(LoadMapInstanceType(receiver_map), | 226 CSA_ASSERT(this, Word32Equal(LoadMapInstanceType(receiver_map), |
227 Int32Constant(JS_ARRAY_TYPE))); | 227 Int32Constant(JS_ARRAY_TYPE))); |
228 // Check if the length property is writable. The fast check is only | |
229 // supported for fast properties. | |
230 GotoIf(IsDictionaryMap(receiver_map), slow); | |
231 // The length property is non-configurable, so it's guaranteed to always | |
232 // be the first property. | |
233 Node* descriptors = LoadMapDescriptors(receiver_map); | |
234 Node* details = | |
235 LoadFixedArrayElement(descriptors, DescriptorArray::ToDetailsIndex(0)); | |
236 Node* mask_node = SmiConstant(PropertyDetails::kAttributesReadOnlyMask); | |
237 GotoIf(WordEqual(SmiAnd(details, mask_node), mask_node), slow); | |
danno
2017/01/10 01:27:12
What about:
GotoIf(IsSetWord(BitcastTaggedToWord(
Jakob Kummerow
2017/01/10 11:53:46
As suggested, that compares a Smi against an untag
| |
228 } | 238 } |
229 STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize); | 239 STATIC_ASSERT(FixedArray::kHeaderSize == FixedDoubleArray::kHeaderSize); |
230 const int kHeaderSize = FixedArray::kHeaderSize - kHeapObjectTag; | 240 const int kHeaderSize = FixedArray::kHeaderSize - kHeapObjectTag; |
231 | 241 |
232 Label check_double_elements(this), check_cow_elements(this); | 242 Label check_double_elements(this), check_cow_elements(this); |
233 Node* elements_map = LoadMap(elements); | 243 Node* elements_map = LoadMap(elements); |
234 GotoIf(WordNotEqual(elements_map, LoadRoot(Heap::kFixedArrayMapRootIndex)), | 244 GotoIf(WordNotEqual(elements_map, LoadRoot(Heap::kFixedArrayMapRootIndex)), |
235 &check_double_elements); | 245 &check_double_elements); |
236 | 246 |
237 // FixedArray backing store -> Smi or object elements. | 247 // FixedArray backing store -> Smi or object elements. |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
778 Bind(&slow); | 788 Bind(&slow); |
779 { | 789 { |
780 Comment("KeyedStoreGeneric_slow"); | 790 Comment("KeyedStoreGeneric_slow"); |
781 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, | 791 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, |
782 SmiConstant(language_mode)); | 792 SmiConstant(language_mode)); |
783 } | 793 } |
784 } | 794 } |
785 | 795 |
786 } // namespace internal | 796 } // namespace internal |
787 } // namespace v8 | 797 } // namespace v8 |
OLD | NEW |