Ignore:
Timestamp:
Mar 26, 2012, 7:03:47 PM (13 years ago)
Author:
[email protected]
Message:

Unaligned userspace access for SH4 platforms
https://bugs.webkit.org/show_bug.cgi?id=79104

Patch by Thouraya ANDOLSI <[email protected]> on 2012-03-26
Reviewed by Gavin Barraclough.

  • assembler/AbstractMacroAssembler.h:

(Jump):
(JSC::AbstractMacroAssembler::Jump::Jump):
(JSC::AbstractMacroAssembler::Jump::link):

  • assembler/MacroAssemblerSH4.h:

(JSC::MacroAssemblerSH4::load16Unaligned):
(JSC::MacroAssemblerSH4::load32WithUnalignedHalfWords):
(JSC::MacroAssemblerSH4::branchDouble):
(JSC::MacroAssemblerSH4::branchTrue):
(JSC::MacroAssemblerSH4::branchFalse):

  • assembler/SH4Assembler.h:

(JSC::SH4Assembler::extraInstrForBranch):
(SH4Assembler):
(JSC::SH4Assembler::bra):
(JSC::SH4Assembler::linkJump):

  • jit/JIT.h:

(JIT):

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/SH4Assembler.h

    r109307 r112192  
    327327    };
    328328
     329    enum JumpType { JumpFar,
     330                    JumpNear
     331    };
     332
    329333    SH4Assembler()
    330334    {
     
    11891193    }
    11901194
     1195    void extraInstrForBranch(RegisterID dst)
     1196    {
     1197        loadConstantUnReusable(0x0, dst);
     1198        nop();
     1199        nop();
     1200    }
     1201
    11911202    AssemblerLabel jmp(RegisterID dst)
    11921203    {
     
    12131224        AssemblerLabel label = m_buffer.label();
    12141225        branch(BT_OPCODE, 0);
     1226        return label;
     1227    }
     1228
     1229    AssemblerLabel bra()
     1230    {
     1231        AssemblerLabel label = m_buffer.label();
     1232        branch(BRA_OPCODE, 0);
    12151233        return label;
    12161234    }
     
    14251443    // Linking & patching
    14261444
    1427     void linkJump(AssemblerLabel from, AssemblerLabel to)
     1445    void linkJump(AssemblerLabel from, AssemblerLabel to, JumpType type = JumpFar)
    14281446    {
    14291447        ASSERT(to.isSet());
     
    14331451        uint16_t instruction = *instructionPtr;
    14341452        int offsetBits;
     1453
     1454        if (type == JumpNear) {
     1455            ASSERT((instruction ==  BT_OPCODE) || (instruction == BF_OPCODE) || (instruction == BRA_OPCODE));
     1456            int offset = (codeSize() - from.m_offset) - 4;
     1457            *instructionPtr++ = instruction | (offset >> 1);
     1458            printInstr(*instructionPtr, from.m_offset + 2);
     1459            return;
     1460        }
    14351461
    14361462        if (((instruction & 0xff00) == BT_OPCODE) || ((instruction & 0xff00) == BF_OPCODE)) {
Note: See TracChangeset for help on using the changeset viewer.