Index: src/arm/assembler-arm-inl.h |
diff --git a/src/arm/assembler-arm-inl.h b/src/arm/assembler-arm-inl.h |
index 0f9630b34154130475b9b1293a8d13e08fc1ba55..1e0d5c1f7dd4a43a24a7e23d243fb4631c58706b 100644 |
--- a/src/arm/assembler-arm-inl.h |
+++ b/src/arm/assembler-arm-inl.h |
@@ -266,19 +266,11 @@ Object** RelocInfo::call_object_address() { |
bool RelocInfo::IsPatchedReturnSequence() { |
Instr current_instr = Assembler::instr_at(pc_); |
Instr next_instr = Assembler::instr_at(pc_ + Assembler::kInstrSize); |
-#ifdef USE_BLX |
// A patched return sequence is: |
// ldr ip, [pc, #0] |
// blx ip |
return ((current_instr & kLdrPCMask) == kLdrPCPattern) |
&& ((next_instr & kBlxRegMask) == kBlxRegPattern); |
-#else |
- // A patched return sequence is: |
- // mov lr, pc |
- // ldr pc, [pc, #-4] |
- return (current_instr == kMovLrPc) |
- && ((next_instr & kLdrPCMask) == kLdrPCPattern); |
-#endif |
} |
@@ -408,14 +400,11 @@ Address Assembler::target_pointer_address_at(Address pc) { |
instr = Memory::int32_at(target_pc); |
} |
-#ifdef USE_BLX |
- // If we have a blx instruction, the instruction before it is |
- // what needs to be patched. |
+ // With a blx instruction, the instruction before is what needs to be patched. |
if ((instr & kBlxRegMask) == kBlxRegPattern) { |
target_pc -= kInstrSize; |
instr = Memory::int32_at(target_pc); |
} |
-#endif |
ASSERT(IsLdrPcImmediateOffset(instr)); |
int offset = instr & 0xfff; // offset_12 is unsigned |
@@ -442,7 +431,6 @@ Address Assembler::target_pointer_at(Address pc) { |
Address Assembler::target_address_from_return_address(Address pc) { |
// Returns the address of the call target from the return address that will |
// be returned to after a call. |
-#ifdef USE_BLX |
// Call sequence on V7 or later is : |
// movw ip, #... @ call address low 16 |
// movt ip, #... @ call address high 16 |
@@ -461,18 +449,10 @@ Address Assembler::target_address_from_return_address(Address pc) { |
ASSERT(IsMovW(Memory::int32_at(candidate)) && |
IsMovT(Memory::int32_at(candidate + kInstrSize))); |
return candidate; |
-#else |
- // Call sequence is: |
- // mov lr, pc |
- // ldr pc, [pc, #...] @ call address |
- // @ return address |
- return pc - kInstrSize; |
-#endif |
} |
Address Assembler::return_address_from_call_start(Address pc) { |
-#ifdef USE_BLX |
if (IsLdrPcImmediateOffset(Memory::int32_at(pc))) { |
return pc + kInstrSize * 2; |
} else { |
@@ -480,9 +460,6 @@ Address Assembler::return_address_from_call_start(Address pc) { |
ASSERT(IsMovT(Memory::int32_at(pc + kInstrSize))); |
return pc + kInstrSize * 3; |
} |
-#else |
- return pc + kInstrSize; |
-#endif |
} |