Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 1294113004: VM: Link native calls lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698