Index: src/arm/macro-assembler-arm.h |
=================================================================== |
--- src/arm/macro-assembler-arm.h (revision 4499) |
+++ src/arm/macro-assembler-arm.h (working copy) |
@@ -93,6 +93,65 @@ |
// well as the ip register. |
void RecordWrite(Register object, Register offset, Register scratch); |
+ // Push two registers. Pushes leftmost register first (to highest address). |
+ void Push(Register src1, Register src2, Condition cond = al) { |
+ ASSERT(!src1.is(src2)); |
+ if (src1.code() > src2.code()) { |
+ stm(db_w, sp, src1.bit() | src2.bit(), cond); |
+ } else { |
+ str(src1, MemOperand(sp, 4, NegPreIndex), cond); |
Søren Thygesen Gjesse
2010/04/26 14:08:15
Why not use push (from arm-assembler) for this?
|
+ str(src2, MemOperand(sp, 4, NegPreIndex), cond); |
+ } |
+ } |
+ |
+ // Push three registers. Pushes leftmost register first (to highest address). |
+ void Push(Register src1, Register src2, Register src3, Condition cond = al) { |
+ ASSERT(!src1.is(src2)); |
+ ASSERT(!src2.is(src3)); |
+ ASSERT(!src1.is(src3)); |
+ if (src1.code() > src2.code()) { |
+ if (src2.code() > src3.code()) { |
+ stm(db_w, sp, src1.bit() | src2.bit() | src3.bit(), cond); |
+ } else { |
+ stm(db_w, sp, src1.bit() | src2.bit(), cond); |
+ str(src3, MemOperand(sp, 4, NegPreIndex), cond); |
+ } |
+ } else { |
+ str(src1, MemOperand(sp, 4, NegPreIndex), cond); |
+ Push(src2, src3, cond); |
+ } |
+ } |
+ |
+ // Push four registers. Pushes leftmost register first (to highest address). |
+ void Push(Register src1, Register src2, |
+ Register src3, Register src4, Condition cond = al) { |
+ ASSERT(!src1.is(src2)); |
+ ASSERT(!src2.is(src3)); |
+ ASSERT(!src1.is(src3)); |
+ ASSERT(!src1.is(src4)); |
+ ASSERT(!src2.is(src4)); |
+ ASSERT(!src3.is(src4)); |
+ if (src1.code() > src2.code()) { |
+ if (src2.code() > src3.code()) { |
+ if (src3.code() > src4.code()) { |
+ stm(db_w, |
+ sp, |
+ src1.bit() | src2.bit() | src3.bit() | src4.bit(), |
+ cond); |
+ } else { |
+ stm(db_w, sp, src1.bit() | src2.bit() | src3.bit(), cond); |
+ str(src4, MemOperand(sp, 4, NegPreIndex), cond); |
+ } |
+ } else { |
+ stm(db_w, sp, src1.bit() | src2.bit(), cond); |
+ Push(src3, src4, cond); |
+ } |
+ } else { |
+ str(src1, MemOperand(sp, 4, NegPreIndex), cond); |
+ Push(src2, src3, src4, cond); |
+ } |
+ } |
+ |
// --------------------------------------------------------------------------- |
// Stack limit support |