diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-01-19 15:45:36 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-01-19 15:45:36 -0800 |
commit | e60d653a58a568017d6f69aeaed2e3a765a98104 (patch) | |
tree | 817723cbba19468ad6f3a4ab7c48b3513c2078e9 /deps/v8/src/arm/assembler-arm-inl.h | |
parent | bfd31448617dc4d66f6de5ced7c260562e01349f (diff) | |
download | node-e60d653a58a568017d6f69aeaed2e3a765a98104.tar.gz |
Upgrade V8 to 2.0.6.1
Diffstat (limited to 'deps/v8/src/arm/assembler-arm-inl.h')
-rw-r--r-- | deps/v8/src/arm/assembler-arm-inl.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/deps/v8/src/arm/assembler-arm-inl.h b/deps/v8/src/arm/assembler-arm-inl.h index 5f47cb796..fd2fcd305 100644 --- a/deps/v8/src/arm/assembler-arm-inl.h +++ b/deps/v8/src/arm/assembler-arm-inl.h @@ -229,14 +229,24 @@ void Assembler::emit(Instr x) { Address Assembler::target_address_address_at(Address pc) { - Instr instr = Memory::int32_at(pc); - // Verify that the instruction at pc is a ldr<cond> <Rd>, [pc +/- offset_12]. + Address target_pc = pc; + Instr instr = Memory::int32_at(target_pc); + // If we have a bx instruction, the instruction before the bx is + // what we need to patch. + static const int32_t kBxInstMask = 0x0ffffff0; + static const int32_t kBxInstPattern = 0x012fff10; + if ((instr & kBxInstMask) == kBxInstPattern) { + target_pc -= kInstrSize; + instr = Memory::int32_at(target_pc); + } + // Verify that the instruction to patch is a + // ldr<cond> <Rd>, [pc +/- offset_12]. ASSERT((instr & 0x0f7f0000) == 0x051f0000); int offset = instr & 0xfff; // offset_12 is unsigned if ((instr & (1 << 23)) == 0) offset = -offset; // U bit defines offset sign // Verify that the constant pool comes after the instruction referencing it. ASSERT(offset >= -4); - return pc + offset + 8; + return target_pc + offset + 8; } |