Lines Matching defs:node
11 #include "src/compiler/node-matchers.h"
90 Node* node, int functions_size) {
92 Node* callee = node->InputAt(0);
94 out.node = node;
107 int const value_input_count = m.node()->op()->ValueInputCount();
154 Reduction JSInliningHeuristic::Reduce(Node* node) {
157 if (node->opcode() == IrOpcode::kJSWasmCall) {
158 return inliner_.ReduceJSWasmCall(node);
165 if (!IrOpcode::IsInlineeOpcode(node->opcode())) return NoChange();
171 // Check if we already saw that {node} before, and if so, just skip it.
172 if (seen_.find(node->id()) != seen_.end()) return NoChange();
174 // Check if the {node} is an appropriate candidate for inlining.
175 Candidate candidate = CollectFunctions(node, kMaxCallPolymorphism);
180 << node->id() << ":" << node->op()->mnemonic()
187 FrameState frame_state{NodeProperties::GetFrameStateInput(node)};
219 TRACE("Not considering call site #" << node->id() << ":"
220 << node->op()->mnemonic()
241 if (node->opcode() == IrOpcode::kJSCall) {
242 CallParameters const p = CallParametersOf(node->op());
245 ConstructParameters const p = ConstructParametersOf(node->op());
259 // order to make inlining decisions order-independent. A node may not be a
261 // candidate. In that case, the node should be revisited by
263 seen_.insert(node->id());
269 << node->id() << ":" << node->op()->mnemonic());
292 if (!IrOpcode::IsInlineeOpcode(candidate.node->opcode())) continue;
293 if (candidate.node->IsDead()) continue;
314 Node* node;
318 bool CollectStateValuesOwnedUses(Node* node, Node* state_values,
326 if (!CollectStateValuesOwnedUses(node, input, uses_buffer, use_count,
330 } else if (input == node) {
370 bool CollectFrameStateUniqueUses(Node* node, FrameState frame_state,
375 if (frame_state.stack() == node) {
380 if (!CollectStateValuesOwnedUses(node, frame_state.locals(), uses_buffer,
413 bool JSInliningHeuristic::TryReuseDispatch(Node* node, Node* callee,
453 // Call(node)
458 // The {callee} here is a phi that merges the possible call targets, {node}
508 // If there is a control node between the callee computation
511 if (NodeProperties::GetControlInput(node) != merge) return false;
513 // If there is a non-checkpoint effect node between the callee computation
518 Node* effect = NodeProperties::GetEffectInput(node);
531 if (merge_use != effect_phi && merge_use != callee && merge_use != node &&
539 if (effect_phi_use != node && effect_phi_use != checkpoint) return false;
580 FrameState frame_state{NodeProperties::GetFrameStateInput(node)};
590 if (edge.from() == node && edge.index() == 0) continue;
594 if (replaceable_uses[i].node == edge.from() &&
633 graph()->NewNode(node->op(), input_count, inputs);
637 node->ReplaceInput(input_count - 1, jsgraph()->Dead());
648 void JSInliningHeuristic::CreateOrReuseDispatch(Node* node, Node* callee,
654 source_positions_, source_positions_->GetSourcePosition(node));
655 if (TryReuseDispatch(node, callee, if_successes, calls, inputs,
662 Node* fallthrough_control = NodeProperties::GetControlInput(node);
684 // We also specialize the new.target of JSConstruct {node}s if it refers
685 // to the same node as the {node}'s target input, so that we can later
687 if (node->opcode() == IrOpcode::kJSConstruct) {
689 JSConstructNode n(node);
697 graph()->NewNode(node->op(), input_count, inputs);
704 Node* const node = candidate.node;
706 DCHECK_NE(node->opcode(), IrOpcode::kJSWasmCall);
709 Reduction const reduction = inliner_.ReduceJSCall(node);
716 // Expand the JSCall/JSConstruct node to a subgraph first if
721 Node* callee = NodeProperties::GetValueInput(node, 0);
724 int const input_count = node->InputCount();
727 inputs[i] = node->InputAt(i);
731 CreateOrReuseDispatch(node, callee, candidate, if_successes, calls, inputs,
734 // Check if we have an exception projection for the call {node}.
736 if (NodeProperties::IsExceptionalCall(node, &if_exception)) {
766 ReplaceWithValue(node, value, effect, control);
779 // Killing the call node is not strictly necessary, but it is safer to
780 // make sure we do not resurrect the node.
795 // node id as a tie breaker.
796 return left.node->id() > right.node->id();
806 return left.node->id() > right.node->id();
814 os << "- candidate: " << candidate.node->op()->mnemonic() << " node #"
815 << candidate.node->id() << " with frequency " << candidate.frequency