OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); | 735 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
736 Node* base = HeapConstant(array); | 736 Node* base = HeapConstant(array); |
737 Node* value = | 737 Node* value = |
738 Parameter(AccessBuilder::ForTypedArrayElement(type, true).type); | 738 Parameter(AccessBuilder::ForTypedArrayElement(type, true).type); |
739 Node* vector = UndefinedConstant(); | 739 Node* vector = UndefinedConstant(); |
740 Node* context = UndefinedConstant(); | 740 Node* context = UndefinedConstant(); |
741 Node* effect = graph()->start(); | 741 Node* effect = graph()->start(); |
742 Node* control = graph()->start(); | 742 Node* control = graph()->start(); |
743 VectorSlotPair feedback; | 743 VectorSlotPair feedback; |
744 const Operator* op = javascript()->StoreProperty(language_mode, feedback); | 744 const Operator* op = javascript()->StoreProperty(language_mode, feedback); |
745 Node* node = graph()->NewNode(op, base, key, value, vector, context, | 745 Node* node = graph()->NewNode(op, base, key, value, vector, context); |
746 EmptyFrameState(), EmptyFrameState(), | 746 for (int i = 0; |
747 effect, control); | 747 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 748 node->AppendInput(zone(), EmptyFrameState()); |
| 749 } |
| 750 node->AppendInput(zone(), effect); |
| 751 node->AppendInput(zone(), control); |
748 Reduction r = Reduce(node); | 752 Reduction r = Reduce(node); |
749 | 753 |
750 Matcher<Node*> offset_matcher = | 754 Matcher<Node*> offset_matcher = |
751 element_size == 1 | 755 element_size == 1 |
752 ? key | 756 ? key |
753 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); | 757 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); |
754 | 758 |
755 ASSERT_TRUE(r.Changed()); | 759 ASSERT_TRUE(r.Changed()); |
756 EXPECT_THAT( | 760 EXPECT_THAT( |
757 r.replacement(), | 761 r.replacement(), |
(...skipping 21 matching lines...) Expand all Loading... |
779 Node* key = Parameter( | 783 Node* key = Parameter( |
780 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); | 784 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
781 Node* base = HeapConstant(array); | 785 Node* base = HeapConstant(array); |
782 Node* value = Parameter(Type::Any()); | 786 Node* value = Parameter(Type::Any()); |
783 Node* vector = UndefinedConstant(); | 787 Node* vector = UndefinedConstant(); |
784 Node* context = UndefinedConstant(); | 788 Node* context = UndefinedConstant(); |
785 Node* effect = graph()->start(); | 789 Node* effect = graph()->start(); |
786 Node* control = graph()->start(); | 790 Node* control = graph()->start(); |
787 VectorSlotPair feedback; | 791 VectorSlotPair feedback; |
788 const Operator* op = javascript()->StoreProperty(language_mode, feedback); | 792 const Operator* op = javascript()->StoreProperty(language_mode, feedback); |
789 Node* node = graph()->NewNode(op, base, key, value, vector, context, | 793 Node* node = graph()->NewNode(op, base, key, value, vector, context); |
790 EmptyFrameState(), EmptyFrameState(), | 794 for (int i = 0; |
791 effect, control); | 795 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 796 node->AppendInput(zone(), EmptyFrameState()); |
| 797 } |
| 798 node->AppendInput(zone(), effect); |
| 799 node->AppendInput(zone(), control); |
792 Reduction r = Reduce(node); | 800 Reduction r = Reduce(node); |
793 | 801 |
794 Matcher<Node*> offset_matcher = | 802 Matcher<Node*> offset_matcher = |
795 element_size == 1 | 803 element_size == 1 |
796 ? key | 804 ? key |
797 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); | 805 : IsWord32Shl(key, IsInt32Constant(WhichPowerOf2(element_size))); |
798 | 806 |
799 Matcher<Node*> value_matcher = | 807 Matcher<Node*> value_matcher = |
800 IsToNumber(value, context, effect, control); | 808 IsToNumber(value, context, effect, control); |
801 Matcher<Node*> effect_matcher = value_matcher; | 809 Matcher<Node*> effect_matcher = value_matcher; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 if (min > max) std::swap(min, max); | 844 if (min > max) std::swap(min, max); |
837 Node* key = Parameter(Type::Range(min, max, zone())); | 845 Node* key = Parameter(Type::Range(min, max, zone())); |
838 Node* base = HeapConstant(array); | 846 Node* base = HeapConstant(array); |
839 Node* value = Parameter(access.type); | 847 Node* value = Parameter(access.type); |
840 Node* vector = UndefinedConstant(); | 848 Node* vector = UndefinedConstant(); |
841 Node* context = UndefinedConstant(); | 849 Node* context = UndefinedConstant(); |
842 Node* effect = graph()->start(); | 850 Node* effect = graph()->start(); |
843 Node* control = graph()->start(); | 851 Node* control = graph()->start(); |
844 VectorSlotPair feedback; | 852 VectorSlotPair feedback; |
845 const Operator* op = javascript()->StoreProperty(language_mode, feedback); | 853 const Operator* op = javascript()->StoreProperty(language_mode, feedback); |
846 Node* node = graph()->NewNode(op, base, key, value, vector, context, | 854 Node* node = graph()->NewNode(op, base, key, value, vector, context); |
847 EmptyFrameState(), EmptyFrameState(), | 855 for (int i = 0; |
848 effect, control); | 856 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 857 node->AppendInput(zone(), EmptyFrameState()); |
| 858 } |
| 859 node->AppendInput(zone(), effect); |
| 860 node->AppendInput(zone(), control); |
849 Reduction r = Reduce(node); | 861 Reduction r = Reduce(node); |
850 | 862 |
851 ASSERT_TRUE(r.Changed()); | 863 ASSERT_TRUE(r.Changed()); |
852 EXPECT_THAT( | 864 EXPECT_THAT( |
853 r.replacement(), | 865 r.replacement(), |
854 IsStoreElement( | 866 IsStoreElement( |
855 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), | 867 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
856 key, value, effect, control)); | 868 key, value, effect, control)); |
857 } | 869 } |
858 } | 870 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 EXPECT_THAT(r.replacement(), | 1115 EXPECT_THAT(r.replacement(), |
1104 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1116 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
1105 Context::MIN_CONTEXT_SLOTS)), | 1117 Context::MIN_CONTEXT_SLOTS)), |
1106 effect, control), | 1118 effect, control), |
1107 _)); | 1119 _)); |
1108 } | 1120 } |
1109 | 1121 |
1110 } // namespace compiler | 1122 } // namespace compiler |
1111 } // namespace internal | 1123 } // namespace internal |
1112 } // namespace v8 | 1124 } // namespace v8 |
OLD | NEW |