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

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
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..306e8f36ee6c3e25cd580aaac1a3a739e24a5655 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -723,6 +723,9 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(locs()->temp(1).reg() == RBX);
ASSERT(locs()->temp(2).reg() == R10);
Register result = locs()->out(0).reg();
+ const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
+ const bool is_leaf_call =
+ (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
// Push the result place holder initialized to NULL.
__ PushObject(Object::ZoneHandle(), PP);
@@ -737,10 +740,10 @@ void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ 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,
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698