| 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/compiler/js-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
| 6 | 6 |
| 7 #include "src/ast/ast-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state, | 228 Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state, |
| 229 int parameter_count, | 229 int parameter_count, |
| 230 FrameStateType frame_state_type, | 230 FrameStateType frame_state_type, |
| 231 Handle<SharedFunctionInfo> shared) { | 231 Handle<SharedFunctionInfo> shared) { |
| 232 const FrameStateFunctionInfo* state_info = | 232 const FrameStateFunctionInfo* state_info = |
| 233 common()->CreateFrameStateFunctionInfo(frame_state_type, | 233 common()->CreateFrameStateFunctionInfo(frame_state_type, |
| 234 parameter_count + 1, 0, shared); | 234 parameter_count + 1, 0, shared); |
| 235 | 235 |
| 236 const Operator* op = common()->FrameState( | 236 const Operator* op = common()->FrameState( |
| 237 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); | 237 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
| 238 const Operator* op0 = common()->StateValues(0); | 238 const Operator* op0 = common()->StateValues(0, 0u); |
| 239 Node* node0 = graph()->NewNode(op0); | 239 Node* node0 = graph()->NewNode(op0); |
| 240 NodeVector params(local_zone_); | 240 NodeVector params(local_zone_); |
| 241 for (int parameter = 0; parameter < parameter_count + 1; ++parameter) { | 241 for (int parameter = 0; parameter < parameter_count + 1; ++parameter) { |
| 242 params.push_back(node->InputAt(1 + parameter)); | 242 params.push_back(node->InputAt(1 + parameter)); |
| 243 } | 243 } |
| 244 const Operator* op_param = | 244 const Operator* op_param = |
| 245 common()->StateValues(static_cast<int>(params.size())); | 245 common()->StateValues(static_cast<int>(params.size()), 0u); |
| 246 Node* params_node = graph()->NewNode( | 246 Node* params_node = graph()->NewNode( |
| 247 op_param, static_cast<int>(params.size()), ¶ms.front()); | 247 op_param, static_cast<int>(params.size()), ¶ms.front()); |
| 248 return graph()->NewNode(op, params_node, node0, node0, | 248 return graph()->NewNode(op, params_node, node0, node0, |
| 249 jsgraph()->UndefinedConstant(), node->InputAt(0), | 249 jsgraph()->UndefinedConstant(), node->InputAt(0), |
| 250 outer_frame_state); | 250 outer_frame_state); |
| 251 } | 251 } |
| 252 | 252 |
| 253 Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { | 253 Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { |
| 254 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); | 254 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
| 255 Handle<SharedFunctionInfo> shared; | 255 Handle<SharedFunctionInfo> shared; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 266 frame_state = NodeProperties::GetFrameStateInput(frame_state); | 266 frame_state = NodeProperties::GetFrameStateInput(frame_state); |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 const FrameStateFunctionInfo* state_info = | 270 const FrameStateFunctionInfo* state_info = |
| 271 common()->CreateFrameStateFunctionInfo( | 271 common()->CreateFrameStateFunctionInfo( |
| 272 FrameStateType::kTailCallerFunction, 0, 0, shared); | 272 FrameStateType::kTailCallerFunction, 0, 0, shared); |
| 273 | 273 |
| 274 const Operator* op = common()->FrameState( | 274 const Operator* op = common()->FrameState( |
| 275 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); | 275 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
| 276 const Operator* op0 = common()->StateValues(0); | 276 const Operator* op0 = common()->StateValues(0, 0u); |
| 277 Node* node0 = graph()->NewNode(op0); | 277 Node* node0 = graph()->NewNode(op0); |
| 278 return graph()->NewNode(op, node0, node0, node0, | 278 return graph()->NewNode(op, node0, node0, node0, |
| 279 jsgraph()->UndefinedConstant(), function, | 279 jsgraph()->UndefinedConstant(), function, |
| 280 frame_state); | 280 frame_state); |
| 281 } | 281 } |
| 282 | 282 |
| 283 namespace { | 283 namespace { |
| 284 | 284 |
| 285 // TODO(turbofan): Shall we move this to the NodeProperties? Or some (untyped) | 285 // TODO(turbofan): Shall we move this to the NodeProperties? Or some (untyped) |
| 286 // alias analyzer? | 286 // alias analyzer? |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 | 707 |
| 708 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 708 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
| 709 | 709 |
| 710 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 710 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
| 711 return jsgraph()->simplified(); | 711 return jsgraph()->simplified(); |
| 712 } | 712 } |
| 713 | 713 |
| 714 } // namespace compiler | 714 } // namespace compiler |
| 715 } // namespace internal | 715 } // namespace internal |
| 716 } // namespace v8 | 716 } // namespace v8 |
| OLD | NEW |