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

Unified Diff: runtime/vm/intermediate_language_arm64.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
Index: runtime/vm/intermediate_language_arm64.cc
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index d5115be2555cffcc1cf62b393f2edee91aa361cc..d23708d441df88e25ebc80b377a1440e21f7f129 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -769,8 +769,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(
@@ -789,7 +792,7 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
#endif
}
__ LoadImmediate(R5, entry, PP);
- __ LoadImmediate(R1, NativeArguments::ComputeArgcTag(function()), PP);
+ __ LoadImmediate(R1, argc_tag, PP);
compiler->GenerateCall(token_pos(),
stub_entry,
PcDescriptors::kOther,

Powered by Google App Engine
This is Rietveld 408576698