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

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
Index: runtime/vm/stub_code_mips.cc
===================================================================
--- runtime/vm/stub_code_mips.cc (revision 32137)
+++ 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,7 +1037,11 @@
__ Bind(&done_push_arguments);
// Call the Dart code entrypoint.
- __ jalr(A0); // S4 is the arguments descriptor array.
+ // We defensively always jalr through T9 because it is sometimes required by
+ // the MIPS ABI (though not here in particular since we are calling Dart
+ // code).
+ __ mov(T9, A0);
+ __ jalr(T9); // S4 is the arguments descriptor array.
siva 2014/01/29 22:04:03 Here we are calling Dart code, do we need to be de
zra 2014/01/29 22:49:57 Done.
__ TraceSimMsg("InvokeDartCodeStub return");
// Read the saved new Context pointer.
« no previous file with comments | « runtime/vm/instructions_mips.cc ('k') | samples/sample_extension/sample_asynchronous_extension_no_autoscope.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698