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

Unified Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_mips.cc
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 0905a5d049ed88872e40ade5bad098898e935e33..e888e8454a8eefbd3ed6f6e8e3ca2084ed6ec7bb 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -988,32 +988,42 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Compute the effective address. When running under the simulator,
// this is a redirection address that forces the simulator to call
// into the runtime system.
- uword entry = reinterpret_cast<uword>(native_c_function());
+ uword entry;
const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
const bool is_leaf_call =
(argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
- const StubEntry* stub_entry = NULL;
- if (is_bootstrap_native() || is_leaf_call) {
+ const StubEntry* stub_entry;
+ if (link_lazily()) {
stub_entry = StubCode::CallBootstrapCFunction_entry();
+ entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall);
#if defined(USING_SIMULATOR)
entry = Simulator::RedirectExternalReference(
entry, Simulator::kBootstrapNativeCall, function().NumParameters());
#endif
} else {
- // In the case of non bootstrap native methods the CallNativeCFunction
- // stub generates the redirection address when running under the simulator
- // and hence we do not change 'entry' here.
- stub_entry = StubCode::CallNativeCFunction_entry();
+ entry = reinterpret_cast<uword>(native_c_function());
+ if (is_bootstrap_native() || is_leaf_call) {
+ stub_entry = StubCode::CallBootstrapCFunction_entry();
#if defined(USING_SIMULATOR)
- if (!function().IsNativeAutoSetupScope()) {
entry = Simulator::RedirectExternalReference(
entry, Simulator::kBootstrapNativeCall, function().NumParameters());
- }
#endif
+ } else {
+ // In the case of non bootstrap native methods the CallNativeCFunction
+ // stub generates the redirection address when running under the simulator
+ // and hence we do not change 'entry' here.
+ stub_entry = StubCode::CallNativeCFunction_entry();
+#if defined(USING_SIMULATOR)
+ if (!function().IsNativeAutoSetupScope()) {
+ entry = Simulator::RedirectExternalReference(
+ entry, Simulator::kBootstrapNativeCall, function().NumParameters());
+ }
+#endif
+ }
}
+ __ LoadImmediate(A1, argc_tag);
ExternalLabel label(entry);
__ LoadExternalLabel(T5, &label, kNotPatchable);
- __ LoadImmediate(A1, argc_tag);
compiler->GenerateCall(token_pos(),
*stub_entry,
RawPcDescriptors::kOther,
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698