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

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
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 21219)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -169,6 +169,21 @@
}
+void Assembler::BranchOnCondition(Register rd, Label* l, Condition c) {
+ switch (c) {
+ case EQ:
+ beq(rd, ZR, l);
+ break;
+ case NE:
+ bne(rd, ZR, l);
+ break;
+ default:
+ UNIMPLEMENTED();
+ break;
+ }
+}
+
+
void Assembler::LoadClassId(Register result, Register object) {
ASSERT(RawObject::kClassIdTagBit == 16);
ASSERT(RawObject::kClassIdTagSize == 16);
@@ -204,20 +219,48 @@
}
-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() {
- mov(SP, FP);
- lw(RA, Address(SP, 1 * kWordSize));
- lw(FP, Address(SP, 0 * kWordSize));
- addiu(SP, SP, Immediate(3 * kWordSize));
+void Assembler::LeaveStubFrame(bool uses_pp) {
+ if (uses_pp) {
+ mov(SP, FP);
regis 2013/04/10 20:53:00 You can factorize this mov.
zra 2013/04/10 21:59:05 Done.
+ 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 {
+ mov(SP, FP);
+ lw(RA, Address(SP, 1 * kWordSize));
+ lw(FP, Address(SP, 0 * kWordSize));
+ addiu(SP, SP, Immediate(3 * kWordSize));
+ }
}
@@ -250,15 +293,16 @@
// the PC at this sw instruction.
Bind(&next);
+ // Save PC in frame for fast identification of corresponding code.
+ sw(T0, Address(SP, 3 * kWordSize));
regis 2013/04/10 20:53:00 You could save this store if offset != 0: if (off
zra 2013/04/10 21:59:05 Done.
+
if (offset != 0) {
- // Adjust PC for any intrinsic code that could have been generated
+ // 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 +310,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 +329,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);

Powered by Google App Engine
This is Rietveld 408576698