| 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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { | 729 TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { |
| 730 Handle<JSTypedArray> array = | 730 Handle<JSTypedArray> array = |
| 731 factory()->NewJSTypedArray(type, buffer, 0, kLength); | 731 factory()->NewJSTypedArray(type, buffer, 0, kLength); |
| 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* vector = UndefinedConstant(); |
| 739 Node* context = UndefinedConstant(); | 740 Node* context = UndefinedConstant(); |
| 740 Node* effect = graph()->start(); | 741 Node* effect = graph()->start(); |
| 741 Node* control = graph()->start(); | 742 Node* control = graph()->start(); |
| 742 ResolvedFeedbackSlot slot; | 743 ResolvedFeedbackSlot slot; |
| 743 Node* node = | 744 const Operator* op = javascript()->StoreProperty(language_mode, slot); |
| 744 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), | 745 Node* node = FLAG_vector_stores |
| 745 base, key, value, context); | 746 ? graph()->NewNode(op, base, key, value, vector, context) |
| 747 : graph()->NewNode(op, base, key, value, context); |
| 746 for (int i = 0; | 748 for (int i = 0; |
| 747 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 749 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 748 node->AppendInput(zone(), EmptyFrameState()); | 750 node->AppendInput(zone(), EmptyFrameState()); |
| 749 } | 751 } |
| 750 node->AppendInput(zone(), effect); | 752 node->AppendInput(zone(), effect); |
| 751 node->AppendInput(zone(), control); | 753 node->AppendInput(zone(), control); |
| 752 Reduction r = Reduce(node); | 754 Reduction r = Reduce(node); |
| 753 | 755 |
| 754 Matcher<Node*> offset_matcher = | 756 Matcher<Node*> offset_matcher = |
| 755 element_size == 1 | 757 element_size == 1 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 777 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { | 779 TRACED_FOREACH(ExternalArrayType, type, kExternalArrayTypes) { |
| 778 TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { | 780 TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) { |
| 779 Handle<JSTypedArray> array = | 781 Handle<JSTypedArray> array = |
| 780 factory()->NewJSTypedArray(type, buffer, 0, kLength); | 782 factory()->NewJSTypedArray(type, buffer, 0, kLength); |
| 781 int const element_size = static_cast<int>(array->element_size()); | 783 int const element_size = static_cast<int>(array->element_size()); |
| 782 | 784 |
| 783 Node* key = Parameter( | 785 Node* key = Parameter( |
| 784 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); | 786 Type::Range(kMinInt / element_size, kMaxInt / element_size, zone())); |
| 785 Node* base = HeapConstant(array); | 787 Node* base = HeapConstant(array); |
| 786 Node* value = Parameter(Type::Any()); | 788 Node* value = Parameter(Type::Any()); |
| 789 Node* vector = UndefinedConstant(); |
| 787 Node* context = UndefinedConstant(); | 790 Node* context = UndefinedConstant(); |
| 788 Node* effect = graph()->start(); | 791 Node* effect = graph()->start(); |
| 789 Node* control = graph()->start(); | 792 Node* control = graph()->start(); |
| 790 ResolvedFeedbackSlot slot; | 793 ResolvedFeedbackSlot slot; |
| 791 Node* node = | 794 const Operator* op = javascript()->StoreProperty(language_mode, slot); |
| 792 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), | 795 Node* node = FLAG_vector_stores |
| 793 base, key, value, context); | 796 ? graph()->NewNode(op, base, key, value, vector, context) |
| 797 : graph()->NewNode(op, base, key, value, context); |
| 794 for (int i = 0; | 798 for (int i = 0; |
| 795 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 799 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 796 node->AppendInput(zone(), EmptyFrameState()); | 800 node->AppendInput(zone(), EmptyFrameState()); |
| 797 } | 801 } |
| 798 node->AppendInput(zone(), effect); | 802 node->AppendInput(zone(), effect); |
| 799 node->AppendInput(zone(), control); | 803 node->AppendInput(zone(), control); |
| 800 Reduction r = Reduce(node); | 804 Reduction r = Reduce(node); |
| 801 | 805 |
| 802 Matcher<Node*> offset_matcher = | 806 Matcher<Node*> offset_matcher = |
| 803 element_size == 1 | 807 element_size == 1 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 Handle<JSTypedArray> array = | 842 Handle<JSTypedArray> array = |
| 839 factory()->NewJSTypedArray(type, buffer, 0, kLength); | 843 factory()->NewJSTypedArray(type, buffer, 0, kLength); |
| 840 ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true); | 844 ElementAccess access = AccessBuilder::ForTypedArrayElement(type, true); |
| 841 | 845 |
| 842 int min = random_number_generator()->NextInt(static_cast<int>(kLength)); | 846 int min = random_number_generator()->NextInt(static_cast<int>(kLength)); |
| 843 int max = random_number_generator()->NextInt(static_cast<int>(kLength)); | 847 int max = random_number_generator()->NextInt(static_cast<int>(kLength)); |
| 844 if (min > max) std::swap(min, max); | 848 if (min > max) std::swap(min, max); |
| 845 Node* key = Parameter(Type::Range(min, max, zone())); | 849 Node* key = Parameter(Type::Range(min, max, zone())); |
| 846 Node* base = HeapConstant(array); | 850 Node* base = HeapConstant(array); |
| 847 Node* value = Parameter(access.type); | 851 Node* value = Parameter(access.type); |
| 852 Node* vector = UndefinedConstant(); |
| 848 Node* context = UndefinedConstant(); | 853 Node* context = UndefinedConstant(); |
| 849 Node* effect = graph()->start(); | 854 Node* effect = graph()->start(); |
| 850 Node* control = graph()->start(); | 855 Node* control = graph()->start(); |
| 851 ResolvedFeedbackSlot slot; | 856 ResolvedFeedbackSlot slot; |
| 852 Node* node = | 857 const Operator* op = javascript()->StoreProperty(language_mode, slot); |
| 853 graph()->NewNode(javascript()->StoreProperty(language_mode, slot), | 858 Node* node = FLAG_vector_stores |
| 854 base, key, value, context); | 859 ? graph()->NewNode(op, base, key, value, vector, context) |
| 860 : graph()->NewNode(op, base, key, value, context); |
| 855 for (int i = 0; | 861 for (int i = 0; |
| 856 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { | 862 i < OperatorProperties::GetFrameStateInputCount(node->op()); i++) { |
| 857 node->AppendInput(zone(), EmptyFrameState()); | 863 node->AppendInput(zone(), EmptyFrameState()); |
| 858 } | 864 } |
| 859 node->AppendInput(zone(), effect); | 865 node->AppendInput(zone(), effect); |
| 860 node->AppendInput(zone(), control); | 866 node->AppendInput(zone(), control); |
| 861 Reduction r = Reduce(node); | 867 Reduction r = Reduce(node); |
| 862 | 868 |
| 863 ASSERT_TRUE(r.Changed()); | 869 ASSERT_TRUE(r.Changed()); |
| 864 EXPECT_THAT( | 870 EXPECT_THAT( |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 EXPECT_THAT(r.replacement(), | 1099 EXPECT_THAT(r.replacement(), |
| 1094 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1100 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 1095 Context::MIN_CONTEXT_SLOTS)), | 1101 Context::MIN_CONTEXT_SLOTS)), |
| 1096 effect, control), | 1102 effect, control), |
| 1097 _)); | 1103 _)); |
| 1098 } | 1104 } |
| 1099 | 1105 |
| 1100 } // namespace compiler | 1106 } // namespace compiler |
| 1101 } // namespace internal | 1107 } // namespace internal |
| 1102 } // namespace v8 | 1108 } // namespace v8 |
| OLD | NEW |