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/MacroAssemblerARM.h

    r48525 r48782  
    199199    }
    200200
     201#if defined(ARM_REQUIRE_NATURAL_ALIGNMENT) && ARM_REQUIRE_NATURAL_ALIGNMENT
     202    void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest);
     203#else
     204    void load32WithUnalignedHalfWords(BaseIndex address, RegisterID dest)
     205    {
     206        load32(address, dest);
     207    }
     208#endif
     209
    201210    DataLabel32 load32WithAddressOffsetPatch(Address address, RegisterID dest)
    202211    {
     
    362371    {
    363372        load32(left, ARMRegisters::S1);
     373        return branch32(cond, ARMRegisters::S1, right);
     374    }
     375
     376    Jump branch32WithUnalignedHalfWords(Condition cond, BaseIndex left, Imm32 right)
     377    {
     378        load32WithUnalignedHalfWords(left, ARMRegisters::S1);
    364379        return branch32(cond, ARMRegisters::S1, right);
    365380    }
Note: See TracChangeset for help on using the changeset viewer.