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/v8.h" | 5 #include "src/v8.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 | 7 |
8 #include "src/compiler/code-generator.h" | 8 #include "src/compiler/code-generator.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Unique<Object>::CreateUninitialized(caller_context); | 138 Unique<Object>::CreateUninitialized(caller_context); |
139 Node* caller_context_node = | 139 Node* caller_context_node = |
140 m.NewNode(common.HeapConstant(caller_context_constant)); | 140 m.NewNode(common.HeapConstant(caller_context_constant)); |
141 | 141 |
142 bailout_id = GetCallBailoutId(); | 142 bailout_id = GetCallBailoutId(); |
143 Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 143 Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); |
144 Node* locals = m.NewNode(common.StateValues(0)); | 144 Node* locals = m.NewNode(common.StateValues(0)); |
145 Node* stack = m.NewNode(common.StateValues(0)); | 145 Node* stack = m.NewNode(common.StateValues(0)); |
146 | 146 |
147 Node* state_node = m.NewNode( | 147 Node* state_node = m.NewNode( |
148 common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters, | 148 common.FrameState(JS_FRAME, bailout_id, |
149 locals, stack, caller_context_node, m.UndefinedConstant()); | 149 OutputFrameStateCombine::Ignore()), |
| 150 parameters, locals, stack, caller_context_node, m.UndefinedConstant()); |
150 | 151 |
151 Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); | 152 Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); |
152 Unique<Object> context_constant = | 153 Unique<Object> context_constant = |
153 Unique<Object>::CreateUninitialized(context); | 154 Unique<Object>::CreateUninitialized(context); |
154 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 155 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); |
155 | 156 |
156 m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); | 157 m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); |
157 | 158 |
158 m.Return(m.UndefinedConstant()); | 159 m.Return(m.UndefinedConstant()); |
159 | 160 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 Unique<Object> context_constant = | 253 Unique<Object> context_constant = |
253 Unique<Object>::CreateUninitialized(context); | 254 Unique<Object>::CreateUninitialized(context); |
254 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 255 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); |
255 | 256 |
256 bailout_id = GetCallBailoutId(); | 257 bailout_id = GetCallBailoutId(); |
257 Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 258 Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); |
258 Node* locals = m.NewNode(common.StateValues(0)); | 259 Node* locals = m.NewNode(common.StateValues(0)); |
259 Node* stack = m.NewNode(common.StateValues(0)); | 260 Node* stack = m.NewNode(common.StateValues(0)); |
260 | 261 |
261 Node* state_node = m.NewNode( | 262 Node* state_node = m.NewNode( |
262 common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters, | 263 common.FrameState(JS_FRAME, bailout_id, |
263 locals, stack, context_node, m.UndefinedConstant()); | 264 OutputFrameStateCombine::Ignore()), |
| 265 parameters, locals, stack, context_node, m.UndefinedConstant()); |
264 | 266 |
265 m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, | 267 m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, |
266 state_node); | 268 state_node); |
267 | 269 |
268 m.Return(m.UndefinedConstant()); | 270 m.Return(m.UndefinedConstant()); |
269 | 271 |
270 // Schedule the graph: | 272 // Schedule the graph: |
271 Schedule* schedule = m.Export(); | 273 Schedule* schedule = m.Export(); |
272 | 274 |
273 return schedule; | 275 return schedule; |
(...skipping 30 matching lines...) Expand all Loading... |
304 Handle<Object> result; | 306 Handle<Object> result; |
305 bool has_pending_exception = | 307 bool has_pending_exception = |
306 !Execution::Call(isolate, t.function, | 308 !Execution::Call(isolate, t.function, |
307 isolate->factory()->undefined_value(), 0, NULL, | 309 isolate->factory()->undefined_value(), 0, NULL, |
308 false).ToHandle(&result); | 310 false).ToHandle(&result); |
309 CHECK(!has_pending_exception); | 311 CHECK(!has_pending_exception); |
310 CHECK(result->SameValue(Smi::FromInt(42))); | 312 CHECK(result->SameValue(Smi::FromInt(42))); |
311 } | 313 } |
312 | 314 |
313 #endif | 315 #endif |
OLD | NEW |