summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/assembler/ARMAssembler.h
diff options
context:
space:
mode:
authorZoltan Herczeg <zherczeg@webkit.org>2013-03-21 15:08:23 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-25 19:22:45 +0100
commitfdf79b1d3038742045a2d18b36c0867ec3075463 (patch)
treeb648b79d288d597ad59bca652a7dbfe68745e572 /Source/JavaScriptCore/assembler/ARMAssembler.h
parentaa27332517ed9dfdbaa935966ba3169d1b001e5e (diff)
downloadqtwebkit-fdf79b1d3038742045a2d18b36c0867ec3075463.tar.gz
revertBranchPtrWithPatch is incorrect on ARM traditional
https://bugs.webkit.org/show_bug.cgi?id=110201 Reviewed by Oliver Hunt. Revert two instructions back to their original value. * assembler/ARMAssembler.h: (JSC::ARMAssembler::revertBranchPtrWithPatch): (ARMAssembler): * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::branchPtrWithPatch): (JSC::MacroAssemblerARM::revertJumpReplacementToBranchPtrWithPatch): Change-Id: Ic453e2d43913e1139a0f119e5f6c3e4d4ce0d7e1 git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143346 268f45cc-cd09-0410-ab3c-d52691b4dbfc Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/assembler/ARMAssembler.h')
-rw-r--r--Source/JavaScriptCore/assembler/ARMAssembler.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.h b/Source/JavaScriptCore/assembler/ARMAssembler.h
index ebab46d98..11418c3fc 100644
--- a/Source/JavaScriptCore/assembler/ARMAssembler.h
+++ b/Source/JavaScriptCore/assembler/ARMAssembler.h
@@ -402,13 +402,6 @@ namespace JSC {
emitInstruction(toARMWord(cc) | MOV | SetConditionalCodes, rd, ARMRegisters::r0, op2);
}
- static void revertJump(void* instructionStart, RegisterID rd, ARMWord imm)
- {
- ARMWord* insn = reinterpret_cast<ARMWord*>(instructionStart);
- ARMWord* address = getLdrImmAddress(insn);
- *address = imm;
- }
-
void bic(int rd, int rn, ARMWord op2, Condition cc = AL)
{
emitInstruction(toARMWord(cc) | BIC, rd, rn, op2);
@@ -952,6 +945,17 @@ namespace JSC {
}
}
+ static void revertBranchPtrWithPatch(void* instructionStart, RegisterID rn, ARMWord imm)
+ {
+ ARMWord* instruction = reinterpret_cast<ARMWord*>(instructionStart);
+
+ ASSERT((instruction[2] & LdrPcImmediateInstructionMask) == LdrPcImmediateInstruction);
+ instruction[0] = toARMWord(AL) | ((instruction[2] & 0x0fff0fff) + sizeof(ARMWord)) | RD(ARMRegisters::S1);
+ *getLdrImmAddress(instruction) = imm;
+ instruction[1] = toARMWord(AL) | CMP | SetConditionalCodes | RN(rn) | RM(ARMRegisters::S1);
+ cacheFlush(instruction, 2 * sizeof(ARMWord));
+ }
+
// Address operations
static void* getRelocatedAddress(void* code, AssemblerLabel label)