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.h" | 7 #include "src/ast/ast.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state, | 224 Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state, |
225 int parameter_count, | 225 int parameter_count, |
226 FrameStateType frame_state_type, | 226 FrameStateType frame_state_type, |
227 Handle<SharedFunctionInfo> shared) { | 227 Handle<SharedFunctionInfo> shared) { |
228 const FrameStateFunctionInfo* state_info = | 228 const FrameStateFunctionInfo* state_info = |
229 common()->CreateFrameStateFunctionInfo(frame_state_type, | 229 common()->CreateFrameStateFunctionInfo(frame_state_type, |
230 parameter_count + 1, 0, shared); | 230 parameter_count + 1, 0, shared); |
231 | 231 |
232 const Operator* op = common()->FrameState( | 232 const Operator* op = common()->FrameState( |
233 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); | 233 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
234 const Operator* op0 = common()->StateValues(0); | 234 const Operator* op0 = common()->StateValues(0, SparseInputMask::Dense()); |
235 Node* node0 = graph()->NewNode(op0); | 235 Node* node0 = graph()->NewNode(op0); |
236 NodeVector params(local_zone_); | 236 NodeVector params(local_zone_); |
237 for (int parameter = 0; parameter < parameter_count + 1; ++parameter) { | 237 for (int parameter = 0; parameter < parameter_count + 1; ++parameter) { |
238 params.push_back(node->InputAt(1 + parameter)); | 238 params.push_back(node->InputAt(1 + parameter)); |
239 } | 239 } |
240 const Operator* op_param = | 240 const Operator* op_param = common()->StateValues( |
241 common()->StateValues(static_cast<int>(params.size())); | 241 static_cast<int>(params.size()), SparseInputMask::Dense()); |
242 Node* params_node = graph()->NewNode( | 242 Node* params_node = graph()->NewNode( |
243 op_param, static_cast<int>(params.size()), ¶ms.front()); | 243 op_param, static_cast<int>(params.size()), ¶ms.front()); |
244 return graph()->NewNode(op, params_node, node0, node0, | 244 return graph()->NewNode(op, params_node, node0, node0, |
245 jsgraph()->UndefinedConstant(), node->InputAt(0), | 245 jsgraph()->UndefinedConstant(), node->InputAt(0), |
246 outer_frame_state); | 246 outer_frame_state); |
247 } | 247 } |
248 | 248 |
249 Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { | 249 Node* JSInliner::CreateTailCallerFrameState(Node* node, Node* frame_state) { |
250 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); | 250 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
251 Handle<SharedFunctionInfo> shared; | 251 Handle<SharedFunctionInfo> shared; |
(...skipping 10 matching lines...) Expand all Loading... |
262 frame_state = NodeProperties::GetFrameStateInput(frame_state); | 262 frame_state = NodeProperties::GetFrameStateInput(frame_state); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 const FrameStateFunctionInfo* state_info = | 266 const FrameStateFunctionInfo* state_info = |
267 common()->CreateFrameStateFunctionInfo( | 267 common()->CreateFrameStateFunctionInfo( |
268 FrameStateType::kTailCallerFunction, 0, 0, shared); | 268 FrameStateType::kTailCallerFunction, 0, 0, shared); |
269 | 269 |
270 const Operator* op = common()->FrameState( | 270 const Operator* op = common()->FrameState( |
271 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); | 271 BailoutId(-1), OutputFrameStateCombine::Ignore(), state_info); |
272 const Operator* op0 = common()->StateValues(0); | 272 const Operator* op0 = common()->StateValues(0, SparseInputMask::Dense()); |
273 Node* node0 = graph()->NewNode(op0); | 273 Node* node0 = graph()->NewNode(op0); |
274 return graph()->NewNode(op, node0, node0, node0, | 274 return graph()->NewNode(op, node0, node0, node0, |
275 jsgraph()->UndefinedConstant(), function, | 275 jsgraph()->UndefinedConstant(), function, |
276 frame_state); | 276 frame_state); |
277 } | 277 } |
278 | 278 |
279 namespace { | 279 namespace { |
280 | 280 |
281 // TODO(turbofan): Shall we move this to the NodeProperties? Or some (untyped) | 281 // TODO(turbofan): Shall we move this to the NodeProperties? Or some (untyped) |
282 // alias analyzer? | 282 // alias analyzer? |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 670 |
671 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 671 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
672 | 672 |
673 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 673 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
674 return jsgraph()->simplified(); | 674 return jsgraph()->simplified(); |
675 } | 675 } |
676 | 676 |
677 } // namespace compiler | 677 } // namespace compiler |
678 } // namespace internal | 678 } // namespace internal |
679 } // namespace v8 | 679 } // namespace v8 |
OLD | NEW |