Ignore:
Timestamp:
Aug 5, 2009, 10:22:42 PM (16 years ago)
Author:
[email protected]
Message:

2009-08-05 Zoltan Herczeg <[email protected]>

Reviewed by Gavin Barraclough.

Add JIT support for generic ARM port without optimizations.
https://bugs.webkit.org/show_bug.cgi?id=24986

All JIT optimizations are disabled.

Signed off by Zoltan Herczeg <[email protected]>
Signed off by Gabor Loki <[email protected]>

  • assembler/ARMAssembler.cpp: (JSC::ARMAssembler::baseIndexTransfer32):
  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::Imm32::Imm32):
  • assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::store32): (JSC::MacroAssemblerARM::move): (JSC::MacroAssemblerARM::branch32): (JSC::MacroAssemblerARM::add32): (JSC::MacroAssemblerARM::sub32): (JSC::MacroAssemblerARM::load32):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::getBytecodeIndex):
  • jit/JIT.h:
  • jit/JITInlineMethods.h: (JSC::JIT::restoreArgumentReference):
  • jit/JITOpcodes.cpp:
  • jit/JITStubs.cpp:
  • jit/JITStubs.h: (JSC::JITStackFrame::returnAddressSlot):
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITOpcodes.cpp

    r46620 r46831  
    17941794    addPtr(Imm32(NativeCallFrameSize - sizeof(NativeFunctionCalleeSignature)), stackPointerRegister);
    17951795
     1796#elif PLATFORM(ARM) && !PLATFORM_ARM_ARCH(7)
     1797    emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT0);
     1798
     1799    // Allocate stack space for our arglist
     1800    COMPILE_ASSERT((sizeof(ArgList) & 0x7) == 0, ArgList_should_by_8byte_aligned);
     1801    subPtr(Imm32(sizeof(ArgList)), stackPointerRegister);
     1802
     1803    // Set up arguments
     1804    subPtr(Imm32(1), regT0); // Don't include 'this' in argcount
     1805
     1806    // Push argcount
     1807    storePtr(regT0, Address(stackPointerRegister, OBJECT_OFFSETOF(ArgList, m_argCount)));
     1808
     1809    // Calculate the start of the callframe header, and store in regT1
     1810    move(callFrameRegister, regT1);
     1811    sub32(Imm32(RegisterFile::CallFrameHeaderSize * (int32_t)sizeof(Register)), regT1);
     1812
     1813    // Calculate start of arguments as callframe header - sizeof(Register) * argcount (regT1)
     1814    mul32(Imm32(sizeof(Register)), regT0, regT0);
     1815    subPtr(regT0, regT1);
     1816
     1817    // push pointer to arguments
     1818    storePtr(regT1, Address(stackPointerRegister, OBJECT_OFFSETOF(ArgList, m_args)));
     1819
     1820    // Setup arg3: regT1 currently points to the first argument, regT1-sizeof(Register) points to 'this'
     1821    loadPtr(Address(regT1, -(int32_t)sizeof(Register)), regT2);
     1822
     1823    // Setup arg2:
     1824    emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, regT1);
     1825
     1826    // Setup arg1:
     1827    move(callFrameRegister, regT0);
     1828
     1829    // Setup arg4: This is a plain hack
     1830    move(stackPointerRegister, ARM::S0);
     1831
     1832    move(ctiReturnRegister, ARM::lr);
     1833    call(Address(regT1, OBJECT_OFFSETOF(JSFunction, m_data)));
     1834
     1835    addPtr(Imm32(sizeof(ArgList)), stackPointerRegister);
     1836
    17961837#elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
    17971838#error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."
     
    18411882    patchBuffer.link(string_failureCases3Call, FunctionPtr(cti_op_get_by_id_string_fail));
    18421883#endif
     1884#if ENABLE(JIT_OPTIMIZE_CALL)
    18431885    patchBuffer.link(callArityCheck1, FunctionPtr(cti_op_call_arityCheck));
    18441886    patchBuffer.link(callArityCheck2, FunctionPtr(cti_op_call_arityCheck));
    1845     patchBuffer.link(callArityCheck3, FunctionPtr(cti_op_call_arityCheck));
    18461887    patchBuffer.link(callJSFunction1, FunctionPtr(cti_op_call_JSFunction));
    18471888    patchBuffer.link(callJSFunction2, FunctionPtr(cti_op_call_JSFunction));
    1848     patchBuffer.link(callJSFunction3, FunctionPtr(cti_op_call_JSFunction));
    18491889    patchBuffer.link(callDontLazyLinkCall, FunctionPtr(cti_vm_dontLazyLinkCall));
    18501890    patchBuffer.link(callLazyLinkCall, FunctionPtr(cti_vm_lazyLinkCall));
     1891#endif
     1892    patchBuffer.link(callArityCheck3, FunctionPtr(cti_op_call_arityCheck));
     1893    patchBuffer.link(callJSFunction3, FunctionPtr(cti_op_call_JSFunction));
    18511894
    18521895    CodeRef finalCode = patchBuffer.finalizeCode();
Note: See TracChangeset for help on using the changeset viewer.