| Index: runtime/vm/flow_graph_compiler_arm64.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
|
| index 30e421127e61d90037a650d916b5f343cfc52885..2e814ffb4e624b92c5a1ac1a32ff0c961494c4db 100644
|
| --- a/runtime/vm/flow_graph_compiler_arm64.cc
|
| +++ b/runtime/vm/flow_graph_compiler_arm64.cc
|
| @@ -1172,6 +1172,34 @@ void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
|
| }
|
|
|
|
|
| +void FlowGraphCompiler::GenerateStaticDartCall(intptr_t deopt_id,
|
| + TokenPosition token_pos,
|
| + const StubEntry& stub_entry,
|
| + RawPcDescriptors::Kind kind,
|
| + LocationSummary* locs,
|
| + const Function& target) {
|
| + // Call sites to the same target can share object pool entries. These
|
| + // call sites are never patched for breakpoints: the function is deoptimized
|
| + // and the unoptimized code with IC calls for static calls is patched instead.
|
| + ASSERT(is_optimizing());
|
| + __ BranchLinkWithEquivalence(stub_entry, target);
|
| +
|
| + AddCurrentDescriptor(kind, deopt_id, token_pos);
|
| + RecordSafepoint(locs);
|
| + // Marks either the continuation point in unoptimized code or the
|
| + // deoptimization point in optimized code, after call.
|
| + const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
|
| + if (is_optimizing()) {
|
| + AddDeoptIndexAtCall(deopt_id_after, token_pos);
|
| + } else {
|
| + // Add deoptimization continuation point after the call and before the
|
| + // arguments are removed.
|
| + AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
|
| + }
|
| + AddStaticCallTarget(target);
|
| +}
|
| +
|
| +
|
| void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos,
|
| intptr_t deopt_id,
|
| const RuntimeEntry& entry,
|
| @@ -1374,12 +1402,12 @@ void FlowGraphCompiler::EmitOptimizedStaticCall(
|
| __ LoadObject(R4, arguments_descriptor);
|
| // Do not use the code from the function, but let the code be patched so that
|
| // we can record the outgoing edges to other code.
|
| - GenerateDartCall(deopt_id,
|
| - token_pos,
|
| - *StubCode::CallStaticFunction_entry(),
|
| - RawPcDescriptors::kOther,
|
| - locs);
|
| - AddStaticCallTarget(function);
|
| + GenerateStaticDartCall(deopt_id,
|
| + token_pos,
|
| + *StubCode::CallStaticFunction_entry(),
|
| + RawPcDescriptors::kOther,
|
| + locs,
|
| + function);
|
| __ Drop(argument_count);
|
| }
|
|
|
| @@ -1548,14 +1576,14 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
| }
|
| // Do not use the code from the function, but let the code be patched so
|
| // that we can record the outgoing edges to other code.
|
| - GenerateDartCall(deopt_id,
|
| - token_index,
|
| - *StubCode::CallStaticFunction_entry(),
|
| - RawPcDescriptors::kOther,
|
| - locs);
|
| const Function& function = Function::ZoneHandle(
|
| zone(), ic_data.GetTargetAt(0));
|
| - AddStaticCallTarget(function);
|
| + GenerateStaticDartCall(deopt_id,
|
| + token_index,
|
| + *StubCode::CallStaticFunction_entry(),
|
| + RawPcDescriptors::kOther,
|
| + locs,
|
| + function);
|
| __ Drop(argument_count);
|
| if (kNumChecks > 1) {
|
| __ b(match_found);
|
| @@ -1590,13 +1618,13 @@ void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
| }
|
| // Do not use the code from the function, but let the code be patched so
|
| // that we can record the outgoing edges to other code.
|
| - GenerateDartCall(deopt_id,
|
| - token_index,
|
| - *StubCode::CallStaticFunction_entry(),
|
| - RawPcDescriptors::kOther,
|
| - locs);
|
| const Function& function = *sorted[i].target;
|
| - AddStaticCallTarget(function);
|
| + GenerateStaticDartCall(deopt_id,
|
| + token_index,
|
| + *StubCode::CallStaticFunction_entry(),
|
| + RawPcDescriptors::kOther,
|
| + locs,
|
| + function);
|
| __ Drop(argument_count);
|
| if (!kIsLastCheck) {
|
| __ b(match_found);
|
|
|