| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compiler/js-create-lowering.h" | 5 #include "src/compiler/js-create-lowering.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 IsFinishRegion(IsAllocate(IsNumberConstant(JSArray::kSize), _, _), _)); | 132 IsFinishRegion(IsAllocate(IsNumberConstant(JSArray::kSize), _, _), _)); |
| 133 } | 133 } |
| 134 | 134 |
| 135 // ----------------------------------------------------------------------------- | 135 // ----------------------------------------------------------------------------- |
| 136 // JSCreateClosure | 136 // JSCreateClosure |
| 137 | 137 |
| 138 TEST_F(JSCreateLoweringTest, JSCreateClosureViaInlinedAllocation) { | 138 TEST_F(JSCreateLoweringTest, JSCreateClosureViaInlinedAllocation) { |
| 139 Node* const context = UndefinedConstant(); | 139 Node* const context = UndefinedConstant(); |
| 140 Node* const effect = graph()->start(); | 140 Node* const effect = graph()->start(); |
| 141 Node* const control = graph()->start(); | 141 Node* const control = graph()->start(); |
| 142 Handle<SharedFunctionInfo> shared(isolate()->object_function()->shared()); | 142 Handle<SharedFunctionInfo> shared(isolate()->number_function()->shared()); |
| 143 Reduction r = | 143 Reduction r = |
| 144 Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED), | 144 Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED), |
| 145 context, effect, control)); | 145 context, effect, control)); |
| 146 ASSERT_TRUE(r.Changed()); | 146 ASSERT_TRUE(r.Changed()); |
| 147 EXPECT_THAT(r.replacement(), | 147 EXPECT_THAT(r.replacement(), |
| 148 IsFinishRegion(IsAllocate(IsNumberConstant(JSFunction::kSize), | 148 IsFinishRegion(IsAllocate(IsNumberConstant(JSFunction::kSize), |
| 149 IsBeginRegion(_), control), | 149 IsBeginRegion(_), control), |
| 150 _)); | 150 _)); |
| 151 } | 151 } |
| 152 | 152 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 EXPECT_THAT(r.replacement(), | 206 EXPECT_THAT(r.replacement(), |
| 207 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( | 207 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 208 Context::MIN_CONTEXT_SLOTS + 1)), | 208 Context::MIN_CONTEXT_SLOTS + 1)), |
| 209 IsBeginRegion(_), control), | 209 IsBeginRegion(_), control), |
| 210 _)); | 210 _)); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace compiler | 213 } // namespace compiler |
| 214 } // namespace internal | 214 } // namespace internal |
| 215 } // namespace v8 | 215 } // namespace v8 |
| OLD | NEW |