Ignore:
Timestamp:
Sep 25, 2009, 7:27:02 PM (16 years ago)
Author:
[email protected]
Message:

2009-09-25 Gabor Loki <[email protected]>

Reviewed by Gavin Barraclough.

Fix unaligned data access in YARR_JIT on ARMv5 and below.
https://bugs.webkit.org/show_bug.cgi?id=29695

On ARMv5 and below all data access should be naturally aligned.
In the YARR_JIT there is a case when character pairs are
loaded from the input string, but this data access is not
naturally aligned. This fix introduces load32WithUnalignedHalfWords
and branch32WithUnalignedHalfWords functions which contain
naturally aligned memory loads - half word loads - on ARMv5 and below.

  • assembler/MacroAssemblerARM.cpp: (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  • assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords): (JSC::MacroAssemblerARM::branch32WithUnalignedHalfWords):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::load32WithUnalignedHalfWords): (JSC::MacroAssemblerARMv7::branch32): (JSC::MacroAssemblerARMv7::branch32WithUnalignedHalfWords):
  • assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load32WithUnalignedHalfWords): (JSC::MacroAssemblerX86Common::branch32WithUnalignedHalfWords):
  • wtf/Platform.h:
  • yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/MacroAssemblerARMv7.h

    r48445 r48782  
    376376    }
    377377
     378    void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
     379    {
     380        load32(setupArmAddress(address), dest);
     381    }
     382
    378383    void load32(void* address, RegisterID dest)
    379384    {
     
    718723    }
    719724
     725    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
     726    {
     727        // use addressTempRegister incase the branch32 we call uses dataTempRegister. :-/
     728        load32WithUnalignedHalfWords(left, addressTempRegister);
     729        return branch32(cond, addressTempRegister, right);
     730    }
     731
    720732    Jump branch32(Condition cond, AbsoluteAddress left, RegisterID right)
    721733    {
Note: See TracChangeset for help on using the changeset viewer.