| Index: src/arm/assembler-arm.h
|
| ===================================================================
|
| --- src/arm/assembler-arm.h (revision 4189)
|
| +++ src/arm/assembler-arm.h (working copy)
|
| @@ -509,7 +509,10 @@
|
|
|
|
|
| extern const Instr kMovLrPc;
|
| +extern const Instr kLdrPCMask;
|
| extern const Instr kLdrPCPattern;
|
| +extern const Instr kBlxRegMask;
|
| +extern const Instr kBlxRegPattern;
|
|
|
|
|
| class Assembler : public Malloced {
|
| @@ -590,12 +593,34 @@
|
| static const int kInstrSize = sizeof(Instr);
|
|
|
| // Distance between the instruction referring to the address of the call
|
| - // target (ldr pc, [target addr in const pool]) and the return address
|
| + // target and the return address.
|
| +#ifdef USE_BLX
|
| + // Call sequence is:
|
| + // ldr ip, [pc, #...] @ call address
|
| + // blx ip
|
| + // @ return address
|
| + static const int kCallTargetAddressOffset = 2 * kInstrSize;
|
| +#else
|
| + // Call sequence is:
|
| + // mov lr, pc
|
| + // ldr pc, [pc, #...] @ call address
|
| + // @ return address
|
| static const int kCallTargetAddressOffset = kInstrSize;
|
| +#endif
|
|
|
| // Distance between start of patched return sequence and the emitted address
|
| // to jump to.
|
| - static const int kPatchReturnSequenceAddressOffset = kInstrSize;
|
| +#ifdef USE_BLX
|
| + // Return sequence is:
|
| + // ldr ip, [pc, #0] @ emited address and start
|
| + // blx ip
|
| + static const int kPatchReturnSequenceAddressOffset = 0 * kInstrSize;
|
| +#else
|
| + // Return sequence is:
|
| + // mov lr, pc @ start of sequence
|
| + // ldr pc, [pc, #-4] @ emited address
|
| + static const int kPatchReturnSequenceAddressOffset = kInstrSize;
|
| +#endif
|
|
|
| // Difference between address of current opcode and value read from pc
|
| // register.
|
|
|