| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 143     Unique<Object> caller_context_constant = | 143     Unique<Object> caller_context_constant = | 
| 144         Unique<Object>::CreateUninitialized(caller_context); | 144         Unique<Object>::CreateUninitialized(caller_context); | 
| 145     Node* caller_context_node = | 145     Node* caller_context_node = | 
| 146         m.NewNode(common.HeapConstant(caller_context_constant)); | 146         m.NewNode(common.HeapConstant(caller_context_constant)); | 
| 147 | 147 | 
| 148     bailout_id = GetCallBailoutId(); | 148     bailout_id = GetCallBailoutId(); | 
| 149     Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 149     Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 
| 150     Node* locals = m.NewNode(common.StateValues(0)); | 150     Node* locals = m.NewNode(common.StateValues(0)); | 
| 151     Node* stack = m.NewNode(common.StateValues(0)); | 151     Node* stack = m.NewNode(common.StateValues(0)); | 
| 152 | 152 | 
| 153     Node* state_node = | 153     Node* state_node = m.NewNode( | 
| 154         m.NewNode(common.FrameState(bailout_id, kIgnoreOutput), parameters, | 154         common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters, | 
| 155                   locals, stack, caller_context_node, m.UndefinedConstant()); | 155         locals, stack, caller_context_node, m.UndefinedConstant()); | 
| 156 | 156 | 
| 157     Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); | 157     Handle<Context> context(deopt_function->context(), CcTest::i_isolate()); | 
| 158     Unique<Object> context_constant = | 158     Unique<Object> context_constant = | 
| 159         Unique<Object>::CreateUninitialized(context); | 159         Unique<Object>::CreateUninitialized(context); | 
| 160     Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 160     Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 
| 161 | 161 | 
| 162     m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); | 162     m.CallJS0(deopt_fun_node, m.UndefinedConstant(), context_node, state_node); | 
| 163 | 163 | 
| 164     m.Return(m.UndefinedConstant()); | 164     m.Return(m.UndefinedConstant()); | 
| 165 | 165 | 
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 257     Handle<Context> context(function->context(), CcTest::i_isolate()); | 257     Handle<Context> context(function->context(), CcTest::i_isolate()); | 
| 258     Unique<Object> context_constant = | 258     Unique<Object> context_constant = | 
| 259         Unique<Object>::CreateUninitialized(context); | 259         Unique<Object>::CreateUninitialized(context); | 
| 260     Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 260     Node* context_node = m.NewNode(common.HeapConstant(context_constant)); | 
| 261 | 261 | 
| 262     bailout_id = GetCallBailoutId(); | 262     bailout_id = GetCallBailoutId(); | 
| 263     Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 263     Node* parameters = m.NewNode(common.StateValues(1), m.UndefinedConstant()); | 
| 264     Node* locals = m.NewNode(common.StateValues(0)); | 264     Node* locals = m.NewNode(common.StateValues(0)); | 
| 265     Node* stack = m.NewNode(common.StateValues(0)); | 265     Node* stack = m.NewNode(common.StateValues(0)); | 
| 266 | 266 | 
| 267     Node* state_node = | 267     Node* state_node = m.NewNode( | 
| 268         m.NewNode(common.FrameState(bailout_id, kIgnoreOutput), parameters, | 268         common.FrameState(JS_FRAME, bailout_id, kIgnoreOutput), parameters, | 
| 269                   locals, stack, context_node, m.UndefinedConstant()); | 269         locals, stack, context_node, m.UndefinedConstant()); | 
| 270 | 270 | 
| 271     m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, | 271     m.CallRuntime1(Runtime::kDeoptimizeFunction, this_fun_node, context_node, | 
| 272                    state_node); | 272                    state_node); | 
| 273 | 273 | 
| 274     m.Return(m.UndefinedConstant()); | 274     m.Return(m.UndefinedConstant()); | 
| 275 | 275 | 
| 276     // Schedule the graph: | 276     // Schedule the graph: | 
| 277     Schedule* schedule = m.Export(); | 277     Schedule* schedule = m.Export(); | 
| 278 | 278 | 
| 279     return schedule; | 279     return schedule; | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 310   Handle<Object> result; | 310   Handle<Object> result; | 
| 311   bool has_pending_exception = | 311   bool has_pending_exception = | 
| 312       !Execution::Call(isolate, t.function, | 312       !Execution::Call(isolate, t.function, | 
| 313                        isolate->factory()->undefined_value(), 0, NULL, | 313                        isolate->factory()->undefined_value(), 0, NULL, | 
| 314                        false).ToHandle(&result); | 314                        false).ToHandle(&result); | 
| 315   CHECK(!has_pending_exception); | 315   CHECK(!has_pending_exception); | 
| 316   CHECK(result->SameValue(Smi::FromInt(42))); | 316   CHECK(result->SameValue(Smi::FromInt(42))); | 
| 317 } | 317 } | 
| 318 | 318 | 
| 319 #endif | 319 #endif | 
| OLD | NEW | 
|---|