Fix the ARM traditional build after r135330
https://bugs.webkit.org/show_bug.cgi?id=102871
Patch by Gabor Ballabas <gaborb@inf.u-szeged.hu> on 2012-11-23
Reviewed by Zoltan Herczeg.
Added missing functionality to traditional ARM architecture.
* assembler/ARMAssembler.h:
(JSC::ARMAssembler::revertJump):
(ARMAssembler):
* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::startOfPatchableBranchPtrWithPatchOnAddress):
(JSC::MacroAssemblerARM::startOfBranchPtrWithPatchOnRegister):
(MacroAssemblerARM):
(JSC::MacroAssemblerARM::revertJumpReplacementToBranchPtrWithPatch):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index ad1e421..4ef0f3b 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,21 @@
+2012-11-23 Gabor Ballabas <gaborb@inf.u-szeged.hu>
+
+ Fix the ARM traditional build after r135330
+ https://bugs.webkit.org/show_bug.cgi?id=102871
+
+ Reviewed by Zoltan Herczeg.
+
+ Added missing functionality to traditional ARM architecture.
+
+ * assembler/ARMAssembler.h:
+ (JSC::ARMAssembler::revertJump):
+ (ARMAssembler):
+ * assembler/MacroAssemblerARM.h:
+ (JSC::MacroAssemblerARM::startOfPatchableBranchPtrWithPatchOnAddress):
+ (JSC::MacroAssemblerARM::startOfBranchPtrWithPatchOnRegister):
+ (MacroAssemblerARM):
+ (JSC::MacroAssemblerARM::revertJumpReplacementToBranchPtrWithPatch):
+
2012-11-16 Yury Semikhatsky <yurys@chromium.org>
Memory instrumentation: extract MemoryObjectInfo declaration into a separate file
diff --git a/Source/JavaScriptCore/assembler/ARMAssembler.h b/Source/JavaScriptCore/assembler/ARMAssembler.h
index 38d0c5e..ebab46d 100644
--- a/Source/JavaScriptCore/assembler/ARMAssembler.h
+++ b/Source/JavaScriptCore/assembler/ARMAssembler.h
@@ -402,6 +402,13 @@
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);
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
index 0ebdbda..9c77e93 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h
@@ -1268,12 +1268,22 @@
static bool canJumpReplacePatchableBranchPtrWithPatch() { return false; }
- static CodeLocationLabel startOfPatchableBranchPtrWithPatch(CodeLocationDataLabelPtr label)
+ static CodeLocationLabel startOfPatchableBranchPtrWithPatchOnAddress(CodeLocationDataLabelPtr)
{
UNREACHABLE_FOR_PLATFORM();
return CodeLocationLabel();
}
+ static CodeLocationLabel startOfBranchPtrWithPatchOnRegister(CodeLocationDataLabelPtr label)
+ {
+ return label.labelAtOffset(0);
+ }
+
+ static void revertJumpReplacementToBranchPtrWithPatch(CodeLocationLabel instructionStart, RegisterID reg, void* initialValue)
+ {
+ ARMAssembler::revertJump(instructionStart.dataLocation(), reg, reinterpret_cast<uintptr_t>(initialValue) & 0xffff);
+ }
+
static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel instructionStart, Address, void* initialValue)
{
UNREACHABLE_FOR_PLATFORM();