| 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/compilation-dependencies.h" | 7 #include "src/compilation-dependencies.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/js-operator.h" | 10 #include "src/compiler/js-operator.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 } | 153 } |
| 154 | 154 |
| 155 // ----------------------------------------------------------------------------- | 155 // ----------------------------------------------------------------------------- |
| 156 // JSCreateFunctionContext | 156 // JSCreateFunctionContext |
| 157 | 157 |
| 158 TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) { | 158 TEST_F(JSCreateLoweringTest, JSCreateFunctionContextViaInlinedAllocation) { |
| 159 Node* const closure = Parameter(Type::Any()); | 159 Node* const closure = Parameter(Type::Any()); |
| 160 Node* const context = Parameter(Type::Any()); | 160 Node* const context = Parameter(Type::Any()); |
| 161 Node* const effect = graph()->start(); | 161 Node* const effect = graph()->start(); |
| 162 Node* const control = graph()->start(); | 162 Node* const control = graph()->start(); |
| 163 Reduction const r = | 163 Reduction const r = Reduce( |
| 164 Reduce(graph()->NewNode(javascript()->CreateFunctionContext(8), closure, | 164 graph()->NewNode(javascript()->CreateFunctionContext(8, FUNCTION_SCOPE), |
| 165 context, effect, control)); | 165 closure, context, effect, control)); |
| 166 ASSERT_TRUE(r.Changed()); | 166 ASSERT_TRUE(r.Changed()); |
| 167 EXPECT_THAT(r.replacement(), | 167 EXPECT_THAT(r.replacement(), |
| 168 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( | 168 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 169 8 + Context::MIN_CONTEXT_SLOTS)), | 169 8 + Context::MIN_CONTEXT_SLOTS)), |
| 170 IsBeginRegion(_), control), | 170 IsBeginRegion(_), control), |
| 171 _)); | 171 _)); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // ----------------------------------------------------------------------------- | 174 // ----------------------------------------------------------------------------- |
| 175 // JSCreateWithContext | 175 // JSCreateWithContext |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 EXPECT_THAT(r.replacement(), | 210 EXPECT_THAT(r.replacement(), |
| 211 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( | 211 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
| 212 Context::MIN_CONTEXT_SLOTS + 1)), | 212 Context::MIN_CONTEXT_SLOTS + 1)), |
| 213 IsBeginRegion(_), control), | 213 IsBeginRegion(_), control), |
| 214 _)); | 214 _)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace compiler | 217 } // namespace compiler |
| 218 } // namespace internal | 218 } // namespace internal |
| 219 } // namespace v8 | 219 } // namespace v8 |
| OLD | NEW |