| Index: runtime/vm/intermediate_language_mips.cc
|
| diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
|
| index 53e72a379a4b16a4c10c3cb43e44c271d9a7bb6b..bec3d41737a752be6a74089ed54c8cb9c40d986c 100644
|
| --- a/runtime/vm/intermediate_language_mips.cc
|
| +++ b/runtime/vm/intermediate_language_mips.cc
|
| @@ -879,8 +879,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(
|
| @@ -899,7 +902,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
|
| #endif
|
| }
|
| __ LoadImmediate(T5, entry);
|
| - __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function()));
|
| + __ LoadImmediate(A1, argc_tag);
|
| compiler->GenerateCall(token_pos(),
|
| stub_entry,
|
| PcDescriptors::kOther,
|
|
|