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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 if (!FLAG_turbo_allocate) return; | 1059 if (!FLAG_turbo_allocate) return; |
1060 Node* const closure = Parameter(Type::Any()); | 1060 Node* const closure = Parameter(Type::Any()); |
1061 Node* const context = Parameter(Type::Any()); | 1061 Node* const context = Parameter(Type::Any()); |
1062 Node* const effect = graph()->start(); | 1062 Node* const effect = graph()->start(); |
1063 Node* const control = graph()->start(); | 1063 Node* const control = graph()->start(); |
1064 Reduction const r = | 1064 Reduction const r = |
1065 Reduce(graph()->NewNode(javascript()->CreateFunctionContext(8), closure, | 1065 Reduce(graph()->NewNode(javascript()->CreateFunctionContext(8), closure, |
1066 context, effect, control)); | 1066 context, effect, control)); |
1067 ASSERT_TRUE(r.Changed()); | 1067 ASSERT_TRUE(r.Changed()); |
1068 EXPECT_THAT(r.replacement(), | 1068 EXPECT_THAT(r.replacement(), |
1069 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1069 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
1070 8 + Context::MIN_CONTEXT_SLOTS)), | 1070 8 + Context::MIN_CONTEXT_SLOTS)), |
1071 effect, control), | 1071 IsBeginRegion(effect), control), |
1072 _)); | 1072 _)); |
1073 } | 1073 } |
1074 | 1074 |
1075 | 1075 |
1076 TEST_F(JSTypedLoweringTest, JSCreateFunctionContextViaStub) { | 1076 TEST_F(JSTypedLoweringTest, JSCreateFunctionContextViaStub) { |
1077 Node* const closure = Parameter(Type::Any()); | 1077 Node* const closure = Parameter(Type::Any()); |
1078 Node* const context = Parameter(Type::Any()); | 1078 Node* const context = Parameter(Type::Any()); |
1079 Node* const effect = graph()->start(); | 1079 Node* const effect = graph()->start(); |
1080 Node* const control = graph()->start(); | 1080 Node* const control = graph()->start(); |
1081 Reduction const r = | 1081 Reduction const r = |
1082 Reduce(graph()->NewNode(javascript()->CreateFunctionContext(32), closure, | 1082 Reduce(graph()->NewNode(javascript()->CreateFunctionContext(32), closure, |
(...skipping 16 matching lines...) Expand all Loading... |
1099 Node* const closure = Parameter(Type::Any()); | 1099 Node* const closure = Parameter(Type::Any()); |
1100 Node* const context = Parameter(Type::Any()); | 1100 Node* const context = Parameter(Type::Any()); |
1101 Node* const frame_state = EmptyFrameState(); | 1101 Node* const frame_state = EmptyFrameState(); |
1102 Node* const effect = graph()->start(); | 1102 Node* const effect = graph()->start(); |
1103 Node* const control = graph()->start(); | 1103 Node* const control = graph()->start(); |
1104 Reduction r = | 1104 Reduction r = |
1105 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, | 1105 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, |
1106 closure, context, frame_state, effect, control)); | 1106 closure, context, frame_state, effect, control)); |
1107 ASSERT_TRUE(r.Changed()); | 1107 ASSERT_TRUE(r.Changed()); |
1108 EXPECT_THAT(r.replacement(), | 1108 EXPECT_THAT(r.replacement(), |
1109 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1109 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
1110 Context::MIN_CONTEXT_SLOTS)), | 1110 Context::MIN_CONTEXT_SLOTS)), |
1111 effect, control), | 1111 IsBeginRegion(effect), control), |
1112 _)); | 1112 _)); |
1113 } | 1113 } |
1114 | 1114 |
1115 } // namespace compiler | 1115 } // namespace compiler |
1116 } // namespace internal | 1116 } // namespace internal |
1117 } // namespace v8 | 1117 } // namespace v8 |
OLD | NEW |