| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 int const element_size = static_cast<int>(array->element_size()); | 732 int const element_size = static_cast<int>(array->element_size()); |
| 733 | 733 |
| 734 Node* key = Parameter( | 734 Node* key = Parameter( |
| 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* context = UndefinedConstant(); | 739 Node* context = UndefinedConstant(); |
| 740 Node* effect = graph()->start(); | 740 Node* effect = graph()->start(); |
| 741 Node* control = graph()->start(); | 741 Node* control = graph()->start(); |
| 742 Node* node = graph()->NewNode(javascript()->StoreProperty(language_mode), | 742 ResolvedFeedbackSlot slot; |
| 743 base, key, value, context); | 743 Node* node = |
| 744 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), |
| 745 base, key, value, context); |
| 744 for (int i = 0; | 746 for (int i = 0; |
| 745 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 747 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 746 node->AppendInput(zone(), EmptyFrameState()); | 748 node->AppendInput(zone(), EmptyFrameState()); |
| 747 } | 749 } |
| 748 node->AppendInput(zone(), effect); | 750 node->AppendInput(zone(), effect); |
| 749 node->AppendInput(zone(), control); | 751 node->AppendInput(zone(), control); |
| 750 Reduction r = Reduce(node); | 752 Reduction r = Reduce(node); |
| 751 | 753 |
| 752 Matcher<Node*> offset_matcher = | 754 Matcher<Node*> offset_matcher = |
| 753 element_size == 1 | 755 element_size == 1 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 778 factory()->NewJSTypedArray(type, buffer, 0, kLength); | 780 factory()->NewJSTypedArray(type, buffer, 0, kLength); |
| 779 int const element_size = static_cast<int>(array->element_size()); | 781 int const element_size = static_cast<int>(array->element_size()); |
| 780 | 782 |
| 781 Node* key = Parameter( | 783 Node* key = Parameter( |
| 782 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); | 784 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
| 783 Node* base = HeapConstant(array); | 785 Node* base = HeapConstant(array); |
| 784 Node* value = Parameter(Type::Any()); | 786 Node* value = Parameter(Type::Any()); |
| 785 Node* context = UndefinedConstant(); | 787 Node* context = UndefinedConstant(); |
| 786 Node* effect = graph()->start(); | 788 Node* effect = graph()->start(); |
| 787 Node* control = graph()->start(); | 789 Node* control = graph()->start(); |
| 788 Node* node = graph()->NewNode(javascript()->StoreProperty(language_mode), | 790 ResolvedFeedbackSlot slot; |
| 789 base, key, value, context); | 791 Node* node = |
| 792 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), |
| 793 base, key, value, context); |
| 790 for (int i = 0; | 794 for (int i = 0; |
| 791 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 795 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 792 node->AppendInput(zone(), EmptyFrameState()); | 796 node->AppendInput(zone(), EmptyFrameState()); |
| 793 } | 797 } |
| 794 node->AppendInput(zone(), effect); | 798 node->AppendInput(zone(), effect); |
| 795 node->AppendInput(zone(), control); | 799 node->AppendInput(zone(), control); |
| 796 Reduction r = Reduce(node); | 800 Reduction r = Reduce(node); |
| 797 | 801 |
| 798 Matcher<Node*> offset_matcher = | 802 Matcher<Node*> offset_matcher = |
| 799 element_size == 1 | 803 element_size == 1 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 | 841 |
| 838 int min = random_number_generator()->NextInt(static_cast<int>(kLength)); | 842 int min = random_number_generator()->NextInt(static_cast<int>(kLength)); |
| 839 int max = random_number_generator()->NextInt(static_cast<int>(kLength)); | 843 int max = random_number_generator()->NextInt(static_cast<int>(kLength)); |
| 840 if (min > max) std::swap(min, max); | 844 if (min > max) std::swap(min, max); |
| 841 Node* key = Parameter(Type::Range(min, max, zone())); | 845 Node* key = Parameter(Type::Range(min, max, zone())); |
| 842 Node* base = HeapConstant(array); | 846 Node* base = HeapConstant(array); |
| 843 Node* value = Parameter(access.type); | 847 Node* value = Parameter(access.type); |
| 844 Node* context = UndefinedConstant(); | 848 Node* context = UndefinedConstant(); |
| 845 Node* effect = graph()->start(); | 849 Node* effect = graph()->start(); |
| 846 Node* control = graph()->start(); | 850 Node* control = graph()->start(); |
| 847 Node* node = graph()->NewNode(javascript()->StoreProperty(language_mode), | 851 ResolvedFeedbackSlot slot; |
| 848 base, key, value, context); | 852 Node* node = |
| 853 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), |
| 854 base, key, value, context); |
| 849 for (int i = 0; | 855 for (int i = 0; |
| 850 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 856 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 851 node->AppendInput(zone(), EmptyFrameState()); | 857 node->AppendInput(zone(), EmptyFrameState()); |
| 852 } | 858 } |
| 853 node->AppendInput(zone(), effect); | 859 node->AppendInput(zone(), effect); |
| 854 node->AppendInput(zone(), control); | 860 node->AppendInput(zone(), control); |
| 855 Reduction r = Reduce(node); | 861 Reduction r = Reduce(node); |
| 856 | 862 |
| 857 ASSERT_TRUE(r.Changed()); | 863 ASSERT_TRUE(r.Changed()); |
| 858 EXPECT_THAT( | 864 EXPECT_THAT( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1087 EXPECT_THAT(r.replacement(), | 1093 EXPECT_THAT(r.replacement(), |
| 1088 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1094 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 1089 Context::MIN_CONTEXT_SLOTS)), | 1095 Context::MIN_CONTEXT_SLOTS)), |
| 1090 effect, control), | 1096 effect, control), |
| 1091 _)); | 1097 _)); |
| 1092 } | 1098 } |
| 1093 | 1099 |
| 1094 } // namespace compiler | 1100 } // namespace compiler |
| 1095 } // namespace internal | 1101 } // namespace internal |
| 1096 } // namespace v8 | 1102 } // namespace v8 |
| OLD | NEW |