| Index: runtime/vm/intermediate_language_arm.cc
|
| diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
|
| index 78a88513bfd4d225b69d2d82d01f788796b42ff3..ebc5e5c3822ca96ac26436608cf8da9ec715335a 100644
|
| --- a/runtime/vm/intermediate_language_arm.cc
|
| +++ b/runtime/vm/intermediate_language_arm.cc
|
| @@ -924,8 +924,11 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| // this is a redirection address that forces the simulator to call
|
| // into the runtime system.
|
| uword entry = reinterpret_cast<uword>(native_c_function());
|
| + const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
|
| + const bool is_leaf_call =
|
| + (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
|
| const ExternalLabel* stub_entry;
|
| - if (is_bootstrap_native()) {
|
| + if (is_bootstrap_native() || is_leaf_call) {
|
| stub_entry = &StubCode::CallBootstrapCFunctionLabel();
|
| #if defined(USING_SIMULATOR)
|
| entry = Simulator::RedirectExternalReference(
|
| @@ -944,7 +947,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| #endif
|
| }
|
| __ LoadImmediate(R5, entry);
|
| - __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function()));
|
| + __ LoadImmediate(R1, argc_tag);
|
| compiler->GenerateCall(token_pos(),
|
| stub_entry,
|
| PcDescriptors::kOther,
|
|
|