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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 ASSERT_TRUE(r.Changed()); | 133 ASSERT_TRUE(r.Changed()); |
134 EXPECT_THAT( | 134 EXPECT_THAT( |
135 r.replacement(), | 135 r.replacement(), |
136 IsFinishRegion(IsAllocate(IsNumberConstant(JSArray::kSize), _, _), _)); | 136 IsFinishRegion(IsAllocate(IsNumberConstant(JSArray::kSize), _, _), _)); |
137 } | 137 } |
138 | 138 |
139 // ----------------------------------------------------------------------------- | 139 // ----------------------------------------------------------------------------- |
140 // JSCreateClosure | 140 // JSCreateClosure |
141 | 141 |
142 TEST_F(JSCreateLoweringTest, JSCreateClosureViaInlinedAllocation) { | 142 TEST_F(JSCreateLoweringTest, JSCreateClosureViaInlinedAllocation) { |
| 143 if (!FLAG_turbo_lower_create_closure) return; |
143 Node* const context = UndefinedConstant(); | 144 Node* const context = UndefinedConstant(); |
144 Node* const effect = graph()->start(); | 145 Node* const effect = graph()->start(); |
145 Node* const control = graph()->start(); | 146 Node* const control = graph()->start(); |
146 Handle<SharedFunctionInfo> shared(isolate()->number_function()->shared()); | 147 Handle<SharedFunctionInfo> shared(isolate()->number_function()->shared()); |
147 | 148 |
148 // Create a mock feedback vector. It just has to be an array with an array | 149 // Create a mock feedback vector. It just has to be an array with an array |
149 // in slot 0. | 150 // in slot 0. |
150 Handle<FixedArray> array = isolate()->factory()->NewFixedArray( | 151 Handle<FixedArray> array = isolate()->factory()->NewFixedArray( |
151 TypeFeedbackVector::kReservedIndexCount + 1); | 152 TypeFeedbackVector::kReservedIndexCount + 1); |
152 array->set_map_no_write_barrier( | 153 array->set_map_no_write_barrier( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 EXPECT_THAT(r.replacement(), | 225 EXPECT_THAT(r.replacement(), |
225 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( | 226 IsFinishRegion(IsAllocate(IsNumberConstant(Context::SizeFor( |
226 Context::MIN_CONTEXT_SLOTS + 1)), | 227 Context::MIN_CONTEXT_SLOTS + 1)), |
227 IsBeginRegion(_), control), | 228 IsBeginRegion(_), control), |
228 _)); | 229 _)); |
229 } | 230 } |
230 | 231 |
231 } // namespace compiler | 232 } // namespace compiler |
232 } // namespace internal | 233 } // namespace internal |
233 } // namespace v8 | 234 } // namespace v8 |
OLD | NEW |