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

Unified Diff: runtime/vm/intermediate_language_x64.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_mips.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 7123364875130729b0278e247098dffec8c56f99..252bb138cd3571a941b4a25154c871d39713280b 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -781,14 +781,21 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
} else {
__ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize));
}
- ExternalLabel label(reinterpret_cast<uword>(native_c_function()));
- __ LoadExternalLabel(RBX, &label, kNotPatchable);
__ LoadImmediate(R10, 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();
+ __ LoadExternalLabel(
+ RBX, &NativeEntry::LinkNativeCallLabel(), kPatchable);
+ } else {
+ stub_entry = (is_bootstrap_native() || is_leaf_call)
+ ? StubCode::CallBootstrapCFunction_entry()
+ : StubCode::CallNativeCFunction_entry();
+ const ExternalLabel label(reinterpret_cast<uword>(native_c_function()));
+ __ LoadExternalLabel(RBX, &label, kNotPatchable);
+ }
compiler->GenerateCall(token_pos(),
- stub_entry,
+ *stub_entry,
RawPcDescriptors::kOther,
locs());
__ popq(result);
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/native_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698