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

Unified Diff: runtime/vm/stub_code_mips.cc

Issue 131103025: Fixes ABI bug in MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 11 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/instructions_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_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 32146)
+++ runtime/vm/stub_code_mips.cc (working copy)
@@ -84,8 +84,13 @@
// Set argv in NativeArguments.
__ addiu(A2, A2, Immediate(exitframe_last_param_slot_from_fp * kWordSize));
+
// Call runtime or redirection via simulator.
- __ jalr(S5);
+ // We defensively always jalr through T9 because it is sometimes required by
+ // the MIPS ABI.
+ __ mov(T9, S5);
+ __ jalr(T9);
+
ASSERT(retval_offset == 3 * kWordSize);
// Retval is next to 1st argument.
__ delay_slot()->addiu(A3, A2, Immediate(kWordSize));
@@ -206,8 +211,8 @@
uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
entry = Simulator::RedirectExternalReference(
entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
- __ LoadImmediate(T5, entry);
- __ jalr(T5);
+ __ LoadImmediate(T9, entry);
+ __ jalr(T9);
#else
__ BranchLink(&NativeEntry::NativeCallWrapperLabel());
#endif
@@ -217,8 +222,13 @@
__ Bind(&leaf_call);
// Call native function or redirection via simulator.
__ ReserveAlignedFrameSpace(kWordSize); // Just passing A0.
- __ jalr(T5);
+
+ // We defensively always jalr through T9 because it is sometimes required by
+ // the MIPS ABI.
+ __ mov(T9, T5);
+ __ jalr(T9);
+
__ Bind(&done);
// Reset exit frame information in Isolate structure.
@@ -307,7 +317,11 @@
__ ReserveAlignedFrameSpace(kWordSize); // Just passing A0.
// Call native function or redirection via simulator.
- __ jalr(T5);
+
+ // We defensively always jalr through T9 because it is sometimes required by
+ // the MIPS ABI.
+ __ mov(T9, T5);
+ __ jalr(T9);
__ TraceSimMsg("CallNativeCFunctionStub return");
// Reset exit frame information in Isolate structure.
@@ -1023,6 +1037,8 @@
__ Bind(&done_push_arguments);
// Call the Dart code entrypoint.
+ // We are calling into Dart code, here, so there is no need to call through
+ // T9 to match the ABI.
__ jalr(A0); // S4 is the arguments descriptor array.
__ TraceSimMsg("InvokeDartCodeStub return");
« no previous file with comments | « runtime/vm/instructions_mips.cc ('k') | samples/sample_extension/sample_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698