Index: runtime/vm/intermediate_language_x64.cc |
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc |
index 5dd33d066c84c2485e97b4d040a81be65710d2b0..55f64e92449612c9454afe60c10f167fd61098dc 100644 |
--- a/runtime/vm/intermediate_language_x64.cc |
+++ b/runtime/vm/intermediate_language_x64.cc |
@@ -812,15 +812,19 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
__ LoadImmediate(R10, Immediate(argc_tag)); |
const StubEntry* stub_entry; |
if (link_lazily()) { |
- stub_entry = StubCode::CallBootstrapCFunction_entry(); |
+ stub_entry = StubCode::CallBootstrapNative_entry(); |
ExternalLabel label(NativeEntry::LinkNativeCallEntry()); |
__ LoadNativeEntry(RBX, &label, kPatchable); |
compiler->GeneratePatchableCall(token_pos(), *stub_entry, |
RawPcDescriptors::kOther, locs()); |
} else { |
- stub_entry = (is_bootstrap_native()) |
- ? StubCode::CallBootstrapCFunction_entry() |
- : StubCode::CallNativeCFunction_entry(); |
+ if (is_bootstrap_native()) { |
+ stub_entry = StubCode::CallBootstrapNative_entry(); |
+ } else if (is_auto_scope()) { |
+ stub_entry = StubCode::CallAutoScopeNative_entry(); |
+ } else { |
+ stub_entry = StubCode::CallNoScopeNative_entry(); |
+ } |
const ExternalLabel label(reinterpret_cast<uword>(native_c_function())); |
__ LoadNativeEntry(RBX, &label, kNotPatchable); |
compiler->GenerateCall(token_pos(), *stub_entry, RawPcDescriptors::kOther, |