Index: runtime/vm/intermediate_language_ia32.cc |
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc |
index c830ec3a24be10de92d373266464ea2c0fd92a00..af1185c1f9feff7b4bd3482040ca013b8d8cb297 100644 |
--- a/runtime/vm/intermediate_language_ia32.cc |
+++ b/runtime/vm/intermediate_language_ia32.cc |
@@ -828,11 +828,19 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
} else { |
__ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); |
} |
- __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); |
__ movl(EDX, Immediate(argc_tag)); |
- const StubEntry* stub_entry = (is_bootstrap_native() || is_leaf_call) ? |
- StubCode::CallBootstrapCFunction_entry() : |
- StubCode::CallNativeCFunction_entry(); |
+ |
+ const StubEntry* stub_entry; |
+ if (link_lazily()) { |
+ stub_entry = StubCode::CallBootstrapCFunction_entry(); |
+ __ movl(ECX, Immediate(NativeEntry::LinkNativeCallLabel().address())); |
+ } else { |
+ stub_entry = (is_bootstrap_native() || is_leaf_call) ? |
+ StubCode::CallBootstrapCFunction_entry() : |
+ StubCode::CallNativeCFunction_entry(); |
+ const ExternalLabel label(reinterpret_cast<uword>(native_c_function())); |
+ __ movl(ECX, Immediate(label.address())); |
+ } |
compiler->GenerateCall(token_pos(), |
*stub_entry, |
RawPcDescriptors::kOther, |