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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 117723002: Allow the native resolver to setup whether it needs the Dart API scope to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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/stub_code_mips.cc ('k') | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
===================================================================
--- runtime/vm/stub_code_x64.cc (revision 31283)
+++ runtime/vm/stub_code_x64.cc (working copy)
@@ -161,8 +161,18 @@
__ leaq(RAX, Address(RBP, 2 * kWordSize)); // Compute return value addr.
__ movq(Address(RSP, retval_offset), RAX); // Set retval in NativeArguments.
__ movq(RDI, RSP); // Pass the pointer to the NativeArguments.
+
+ // Call native function (setsup scope if not leaf function).
+ Label leaf_call;
+ Label done;
+ __ testq(R10, Immediate(NativeArguments::AutoSetupScopeMask()));
+ __ j(ZERO, &leaf_call);
__ movq(RSI, RBX); // Pass pointer to function entrypoint.
__ call(&NativeEntry::NativeCallWrapperLabel());
+ __ jmp(&done);
+ __ Bind(&leaf_call);
+ __ call(RBX);
+ __ Bind(&done);
// Reset exit frame information in Isolate structure.
__ movq(Address(CTX, Isolate::top_exit_frame_info_offset()), Immediate(0));
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698