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

    r46832 r47186  
    181181            JmpSrc()
    182182                : m_offset(-1)
    183                 , m_latePatch(false)
    184183            {
    185184            }
    186185
    187             void enableLatePatch() { m_latePatch = true; }
    188186        private:
    189187            JmpSrc(int offset)
    190188                : m_offset(offset)
    191                 , m_latePatch(false)
    192189            {
    193190            }
    194191
    195             int m_offset : 31;
    196             int m_latePatch : 1;
     192            int m_offset;
    197193        };
    198194
     
    568564        }
    569565
     566        int sizeOfConstantPool()
     567        {
     568            return m_buffer.sizeOfConstantPool();
     569        }
     570
    570571        JmpDst label()
    571572        {
     
    581582        }
    582583
    583         JmpSrc jmp(Condition cc = AL)
    584         {
    585             int s = size();
     584        JmpSrc jmp(Condition cc = AL, int useConstantPool = 0)
     585        {
     586            ensureSpace(sizeof(ARMWord), sizeof(ARMWord));
     587            int s = m_buffer.uncheckedSize();
    586588            ldr_un_imm(ARM::pc, 0xffffffff, cc);
    587             m_jumps.append(s);
     589            m_jumps.append(s | (useConstantPool & 0x1));
    588590            return JmpSrc(s);
    589591        }
     
    594596
    595597        static ARMWord* getLdrImmAddress(ARMWord* insn, uint32_t* constPool = 0);
    596         static void linkBranch(void* code, JmpSrc from, void* to);
     598        static void linkBranch(void* code, JmpSrc from, void* to, int useConstantPool = 0);
    597599
    598600        static void patchPointerInternal(intptr_t from, void* to)
     
    661663        static void linkCall(void* code, JmpSrc from, void* to)
    662664        {
    663             linkBranch(code, from, to);
     665            linkBranch(code, from, to, true);
    664666        }
    665667
Note: See TracChangeset for help on using the changeset viewer.