Changeset 113253 in webkit
- Timestamp:
- Apr 4, 2012 3:42:29 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r113240 r113253 1 2012-04-04 Michael Saboff <msaboff@apple.com> 2 3 Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP 4 https://bugs.webkit.org/show_bug.cgi?id=83191 5 6 Reviewed by Oliver Hunt. 7 8 Make are that blinded constant pairs are similarly aligned to the 9 original immediate values so that instructions that expect that 10 alignment work correctly. One example is ARMv7 add/sub imm to SP. 11 12 * assembler/ARMv7Assembler.h: 13 (JSC::ARMv7Assembler::add): Added ASSERT that immediate is word aligned. 14 (JSC::ARMv7Assembler::sub): Added ASSERT that immediate is word aligned. 15 (JSC::ARMv7Assembler::sub_S): Added ASSERT that immediate is word aligned. 16 * assembler/MacroAssembler.h: 17 (JSC::MacroAssembler::additionBlindedConstant): 18 1 19 2012-04-04 Filip Pizlo <fpizlo@apple.com> 2 20 -
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r109038 r113253 740 740 741 741 if (rn == ARMRegisters::sp) { 742 ASSERT(!(imm.getUInt16() & 3)); 742 743 if (!(rd & 8) && imm.isUInt10()) { 743 744 m_formatter.oneWordOp5Reg3Imm8(OP_ADD_SP_imm_T1, rd, static_cast<uint8_t>(imm.getUInt10() >> 2)); … … 1512 1513 1513 1514 if ((rn == ARMRegisters::sp) && (rd == ARMRegisters::sp) && imm.isUInt9()) { 1515 ASSERT(!(imm.getUInt16() & 3)); 1514 1516 m_formatter.oneWordOp9Imm7(OP_SUB_SP_imm_T1, static_cast<uint8_t>(imm.getUInt9() >> 2)); 1515 1517 return; … … 1573 1575 1574 1576 if ((rn == ARMRegisters::sp) && (rd == ARMRegisters::sp) && imm.isUInt9()) { 1577 ASSERT(!(imm.getUInt16() & 3)); 1575 1578 m_formatter.oneWordOp9Imm7(OP_SUB_SP_imm_T1, static_cast<uint8_t>(imm.getUInt9() >> 2)); 1576 1579 return; -
trunk/Source/JavaScriptCore/assembler/MacroAssembler.h
r110751 r113253 700 700 BlindedImm32 additionBlindedConstant(Imm32 imm) 701 701 { 702 // The addition immediate may be used as a pointer offset. Keep aligned based on "imm". 703 static uint32_t maskTable[4] = { 0xfffffffc, 0xffffffff, 0xfffffffe, 0xffffffff }; 704 702 705 uint32_t baseValue = imm.asTrustedImm32().m_value; 703 uint32_t key = keyForConstant(baseValue) ;706 uint32_t key = keyForConstant(baseValue) & maskTable[baseValue & 3]; 704 707 if (key > baseValue) 705 708 key = key - baseValue;
Note: See TracChangeset
for help on using the changeset viewer.