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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 Node* call = m.CallJS0(deopt_fun_node, undef_node, &cont, &deopt); | 142 Node* call = m.CallJS0(deopt_fun_node, undef_node, &cont, &deopt); |
143 | 143 |
144 m.Bind(&cont); | 144 m.Bind(&cont); |
145 m.NewNode(common.Continuation(), call); | 145 m.NewNode(common.Continuation(), call); |
146 m.Return(undef_node); | 146 m.Return(undef_node); |
147 | 147 |
148 m.Bind(&deopt); | 148 m.Bind(&deopt); |
149 m.NewNode(common.LazyDeoptimization(), call); | 149 m.NewNode(common.LazyDeoptimization(), call); |
150 | 150 |
151 bailout_id = GetCallBailoutId(); | 151 bailout_id = GetCallBailoutId(); |
152 FrameStateDescriptor stateDescriptor(bailout_id); | 152 Node* parameters = m.NewNode(common.StateValues(1), undef_node); |
153 Node* state_node = m.NewNode(common.FrameState(stateDescriptor)); | 153 Node* locals = m.NewNode(common.StateValues(0)); |
| 154 Node* stack = m.NewNode(common.StateValues(0)); |
| 155 |
| 156 Node* state_node = |
| 157 m.NewNode(common.FrameState(bailout_id), parameters, locals, stack); |
154 m.Deoptimize(state_node); | 158 m.Deoptimize(state_node); |
155 | 159 |
156 // Schedule the graph: | 160 // Schedule the graph: |
157 Schedule* schedule = m.Export(); | 161 Schedule* schedule = m.Export(); |
158 | 162 |
159 cont_block = cont.block(); | 163 cont_block = cont.block(); |
160 deopt_block = deopt.block(); | 164 deopt_block = deopt.block(); |
161 | 165 |
162 return schedule; | 166 return schedule; |
163 } | 167 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 &cont, &deopt); | 277 &cont, &deopt); |
274 | 278 |
275 m.Bind(&cont); | 279 m.Bind(&cont); |
276 m.NewNode(common.Continuation(), call); | 280 m.NewNode(common.Continuation(), call); |
277 m.Return(undef_node); | 281 m.Return(undef_node); |
278 | 282 |
279 m.Bind(&deopt); | 283 m.Bind(&deopt); |
280 m.NewNode(common.LazyDeoptimization(), call); | 284 m.NewNode(common.LazyDeoptimization(), call); |
281 | 285 |
282 bailout_id = GetCallBailoutId(); | 286 bailout_id = GetCallBailoutId(); |
283 FrameStateDescriptor stateDescriptor(bailout_id); | 287 Node* parameters = m.NewNode(common.StateValues(1), undef_node); |
284 Node* state_node = m.NewNode(common.FrameState(stateDescriptor)); | 288 Node* locals = m.NewNode(common.StateValues(0)); |
| 289 Node* stack = m.NewNode(common.StateValues(0)); |
| 290 |
| 291 Node* state_node = |
| 292 m.NewNode(common.FrameState(bailout_id), parameters, locals, stack); |
285 m.Deoptimize(state_node); | 293 m.Deoptimize(state_node); |
286 | 294 |
287 // Schedule the graph: | 295 // Schedule the graph: |
288 Schedule* schedule = m.Export(); | 296 Schedule* schedule = m.Export(); |
289 | 297 |
290 cont_block = cont.block(); | 298 cont_block = cont.block(); |
291 deopt_block = deopt.block(); | 299 deopt_block = deopt.block(); |
292 | 300 |
293 return schedule; | 301 return schedule; |
294 } | 302 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 Handle<Object> result; | 335 Handle<Object> result; |
328 bool has_pending_exception = | 336 bool has_pending_exception = |
329 !Execution::Call(isolate, t.function, | 337 !Execution::Call(isolate, t.function, |
330 isolate->factory()->undefined_value(), 0, NULL, | 338 isolate->factory()->undefined_value(), 0, NULL, |
331 false).ToHandle(&result); | 339 false).ToHandle(&result); |
332 CHECK(!has_pending_exception); | 340 CHECK(!has_pending_exception); |
333 CHECK(result->SameValue(Smi::FromInt(42))); | 341 CHECK(result->SameValue(Smi::FromInt(42))); |
334 } | 342 } |
335 | 343 |
336 #endif | 344 #endif |
OLD | NEW |