Ignore:
Timestamp:
Aug 12, 2009, 10:58:36 PM (16 years ago)
Author:
[email protected]
Message:

Add optimize call and property access support for ARM JIT.
https://bugs.webkit.org/show_bug.cgi?id=24986

Patch by Gabor Loki <[email protected]> on 2009-08-12
Reviewed by Gavin Barraclough.

For tightly coupled sequences the BEGIN_UNINTERRUPTED_SEQUENCE and
END_UNINTERRUPTED_SEQUENCE macros have been introduced which ensure
space for instructions and constants of the named sequence. This
method is vital for those architecture which are using constant pool.

The 'latePatch' method - which was linked to JmpSrc - is replaced with
a port specific solution (each calls are marked to place their address
on the constant pool).

  • assembler/ARMAssembler.cpp:

(JSC::ARMAssembler::linkBranch):
(JSC::ARMAssembler::executableCopy): Add extra align for constant pool.

  • assembler/ARMAssembler.h:

(JSC::ARMAssembler::JmpSrc::JmpSrc):
(JSC::ARMAssembler::sizeOfConstantPool):
(JSC::ARMAssembler::jmp):
(JSC::ARMAssembler::linkCall):

  • assembler/ARMv7Assembler.h:
  • assembler/AbstractMacroAssembler.h:
  • assembler/AssemblerBufferWithConstantPool.h:

(JSC::AssemblerBufferWithConstantPool::flushIfNoSpaceFor): Fix the
computation of the remaining space.

  • assembler/MacroAssemblerARM.h:

(JSC::MacroAssemblerARM::branch32):
(JSC::MacroAssemblerARM::nearCall):
(JSC::MacroAssemblerARM::call):
(JSC::MacroAssemblerARM::branchPtrWithPatch):
(JSC::MacroAssemblerARM::ensureSpace):
(JSC::MacroAssemblerARM::sizeOfConstantPool):
(JSC::MacroAssemblerARM::prepareCall):

  • assembler/X86Assembler.h:
  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITInlineMethods.h:

(JSC::JIT::beginUninterruptedSequence):
(JSC::JIT::endUninterruptedSequence):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emit_op_method_check):
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):

File:
1 edited

Legend:

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

    r46832 r47186  
    325325    }
    326326
    327     Jump branch32(Condition cond, RegisterID left, RegisterID right)
     327    Jump branch32(Condition cond, RegisterID left, RegisterID right, int useConstantPool = 0)
    328328    {
    329329        m_assembler.cmp_r(left, right);
    330         return Jump(m_assembler.jmp(ARMCondition(cond)));
    331     }
    332 
    333     Jump branch32(Condition cond, RegisterID left, Imm32 right)
     330        return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
     331    }
     332
     333    Jump branch32(Condition cond, RegisterID left, Imm32 right, int useConstantPool = 0)
    334334    {
    335335        if (right.m_isPointer) {
     
    338338        } else
    339339            m_assembler.cmp_r(left, m_assembler.getImm(right.m_value, ARM::S0));
    340         return Jump(m_assembler.jmp(ARMCondition(cond)));
     340        return Jump(m_assembler.jmp(ARMCondition(cond), useConstantPool));
    341341    }
    342342
     
    498498    {
    499499        prepareCall();
    500         return Call(m_assembler.jmp(), Call::LinkableNear);
     500        return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::LinkableNear);
    501501    }
    502502
     
    588588    {
    589589        prepareCall();
    590         return Call(m_assembler.jmp(), Call::Linkable);
     590        return Call(m_assembler.jmp(ARMAssembler::AL, true), Call::Linkable);
    591591    }
    592592
     
    611611    {
    612612        dataLabel = moveWithPatch(initialRightValue, ARM::S1);
    613         Jump jump = branch32(cond, left, ARM::S1);
    614         jump.enableLatePatch();
     613        Jump jump = branch32(cond, left, ARM::S1, true);
    615614        return jump;
    616615    }
     
    620619        load32(left, ARM::S1);
    621620        dataLabel = moveWithPatch(initialRightValue, ARM::S0);
    622         Jump jump = branch32(cond, ARM::S0, ARM::S1);
    623         jump.enableLatePatch();
     621        Jump jump = branch32(cond, ARM::S0, ARM::S1, true);
    624622        return jump;
    625623    }
     
    723721    }
    724722
     723    void ensureSpace(int insnSpace, int constSpace)
     724    {
     725        m_assembler.ensureSpace(insnSpace, constSpace);
     726    }
     727
     728    int sizeOfConstantPool()
     729    {
     730        return m_assembler.sizeOfConstantPool();
     731    }
     732
    725733    void prepareCall()
    726734    {
    727         m_assembler.ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord));
     735        ensureSpace(3 * sizeof(ARMWord), sizeof(ARMWord));
    728736
    729737        // S0 might be used for parameter passing
Note: See TracChangeset for help on using the changeset viewer.