Revision: 17492
Author: [email protected]
Date: Tue Nov 5 14:22:12 2013 UTC
Log: Simplified Assembler::target_pointer_address_at.
[email protected]
Review URL: https://codereview.chromium.org/59913002
http://code.google.com/p/v8/source/detail?r=17492
Modified:
/branches/bleeding_edge/src/arm/assembler-arm-inl.h
=======================================
--- /branches/bleeding_edge/src/arm/assembler-arm-inl.h Tue Nov 5 10:14:48
2013 UTC
+++ /branches/bleeding_edge/src/arm/assembler-arm-inl.h Tue Nov 5 14:22:12
2013 UTC
@@ -104,7 +104,7 @@
ASSERT(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)
|| rmode_ == EMBEDDED_OBJECT
|| rmode_ == EXTERNAL_REFERENCE);
- return
reinterpret_cast<Address>(Assembler::target_pointer_address_at(pc_));
+ return Assembler::target_pointer_address_at(pc_);
}
@@ -392,29 +392,8 @@
Address Assembler::target_pointer_address_at(Address pc) {
- 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);
- }
-
- // 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);
- }
-
- ASSERT(IsLdrPcImmediateOffset(instr));
- 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 target_pc + offset + 8;
+ Instr instr = Memory::int32_at(pc);
+ return pc + GetLdrRegisterImmediateOffset(instr) + kPcLoadDelta;
}
@@ -427,6 +406,7 @@
(next_instr->ImmedMovwMovtValue() << 16) |
instr->ImmedMovwMovtValue());
}
+ ASSERT(IsLdrPcImmediateOffset(Memory::int32_at(pc)));
return Memory::Address_at(target_pointer_address_at(pc));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.