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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 445 |
446 Bind(&if_bump_length_with_gap); | 446 Bind(&if_bump_length_with_gap); |
447 { | 447 { |
448 StoreElementWithCapacity(receiver, receiver_map, elements, elements_kind, | 448 StoreElementWithCapacity(receiver, receiver_map, elements, elements_kind, |
449 intptr_index, value, context, slow, | 449 intptr_index, value, context, slow, |
450 kBumpLengthWithGap); | 450 kBumpLengthWithGap); |
451 } | 451 } |
452 | 452 |
453 // Out-of-capacity accesses (index >= capacity) jump here. Additionally, | 453 // Out-of-capacity accesses (index >= capacity) jump here. Additionally, |
454 // an ElementsKind transition might be necessary. | 454 // an ElementsKind transition might be necessary. |
455 // The index can also be negative at this point! Jump to the runtime in that | |
456 // case to convert it to a named property. | |
457 Bind(&if_grow); | 455 Bind(&if_grow); |
458 { | 456 { |
459 Comment("Grow backing store"); | 457 Comment("Grow backing store"); |
460 // TODO(jkummerow): Support inline backing store growth. | 458 // TODO(jkummerow): Support inline backing store growth. |
461 Goto(slow); | 459 Goto(slow); |
462 } | 460 } |
463 | 461 |
464 // Any ElementsKind > LAST_FAST_ELEMENTS_KIND jumps here for further dispatch. | 462 // Any ElementsKind > LAST_FAST_ELEMENTS_KIND jumps here for further dispatch. |
465 Bind(&if_nonfast); | 463 Bind(&if_nonfast); |
466 { | 464 { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 typedef StoreWithVectorDescriptor Descriptor; | 740 typedef StoreWithVectorDescriptor Descriptor; |
743 | 741 |
744 Node* receiver = Parameter(Descriptor::kReceiver); | 742 Node* receiver = Parameter(Descriptor::kReceiver); |
745 Node* name = Parameter(Descriptor::kName); | 743 Node* name = Parameter(Descriptor::kName); |
746 Node* value = Parameter(Descriptor::kValue); | 744 Node* value = Parameter(Descriptor::kValue); |
747 Node* slot = Parameter(Descriptor::kSlot); | 745 Node* slot = Parameter(Descriptor::kSlot); |
748 Node* vector = Parameter(Descriptor::kVector); | 746 Node* vector = Parameter(Descriptor::kVector); |
749 Node* context = Parameter(Descriptor::kContext); | 747 Node* context = Parameter(Descriptor::kContext); |
750 | 748 |
751 Variable var_index(this, MachineType::PointerRepresentation()); | 749 Variable var_index(this, MachineType::PointerRepresentation()); |
752 Variable var_unique(this, MachineRepresentation::kTagged); | |
753 var_unique.Bind(name); // Dummy initialization. | |
754 Label if_index(this), if_unique_name(this), slow(this); | 750 Label if_index(this), if_unique_name(this), slow(this); |
755 | 751 |
756 GotoIf(TaggedIsSmi(receiver), &slow); | 752 GotoIf(TaggedIsSmi(receiver), &slow); |
757 Node* receiver_map = LoadMap(receiver); | 753 Node* receiver_map = LoadMap(receiver); |
758 Node* instance_type = LoadMapInstanceType(receiver_map); | 754 Node* instance_type = LoadMapInstanceType(receiver_map); |
759 // Receivers requiring non-standard element accesses (interceptors, access | 755 // Receivers requiring non-standard element accesses (interceptors, access |
760 // checks, strings and string wrappers, proxies) are handled in the runtime. | 756 // checks, strings and string wrappers, proxies) are handled in the runtime. |
761 GotoIf(Int32LessThanOrEqual(instance_type, | 757 GotoIf(Int32LessThanOrEqual(instance_type, |
762 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), | 758 Int32Constant(LAST_CUSTOM_ELEMENTS_RECEIVER)), |
763 &slow); | 759 &slow); |
764 | 760 |
765 TryToName(name, &if_index, &var_index, &if_unique_name, &var_unique, &slow); | 761 TryToName(name, &if_index, &var_index, &if_unique_name, &slow); |
766 | 762 |
767 Bind(&if_index); | 763 Bind(&if_index); |
768 { | 764 { |
769 Comment("integer index"); | 765 Comment("integer index"); |
770 EmitGenericElementStore(receiver, receiver_map, instance_type, | 766 EmitGenericElementStore(receiver, receiver_map, instance_type, |
771 var_index.value(), value, context, &slow); | 767 var_index.value(), value, context, &slow); |
772 } | 768 } |
773 | 769 |
774 Bind(&if_unique_name); | 770 Bind(&if_unique_name); |
775 { | 771 { |
776 Comment("key is unique name"); | 772 Comment("key is unique name"); |
777 StoreICParameters p(context, receiver, var_unique.value(), value, slot, | 773 KeyedStoreGenericAssembler::StoreICParameters p(context, receiver, name, |
778 vector); | 774 value, slot, vector); |
779 EmitGenericPropertyStore(receiver, receiver_map, &p, &slow, language_mode); | 775 EmitGenericPropertyStore(receiver, receiver_map, &p, &slow, language_mode); |
780 } | 776 } |
781 | 777 |
782 Bind(&slow); | 778 Bind(&slow); |
783 { | 779 { |
784 Comment("KeyedStoreGeneric_slow"); | 780 Comment("KeyedStoreGeneric_slow"); |
785 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, | 781 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, |
786 SmiConstant(language_mode)); | 782 SmiConstant(language_mode)); |
787 } | 783 } |
788 } | 784 } |
789 | 785 |
790 } // namespace internal | 786 } // namespace internal |
791 } // namespace v8 | 787 } // namespace v8 |
OLD | NEW |