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/access-builder.h" | 5 #include "src/compiler/access-builder.h" |
6 #include "src/compiler/ast-graph-builder.h" | 6 #include "src/compiler/ast-graph-builder.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph-inl.h" | 9 #include "src/compiler/graph-inl.h" |
10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // The scheduler is smart enough to place our code; we just ensure {control} | 234 // The scheduler is smart enough to place our code; we just ensure {control} |
235 // becomes the control input of the start of the inlinee. | 235 // becomes the control input of the start of the inlinee. |
236 Node* control = NodeProperties::GetControlInput(call); | 236 Node* control = NodeProperties::GetControlInput(call); |
237 | 237 |
238 // The inlinee uses the context from the JSFunction object. This will | 238 // The inlinee uses the context from the JSFunction object. This will |
239 // also be the effect dependency for the inlinee as it produces an effect. | 239 // also be the effect dependency for the inlinee as it produces an effect. |
240 SimplifiedOperatorBuilder simplified(jsgraph->zone()); | 240 SimplifiedOperatorBuilder simplified(jsgraph->zone()); |
241 Node* context = jsgraph->graph()->NewNode( | 241 Node* context = jsgraph->graph()->NewNode( |
242 simplified.LoadField(AccessBuilder::ForJSFunctionContext()), | 242 simplified.LoadField(AccessBuilder::ForJSFunctionContext()), |
243 NodeProperties::GetValueInput(call, 0), | 243 NodeProperties::GetValueInput(call, 0), |
244 NodeProperties::GetEffectInput(call)); | 244 NodeProperties::GetEffectInput(call), control); |
245 | 245 |
246 // Context is last argument. | 246 // Context is last argument. |
247 int inlinee_context_index = static_cast<int>(total_parameters()) - 1; | 247 int inlinee_context_index = static_cast<int>(total_parameters()) - 1; |
248 // {inliner_inputs} counts JSFunction, Receiver, arguments, but not | 248 // {inliner_inputs} counts JSFunction, Receiver, arguments, but not |
249 // context, effect, control. | 249 // context, effect, control. |
250 int inliner_inputs = OperatorProperties::GetValueInputCount(call->op()); | 250 int inliner_inputs = OperatorProperties::GetValueInputCount(call->op()); |
251 // Iterate over all uses of the start node. | 251 // Iterate over all uses of the start node. |
252 UseIter iter = start_->uses().begin(); | 252 UseIter iter = start_->uses().begin(); |
253 while (iter != start_->uses().end()) { | 253 while (iter != start_->uses().end()) { |
254 Node* use = *iter; | 254 Node* use = *iter; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 AddClosureToFrameState(node, function); | 437 AddClosureToFrameState(node, function); |
438 NodeProperties::ReplaceFrameStateInput(node, outer_frame_state); | 438 NodeProperties::ReplaceFrameStateInput(node, outer_frame_state); |
439 } | 439 } |
440 } | 440 } |
441 | 441 |
442 inlinee.InlineAtCall(jsgraph_, call_node); | 442 inlinee.InlineAtCall(jsgraph_, call_node); |
443 } | 443 } |
444 } | 444 } |
445 } | 445 } |
446 } // namespace v8::internal::compiler | 446 } // namespace v8::internal::compiler |
OLD | NEW |