Chromium Code Reviews| 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. |