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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 // JSCreateClosure | 1031 // JSCreateClosure |
1032 | 1032 |
1033 | 1033 |
1034 TEST_F(JSTypedLoweringTest, JSCreateClosure) { | 1034 TEST_F(JSTypedLoweringTest, JSCreateClosure) { |
1035 Node* const context = UndefinedConstant(); | 1035 Node* const context = UndefinedConstant(); |
1036 Node* const effect = graph()->start(); | 1036 Node* const effect = graph()->start(); |
1037 Node* const control = graph()->start(); | 1037 Node* const control = graph()->start(); |
1038 Handle<SharedFunctionInfo> shared(isolate()->object_function()->shared()); | 1038 Handle<SharedFunctionInfo> shared(isolate()->object_function()->shared()); |
1039 Reduction r = | 1039 Reduction r = |
1040 Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED), | 1040 Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED), |
1041 context, context, effect, control)); | 1041 context, effect, control)); |
1042 ASSERT_TRUE(r.Changed()); | 1042 ASSERT_TRUE(r.Changed()); |
1043 EXPECT_THAT(r.replacement(), | 1043 EXPECT_THAT(r.replacement(), |
1044 IsCall(_, IsHeapConstant(CodeFactory::FastNewClosure( | 1044 IsCall(_, IsHeapConstant(CodeFactory::FastNewClosure( |
1045 isolate(), shared->language_mode(), | 1045 isolate(), shared->language_mode(), |
1046 shared->kind()).code()), | 1046 shared->kind()).code()), |
1047 IsHeapConstant(shared), effect, control)); | 1047 IsHeapConstant(shared), effect, control)); |
1048 } | 1048 } |
1049 | 1049 |
1050 | 1050 |
1051 // ----------------------------------------------------------------------------- | 1051 // ----------------------------------------------------------------------------- |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1115 EXPECT_THAT(r.replacement(), | 1115 EXPECT_THAT(r.replacement(), |
1116 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( | 1116 IsFinish(IsAllocate(IsNumberConstant(Context::SizeFor( |
1117 Context::MIN_CONTEXT_SLOTS)), | 1117 Context::MIN_CONTEXT_SLOTS)), |
1118 effect, control), | 1118 effect, control), |
1119 _)); | 1119 _)); |
1120 } | 1120 } |
1121 | 1121 |
1122 } // namespace compiler | 1122 } // namespace compiler |
1123 } // namespace internal | 1123 } // namespace internal |
1124 } // namespace v8 | 1124 } // namespace v8 |
OLD | NEW |