From fdf79b1d3038742045a2d18b36c0867ec3075463 Mon Sep 17 00:00:00 2001 From: Zoltan Herczeg Date: Thu, 21 Mar 2013 15:08:23 +0100 Subject: 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 --- Source/JavaScriptCore/assembler/MacroAssemblerARM.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Source/JavaScriptCore/assembler/MacroAssemblerARM.h') diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h index e6b5ad383..c5ea9c542 100644 --- a/Source/JavaScriptCore/assembler/MacroAssemblerARM.h +++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM.h @@ -673,9 +673,8 @@ public: m_assembler.vmov(dest1, dest2, src); } - void moveIntsToDouble(RegisterID src1, RegisterID src2, FPRegisterID dest, FPRegisterID scratch) + void moveIntsToDouble(RegisterID src1, RegisterID src2, FPRegisterID dest, FPRegisterID) { - UNUSED_PARAM(scratch); m_assembler.vmov(dest, src1, src2); } @@ -955,6 +954,7 @@ public: Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0)) { + ensureSpace(3 * sizeof(ARMWord), 2 * sizeof(ARMWord)); dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S1); Jump jump = branch32(cond, left, ARMRegisters::S1, true); return jump; @@ -963,6 +963,7 @@ public: Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0)) { load32(left, ARMRegisters::S1); + ensureSpace(3 * sizeof(ARMWord), 2 * sizeof(ARMWord)); dataLabel = moveWithPatch(initialRightValue, ARMRegisters::S0); Jump jump = branch32(cond, ARMRegisters::S0, ARMRegisters::S1, true); return jump; @@ -1215,7 +1216,7 @@ public: // If the result is not representable as a 32 bit value, branch. // May also branch for some values that are representable in 32 bits // (specifically, in this case, 0). - void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID fpTemp) + void branchConvertDoubleToInt32(FPRegisterID src, RegisterID dest, JumpList& failureCases, FPRegisterID) { m_assembler.vcvt_s32_f64(ARMRegisters::SD0 << 1, src); m_assembler.vmov_arm32(dest, ARMRegisters::SD0 << 1); @@ -1285,10 +1286,10 @@ public: static void revertJumpReplacementToBranchPtrWithPatch(CodeLocationLabel instructionStart, RegisterID reg, void* initialValue) { - ARMAssembler::revertJump(instructionStart.dataLocation(), reg, reinterpret_cast(initialValue) & 0xffff); + ARMAssembler::revertBranchPtrWithPatch(instructionStart.dataLocation(), reg, reinterpret_cast(initialValue) & 0xffff); } - static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel instructionStart, Address, void* initialValue) + static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel, Address, void*) { UNREACHABLE_FOR_PLATFORM(); } -- cgit v1.2.1