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

Unified Diff: runtime/vm/intermediate_language_arm.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 | « no previous file | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index 78a88513bfd4d225b69d2d82d01f788796b42ff3..ebc5e5c3822ca96ac26436608cf8da9ec715335a 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -924,8 +924,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(
@@ -944,7 +947,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#endif
}
__ LoadImmediate(R5, entry);
- __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function()));
+ __ LoadImmediate(R1, argc_tag);
compiler->GenerateCall(token_pos(),
stub_entry,
PcDescriptors::kOther,
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698