Index: src/arm/macro-assembler-arm.cc |
=================================================================== |
--- src/arm/macro-assembler-arm.cc (revision 6398) |
+++ src/arm/macro-assembler-arm.cc (working copy) |
@@ -485,6 +485,11 @@ |
PopSafepointRegisters(); |
} |
+void MacroAssembler::StoreToSafepointRegisterSlot(Register reg) { |
+ str(reg, SafepointRegisterSlot(reg)); |
+} |
+ |
+ |
int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { |
// The registers are pushed starting with the highest encoding, |
// which means that lowest encodings are closest to the stack pointer. |
@@ -493,6 +498,11 @@ |
} |
+MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { |
+ return MemOperand(sp, SafepointRegisterStackIndex(reg.code()) * kInstrSize); |
+} |
+ |
+ |
void MacroAssembler::Ldrd(Register dst1, Register dst2, |
const MemOperand& src, Condition cond) { |
ASSERT(src.rm().is(no_reg)); |
@@ -2185,6 +2195,26 @@ |
} |
+void MacroAssembler::GetRelocatedValueLocation(Register ldr_location, |
+ Register result) { |
+ const uint32_t kLdrOffsetMask = (1 << 12) - 1; |
+ const int32_t kPCRegOffset = 2 * kPointerSize; |
+ ldr(result, MemOperand(ldr_location)); |
+ if (FLAG_debug_code) { |
+ // Check that the instruction is a ldr reg, [pc + offset] . |
+ and_(result, result, Operand(kLdrPCPattern)); |
+ cmp(result, Operand(kLdrPCPattern)); |
+ Check(eq, "The instruction to patch should be a load from pc."); |
+ // Result was clobbered. Restore it. |
+ ldr(result, MemOperand(ldr_location)); |
+ } |
+ // Get the address of the constant. |
+ and_(result, result, Operand(kLdrOffsetMask)); |
+ add(result, ldr_location, Operand(result)); |
+ add(result, result, Operand(kPCRegOffset)); |
+} |
+ |
+ |
#ifdef ENABLE_DEBUGGER_SUPPORT |
CodePatcher::CodePatcher(byte* address, int instructions) |
: address_(address), |