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

Unified Diff: runtime/vm/intermediate_language_x64.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_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index f999bddfbcdc320f15ba3c5fa5d488e672545a59..d7b162da13f103154057e182eff5e63f8c070387 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -734,13 +734,16 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ leaq(RAX,
Address(RBP, kFirstLocalSlotFromFp * kWordSize));
}
+ const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
+ const bool is_leaf_call =
+ (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
__ LoadImmediate(
RBX, Immediate(reinterpret_cast<uword>(native_c_function())), PP);
__ LoadImmediate(
- R10, Immediate(NativeArguments::ComputeArgcTag(function())), PP);
- const ExternalLabel* stub_entry =
- (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() :
- &StubCode::CallNativeCFunctionLabel();
+ R10, Immediate(argc_tag), PP);
+ const ExternalLabel* stub_entry = (is_bootstrap_native() || is_leaf_call) ?
+ &StubCode::CallBootstrapCFunctionLabel() :
+ &StubCode::CallNativeCFunctionLabel();
compiler->GenerateCall(token_pos(),
stub_entry,
PcDescriptors::kOther,

Powered by Google App Engine
This is Rietveld 408576698