Lines Matching refs:call
34 void WasmInliner::Trace(Node* call, int inlinee, const char* decision) {
35 TRACE("[function %d: considering node %d, call to %d: %s]\n", function_index_,
36 call->id(), inlinee, decision);
39 uint32_t WasmInliner::FindOriginatingFunction(Node* call) {
41 NodeId id = call->id();
52 int WasmInliner::GetCallCount(Node* call) {
56 source_positions_->GetSourcePosition(call).ScriptOffset();
57 uint32_t func = FindOriginatingFunction(call);
76 Reduction WasmInliner::ReduceCall(Node* call) {
77 DCHECK(call->opcode() == IrOpcode::kCall ||
78 call->opcode() == IrOpcode::kTailCall);
80 if (seen_.find(call) != seen_.end()) {
82 call->id());
85 seen_.insert(call);
87 Node* callee = NodeProperties::GetValueInput(call, 0);
93 function_index_, call->id());
99 Trace(call, inlinee_index, "not a wasm call");
103 Trace(call, inlinee_index, "imported function");
107 Trace(call, inlinee_index, "recursive call");
111 Trace(call, inlinee_index, "adding to inlining candidates!");
113 int call_count = GetCallCount(call);
119 CandidateInfo candidate{call, inlinee_index, call_count,
150 Node* call = candidate.node;
151 if (call->IsDead()) {
171 // We use the signature based on the real argument types stored in the call
175 CallDescriptorOf(call->op())->wasm_sig();
210 NodeProperties::IsExceptionalCall(call)
239 if (call->opcode() == IrOpcode::kCall) {
240 InlineCall(call, inlinee_start, inlinee_end, inlinee->sig,
243 InlineTailCall(call, inlinee_start, inlinee_end);
245 call->Kill();
252 /* Rewire callee formal parameters to the call-site real parameters. Rewire
254 * inputs of the call node.
256 void WasmInliner::RewireFunctionEntry(Node* call, Node* callee_start) {
257 Node* control = NodeProperties::GetControlInput(call);
258 Node* effect = NodeProperties::GetEffectInput(call);
266 Replace(use, NodeProperties::GetValueInput(call, index));
287 void WasmInliner::InlineTailCall(Node* call, Node* callee_start,
289 DCHECK_EQ(call->opcode(), IrOpcode::kTailCall);
291 RewireFunctionEntry(call, callee_start);
298 for (Edge edge_to_end : call->use_edges()) {
303 call->Kill();
309 // throwing call in the inlinee. This might be followed by a LoopExit node.
310 Node* DanglingHandler(Node* call) {
312 for (Node* use : call->uses()) {
342 void WasmInliner::InlineCall(Node* call, Node* callee_start, Node* callee_end,
345 DCHECK_EQ(call->opcode(), IrOpcode::kCall);
347 // 0) Before doing anything, if {call} has an exception handler, collect all
351 if (NodeProperties::IsExceptionalCall(call, &handler)) {
365 RewireFunctionEntry(call, callee_start);
383 // A tail call in the callee inlined in a regular call in the caller has
384 // to be transformed into a regular call, and then returned from the
503 ReplaceWithValue(call, mcgraph()->Dead(), effect_output, control_output);
505 // One return value. Just replace value uses of the call node with it.
506 ReplaceWithValue(call, values[0], effect_output, control_output);
508 // Multiple returns. We have to find the projections of the call node and
510 for (Edge use_edge : call->use_edges()) {
519 ReplaceWithValue(call, mcgraph()->Dead(), effect_output, control_output);
522 // The callee can never return. The call node and all its uses are dead.
523 ReplaceWithValue(call, mcgraph()->Dead(), mcgraph()->Dead(),