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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 | 1117 |
1118 | 1118 |
1119 // ----------------------------------------------------------------------------- | 1119 // ----------------------------------------------------------------------------- |
1120 // JSCreateWithContext | 1120 // JSCreateWithContext |
1121 | 1121 |
1122 | 1122 |
1123 TEST_F(JSTypedLoweringTest, JSCreateWithContext) { | 1123 TEST_F(JSTypedLoweringTest, JSCreateWithContext) { |
1124 Node* const object = Parameter(Type::Receiver()); | 1124 Node* const object = Parameter(Type::Receiver()); |
1125 Node* const closure = Parameter(Type::Function()); | 1125 Node* const closure = Parameter(Type::Function()); |
1126 Node* const context = Parameter(Type::Any()); | 1126 Node* const context = Parameter(Type::Any()); |
1127 Node* const frame_state = EmptyFrameState(); | |
1128 Node* const effect = graph()->start(); | 1127 Node* const effect = graph()->start(); |
1129 Node* const control = graph()->start(); | 1128 Node* const control = graph()->start(); |
1130 Reduction r = | 1129 Reduction r = |
1131 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, | 1130 Reduce(graph()->NewNode(javascript()->CreateWithContext(), object, |
1132 closure, context, frame_state, effect, control)); | 1131 closure, context, effect, control)); |
1133 ASSERT_TRUE(r.Changed()); | 1132 ASSERT_TRUE(r.Changed()); |
1134 EXPECT_THAT(r.replacement(), | 1133 EXPECT_THAT(r.replacement(), |
1135 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( | 1134 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
1136 Context::MIN_CONTEXT_SLOTS)), | 1135 Context::MIN_CONTEXT_SLOTS)), |
1137 IsBeginRegion(_), control), | 1136 IsBeginRegion(_), control), |
1138 _)); | 1137 _)); |
1139 } | 1138 } |
1140 | 1139 |
1141 | 1140 |
1142 // ----------------------------------------------------------------------------- | 1141 // ----------------------------------------------------------------------------- |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, | 1220 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, |
1222 frame_state, effect, control); | 1221 frame_state, effect, control); |
1223 Reduction r = Reduce(instanceOf); | 1222 Reduction r = Reduce(instanceOf); |
1224 ASSERT_FALSE(r.Changed()); | 1223 ASSERT_FALSE(r.Changed()); |
1225 ASSERT_EQ(instanceOf, dummy->InputAt(0)); | 1224 ASSERT_EQ(instanceOf, dummy->InputAt(0)); |
1226 } | 1225 } |
1227 | 1226 |
1228 } // namespace compiler | 1227 } // namespace compiler |
1229 } // namespace internal | 1228 } // namespace internal |
1230 } // namespace v8 | 1229 } // namespace v8 |
OLD | NEW |