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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 // ----------------------------------------------------------------------------- | 981 // ----------------------------------------------------------------------------- |
982 // JSCreate | 982 // JSCreate |
983 | 983 |
984 | 984 |
985 TEST_F(JSTypedLoweringTest, JSCreate) { | 985 TEST_F(JSTypedLoweringTest, JSCreate) { |
986 Handle<JSFunction> function = isolate()->object_function(); | 986 Handle<JSFunction> function = isolate()->object_function(); |
987 Node* const target = Parameter(Type::Constant(function, graph()->zone())); | 987 Node* const target = Parameter(Type::Constant(function, graph()->zone())); |
988 Node* const context = Parameter(Type::Any()); | 988 Node* const context = Parameter(Type::Any()); |
989 Node* const effect = graph()->start(); | 989 Node* const effect = graph()->start(); |
990 Reduction r = Reduce(graph()->NewNode(javascript()->Create(), target, target, | 990 Reduction r = Reduce(graph()->NewNode(javascript()->Create(), target, target, |
991 context, effect)); | 991 context, EmptyFrameState(), effect)); |
992 ASSERT_TRUE(r.Changed()); | 992 ASSERT_TRUE(r.Changed()); |
993 EXPECT_THAT( | 993 EXPECT_THAT( |
994 r.replacement(), | 994 r.replacement(), |
995 IsFinishRegion( | 995 IsFinishRegion( |
996 IsAllocate(IsNumberConstant(function->initial_map()->instance_size()), | 996 IsAllocate(IsNumberConstant(function->initial_map()->instance_size()), |
997 IsBeginRegion(effect), _), | 997 IsBeginRegion(effect), _), |
998 _)); | 998 _)); |
999 } | 999 } |
1000 | 1000 |
1001 | 1001 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, | 1253 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, |
1254 frame_state, effect, control); | 1254 frame_state, effect, control); |
1255 Reduction r = Reduce(instanceOf); | 1255 Reduction r = Reduce(instanceOf); |
1256 ASSERT_FALSE(r.Changed()); | 1256 ASSERT_FALSE(r.Changed()); |
1257 ASSERT_EQ(instanceOf, dummy->InputAt(0)); | 1257 ASSERT_EQ(instanceOf, dummy->InputAt(0)); |
1258 } | 1258 } |
1259 | 1259 |
1260 } // namespace compiler | 1260 } // namespace compiler |
1261 } // namespace internal | 1261 } // namespace internal |
1262 } // namespace v8 | 1262 } // namespace v8 |
OLD | NEW |