Lines Matching refs:Node
16 #include "src/compiler/node-matchers.h"
17 #include "src/compiler/node-properties.h"
37 explicit JSCallAccessor(Node* call) : call_(call) {
42 Node* target() {
47 Node* receiver() {
52 Node* new_target() {
57 Node* frame_state_before() {
61 Node* frame_state_after() {
74 Node* call_;
89 Node* GetCopy(Node* orig) { return copies_[orig->id()]; }
98 for (Node* orig : all.live) {
99 Node* copy = GetCopy(orig);
104 // Copy the node.
106 for (Node* input : orig->inputs()) inputs.push_back(copies_[input->id()]);
112 for (Node* orig : all.live) {
113 Node* copy = copies_[orig->id()];
115 Node* input = copy->InputAt(i);
127 Node* const sentinel_;
135 Reduction JSInliner::InlineCall(Node* call, Node* new_target, Node* context,
136 Node* frame_state, Node* start, Node* end) {
140 Node* control = NodeProperties::GetControlInput(call);
141 Node* effect = NodeProperties::GetEffectInput(call);
153 // Iterate over all uses of the start node.
155 Node* use = edge.from();
196 for (Node* const input : end->inputs()) {
221 Node* control_output = jsgraph_->graph()->NewNode(
225 Node* value_output = jsgraph_->graph()->NewNode(
228 Node* effect_output = jsgraph_->graph()->NewNode(
240 Node* JSInliner::CreateArtificialFrameState(Node* node, Node* outer_frame_state,
252 Node* node0 = jsgraph_->graph()->NewNode(op0);
255 params.push_back(node->InputAt(1 + parameter));
259 Node* params_node = jsgraph_->graph()->NewNode(
263 node->InputAt(0), outer_frame_state);
279 Reduction JSInliner::Reduce(Node* node) {
280 if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange();
286 HeapObjectMatcher match(node->InputAt(0));
290 return ReduceJSCall(node, function);
294 Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
295 DCHECK(IrOpcode::IsInlineeOpcode(node->opcode()));
296 JSCallAccessor call(node);
307 if (node->opcode() == IrOpcode::kJSCallConstruct &&
317 if (node->opcode() == IrOpcode::kJSCallFunction &&
352 for (Node* frame_state = call.frame_state_after();
367 if (NodeProperties::IsExceptionalCall(node)) {
434 Node* start = visitor.GetCopy(graph.start());
435 Node* end = visitor.GetCopy(graph.end());
436 Node* frame_state = call.frame_state_after();
437 Node* new_target = jsgraph_->UndefinedConstant();
442 // Note that the context has to be the callers context (input to call node).
443 Node* receiver = jsgraph_->UndefinedConstant(); // Implicit receiver.
444 if (node->opcode() == IrOpcode::kJSCallConstruct &&
446 Node* effect = NodeProperties::GetEffectInput(node);
447 Node* context = NodeProperties::GetContextInput(node);
448 Node* create = jsgraph_->graph()->NewNode(
451 NodeProperties::ReplaceEffectInput(node, create);
454 Node* check = jsgraph_->graph()->NewNode(
456 node, context, node, start);
457 Node* select = jsgraph_->graph()->NewNode(
458 jsgraph_->common()->Select(MachineRepresentation::kTagged), check, node,
460 NodeProperties::ReplaceUses(node, select, check, node, node);
461 NodeProperties::ReplaceValueInput(select, node, 1);
462 NodeProperties::ReplaceValueInput(check, node, 0);
463 NodeProperties::ReplaceEffectInput(check, node);
467 // Swizzle the inputs of the {JSCallConstruct} node to look like inputs to a
468 // normal {JSCallFunction} node so that the rest of the inlining machinery
470 if (node->opcode() == IrOpcode::kJSCallConstruct) {
472 node->RemoveInput(call.formal_arguments() + 1); // Drop new target.
473 node->InsertInput(jsgraph_->graph()->zone(), 1, receiver);
477 node, frame_state, call.formal_arguments(),
485 Node* context = jsgraph_->Constant(handle(function->context()));
487 // Insert a JSConvertReceiver node for sloppy callees. Note that the context
488 // passed into this node has to be the callees context (loaded above). Note
493 if (node->opcode() == IrOpcode::kJSCallFunction &&
495 const CallFunctionParameters& p = CallFunctionParametersOf(node->op());
496 Node* effect = NodeProperties::GetEffectInput(node);
497 Node* convert = jsgraph_->graph()->NewNode(
500 NodeProperties::ReplaceValueInput(node, convert, 1);
501 NodeProperties::ReplaceEffectInput(node, convert);
505 // count (i.e. value outputs of start node minus target, receiver, new target,
511 node, frame_state, call.formal_arguments(),
515 return InlineCall(node, new_target, context, frame_state, start, end);