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

Unified Diff: runtime/vm/stub_code_mips.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_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 31283)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -192,10 +192,15 @@
__ sw(A1, Address(SP, 1 * kWordSize));
__ sw(A0, Address(SP, 0 * kWordSize));
__ mov(A0, SP); // Pass the pointer to the NativeArguments.
+
+ // Call native function (setup scope if not leaf function).
+ Label leaf_call;
+ Label done;
+ __ AndImmediate(CMPRES1, A1, NativeArguments::AutoSetupScopeMask());
+ __ beq(CMPRES1, ZR, &leaf_call);
+
__ mov(A1, T5); // Pass the function entrypoint.
-
__ ReserveAlignedFrameSpace(2 * kWordSize); // Just passing A0, A1.
-
// Call native wrapper function or redirection via simulator.
#if defined(USING_SIMULATOR)
uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
@@ -207,7 +212,15 @@
__ BranchLink(&NativeEntry::NativeCallWrapperLabel());
#endif
__ TraceSimMsg("CallNativeCFunctionStub return");
+ __ b(&done);
+ __ Bind(&leaf_call);
+ // Call native function or redirection via simulator.
+ __ ReserveAlignedFrameSpace(kWordSize); // Just passing A0.
+ __ jalr(T5);
+
+ __ Bind(&done);
+
// Reset exit frame information in Isolate structure.
__ sw(ZR, Address(CTX, Isolate::top_exit_frame_info_offset()));
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698