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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Unique<Context>::CreateUninitialized(caller_context); | 122 Unique<Context>::CreateUninitialized(caller_context); |
123 Node* caller_context_node = | 123 Node* caller_context_node = |
124 m.NewNode(common.HeapConstant(caller_context_constant)); | 124 m.NewNode(common.HeapConstant(caller_context_constant)); |
125 | 125 |
126 bailout_id = GetCallBailoutId(); | 126 bailout_id = GetCallBailoutId(); |
127 Node* parameters = | 127 Node* parameters = |
128 m.NewNode(common.TypedStateValues(&tagged_type), m.UndefinedConstant()); | 128 m.NewNode(common.TypedStateValues(&tagged_type), m.UndefinedConstant()); |
129 Node* locals = m.NewNode(common.TypedStateValues(&empty_types)); | 129 Node* locals = m.NewNode(common.TypedStateValues(&empty_types)); |
130 Node* stack = m.NewNode(common.TypedStateValues(&empty_types)); | 130 Node* stack = m.NewNode(common.TypedStateValues(&empty_types)); |
131 | 131 |
132 Node* state_node = m.NewNode( | 132 Node* state_node = |
133 common.FrameState(JS_FRAME, bailout_id, | 133 m.NewNode(common.FrameState(JS_FRAME, bailout_id, |
134 OutputFrameStateCombine::Ignore()), | 134 OutputFrameStateCombine::Ignore()), |
135 parameters, locals, stack, caller_context_node, m.UndefinedConstant()); | 135 parameters, locals, stack, caller_context_node, |
| 136 deopt_fun_node, m.UndefinedConstant()); |
136 | 137 |
137 Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); | 138 Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); |
138 Unique<Context> context_constant = | 139 Unique<Context> context_constant = |
139 Unique<Context>::CreateUninitialized(context); | 140 Unique<Context>::CreateUninitialized(context); |
140 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 141 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); |
141 | 142 |
142 m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); | 143 m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); |
143 | 144 |
144 m.Return(m.UndefinedConstant()); | 145 m.Return(m.UndefinedConstant()); |
145 | 146 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 Unique<HeapObject> context_constant = | 239 Unique<HeapObject> context_constant = |
239 Unique<HeapObject>::CreateUninitialized(context); | 240 Unique<HeapObject>::CreateUninitialized(context); |
240 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 241 Node* context_node = m.NewNode(common.HeapConstant(context_constant)); |
241 | 242 |
242 bailout_id = GetCallBailoutId(); | 243 bailout_id = GetCallBailoutId(); |
243 Node* parameters = | 244 Node* parameters = |
244 m.NewNode(common.TypedStateValues(&tagged_type), m.UndefinedConstant()); | 245 m.NewNode(common.TypedStateValues(&tagged_type), m.UndefinedConstant()); |
245 Node* locals = m.NewNode(common.TypedStateValues(&empty_types)); | 246 Node* locals = m.NewNode(common.TypedStateValues(&empty_types)); |
246 Node* stack = m.NewNode(common.TypedStateValues(&empty_types)); | 247 Node* stack = m.NewNode(common.TypedStateValues(&empty_types)); |
247 | 248 |
248 Node* state_node = m.NewNode( | 249 Node* state_node = |
249 common.FrameState(JS_FRAME, bailout_id, | 250 m.NewNode(common.FrameState(JS_FRAME, bailout_id, |
250 OutputFrameStateCombine::Ignore()), | 251 OutputFrameStateCombine::Ignore()), |
251 parameters, locals, stack, context_node, m.UndefinedConstant()); | 252 parameters, locals, stack, context_node, this_fun_node, |
| 253 m.UndefinedConstant()); |
252 | 254 |
253 m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, | 255 m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, |
254 state_node); | 256 state_node); |
255 | 257 |
256 m.Return(m.UndefinedConstant()); | 258 m.Return(m.UndefinedConstant()); |
257 | 259 |
258 // Schedule the graph: | 260 // Schedule the graph: |
259 Schedule* schedule = m.Export(); | 261 Schedule* schedule = m.Export(); |
260 | 262 |
261 return schedule; | 263 return schedule; |
(...skipping 30 matching lines...) Expand all Loading... |
292 Handle<Object> result; | 294 Handle<Object> result; |
293 bool has_pending_exception = | 295 bool has_pending_exception = |
294 !Execution::Call(isolate, t.function, | 296 !Execution::Call(isolate, t.function, |
295 isolate->factory()->undefined_value(), 0, NULL, | 297 isolate->factory()->undefined_value(), 0, NULL, |
296 false).ToHandle(&result); | 298 false).ToHandle(&result); |
297 CHECK(!has_pending_exception); | 299 CHECK(!has_pending_exception); |
298 CHECK(result->SameValue(Smi::FromInt(42))); | 300 CHECK(result->SameValue(Smi::FromInt(42))); |
299 } | 301 } |
300 | 302 |
301 #endif | 303 #endif |
OLD | NEW |