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

Unified Diff: runtime/vm/assembler_mips.cc

Issue 14076005: Supports FrameLookup vm test on MIPS (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/assembler_mips.h ('k') | runtime/vm/constants_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 21219)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -204,20 +204,47 @@
}
-void Assembler::EnterStubFrame() {
- addiu(SP, SP, Immediate(-3 * kWordSize));
- sw(ZR, Address(SP, 2 * kWordSize)); // PC marker is 0 in stubs.
- sw(RA, Address(SP, 1 * kWordSize));
- sw(FP, Address(SP, 0 * kWordSize));
- mov(FP, SP);
+void Assembler::EnterStubFrame(bool uses_pp) {
+ if (uses_pp) {
+ addiu(SP, SP, Immediate(-4 * kWordSize));
+ sw(ZR, Address(SP, 3 * kWordSize)); // PC marker is 0 in stubs.
+ sw(RA, Address(SP, 2 * kWordSize));
+ sw(PP, Address(SP, 1 * kWordSize));
+ sw(FP, Address(SP, 0 * kWordSize));
+ mov(FP, SP);
+ // Setup pool pointer for this stub.
+ Label next;
+ bal(&next);
+ delay_slot()->mov(T0, RA);
+
+ const intptr_t object_pool_pc_dist =
+ Instructions::HeaderSize() - Instructions::object_pool_offset() +
+ CodeSize();
+
+ Bind(&next);
+ lw(PP, Address(T0, -object_pool_pc_dist));
+ } else {
+ addiu(SP, SP, Immediate(-3 * kWordSize));
+ sw(ZR, Address(SP, 2 * kWordSize)); // PC marker is 0 in stubs.
+ sw(RA, Address(SP, 1 * kWordSize));
+ sw(FP, Address(SP, 0 * kWordSize));
+ mov(FP, SP);
+ }
}
-void Assembler::LeaveStubFrame() {
+void Assembler::LeaveStubFrame(bool uses_pp) {
mov(SP, FP);
- lw(RA, Address(SP, 1 * kWordSize));
- lw(FP, Address(SP, 0 * kWordSize));
- addiu(SP, SP, Immediate(3 * kWordSize));
+ if (uses_pp) {
+ lw(RA, Address(SP, 2 * kWordSize));
+ lw(PP, Address(SP, 1 * kWordSize));
+ lw(FP, Address(SP, 0 * kWordSize));
+ addiu(SP, SP, Immediate(4 * kWordSize));
+ } else {
+ lw(RA, Address(SP, 1 * kWordSize));
+ lw(FP, Address(SP, 0 * kWordSize));
+ addiu(SP, SP, Immediate(3 * kWordSize));
+ }
}
@@ -250,15 +277,16 @@
// the PC at this sw instruction.
Bind(&next);
- if (offset != 0) {
- // Adjust PC for any intrinsic code that could have been generated
+ // Save PC in frame for fast identification of corresponding code.
+ if (offset == 0) {
+ sw(T0, Address(SP, 3 * kWordSize));
+ } else {
+ // Adjust saved PC for any intrinsic code that could have been generated
// before a frame is created.
- addiu(T0, T0, Immediate(-offset));
+ AddImmediate(T1, T0, -offset);
+ sw(T1, Address(SP, 3 * kWordSize));
}
- // Save PC in frame for fast identification of corresponding code.
- sw(T0, Address(SP, 3 * kWordSize));
-
// Set FP to the saved previous FP.
addiu(FP, SP, Immediate(kWordSize));
@@ -266,7 +294,7 @@
lw(PP, Address(T0, -object_pool_pc_dist));
// Reserve space for locals.
- addiu(SP, SP, Immediate(-frame_size));
+ AddImmediate(SP, -frame_size);
}
@@ -285,7 +313,7 @@
void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
// Reserve space for arguments and align frame before entering
// the C++ world.
- addiu(SP, SP, Immediate(-frame_space));
+ AddImmediate(SP, -frame_space);
if (OS::ActivationFrameAlignment() > 0) {
LoadImmediate(TMP1, ~(OS::ActivationFrameAlignment() - 1));
and_(SP, SP, TMP1);
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/constants_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698