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

Unified Diff: runtime/vm/intermediate_language_mips.cc

Issue 315223003: Use CallBootstrapC stub for leaf native calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 53e72a379a4b16a4c10c3cb43e44c271d9a7bb6b..bec3d41737a752be6a74089ed54c8cb9c40d986c 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -879,8 +879,11 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// this is a redirection address that forces the simulator to call
// into the runtime system.
uword entry = reinterpret_cast<uword>(native_c_function());
+ const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
+ const bool is_leaf_call =
+ (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
const ExternalLabel* stub_entry;
- if (is_bootstrap_native()) {
+ if (is_bootstrap_native() || is_leaf_call) {
stub_entry = &StubCode::CallBootstrapCFunctionLabel();
#if defined(USING_SIMULATOR)
entry = Simulator::RedirectExternalReference(
@@ -899,7 +902,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#endif
}
__ LoadImmediate(T5, entry);
- __ LoadImmediate(A1, NativeArguments::ComputeArgcTag(function()));
+ __ LoadImmediate(A1, argc_tag);
compiler->GenerateCall(token_pos(),
stub_entry,
PcDescriptors::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