Changeset 39284 in webkit for trunk/JavaScriptCore/jit


Ignore:
Timestamp:
Dec 13, 2008, 3:58:58 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-13 Gavin Barraclough <[email protected]>

Reviewed by Cameron Zwarich.

Port the remainder of the JIT, bar calling convention related code, and code
implementing optimizations which can be disabled, to use the MacroAssembler.

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr): (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer): (JSC::MacroAssembler::RepatchBuffer::link): (JSC::MacroAssembler::RepatchBuffer::addressOf): (JSC::MacroAssembler::RepatchBuffer::setPtr): (JSC::MacroAssembler::addPtr): (JSC::MacroAssembler::lshift32): (JSC::MacroAssembler::mod32): (JSC::MacroAssembler::rshift32): (JSC::MacroAssembler::storePtrWithRepatch): (JSC::MacroAssembler::jnzPtr): (JSC::MacroAssembler::jzPtr): (JSC::MacroAssembler::jump): (JSC::MacroAssembler::label):
  • assembler/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::xchgl_rr): (JSC::X86Assembler::jmp_m): (JSC::X86Assembler::repatchAddress): (JSC::X86Assembler::getRelocatedAddress):
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock):
  • bytecode/CodeBlock.h: (JSC::JITCodeRef::JITCodeRef): (JSC::CodeBlock::setJITCode): (JSC::CodeBlock::jitCode): (JSC::CodeBlock::executablePool):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileLinkPass): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h: (JSC::CallRecord::CallRecord): (JSC::JumpTable::JumpTable): (JSC::JIT::emitCTICall): (JSC::JIT::JSRInfo::JSRInfo):
  • jit/JITArithmetic.cpp:
  • jit/JITCall.cpp:
  • jit/JITInlineMethods.h: (JSC::JIT::emitNakedCall): (JSC::JIT::emitCTICall_internal): (JSC::JIT::checkStructure): (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): (JSC::JIT::addSlowCase): (JSC::JIT::addJump): (JSC::JIT::emitJumpSlowToHot):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
Location:
trunk/JavaScriptCore/jit
Files:
6 edited

Legend:

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

    r39268 r39284  
    4141#endif
    4242
     43#define __ m_assembler.
     44
    4345using namespace std;
    4446
     
    237239#endif
    238240
    239         m_labels[m_bytecodeIndex] = __ label();
     241        m_labels[m_bytecodeIndex] = label();
    240242        OpcodeID opcodeID = m_interpreter->getOpcodeID(currentInstruction->u.opcode);
    241243
     
    278280                emitCTICall(Interpreter::cti_op_end);
    279281            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    280             __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi);
     282            __ pushl_m(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), callFrameRegister);
    281283            __ ret();
    282284            NEXT_OPCODE(op_end);
     
    514516
    515517            // Restore our caller's "r".
    516             emitGetFromCallFrameHeader(RegisterFile::CallerFrame, X86::edi);
     518            emitGetFromCallFrameHeader(RegisterFile::CallerFrame, callFrameRegister);
    517519
    518520            // Return.
     
    768770            int retAddrDst = currentInstruction[1].u.operand;
    769771            int target = currentInstruction[2].u.operand;
    770             __ movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi);
    771             JmpDst addrPosition = __ label();
    772             addJump(__ jmp(), target + 2);
    773             JmpDst sretTarget = __ label();
    774             m_jsrSites.append(JSRInfo(addrPosition, sretTarget));
     772            DataLabelPtr storeLocation = storePtrWithRepatch(Address(callFrameRegister, sizeof(Register) * retAddrDst));
     773            addJump(jump(), target + 2);
     774            m_jsrSites.append(JSRInfo(storeLocation, label()));
    775775            NEXT_OPCODE(op_jsr);
    776776        }
    777777        case op_sret: {
    778             __ jmp_m(sizeof(Register) * currentInstruction[1].u.operand, X86::edi);
     778            jump(Address(callFrameRegister, sizeof(Register) * currentInstruction[1].u.operand));
    779779            NEXT_OPCODE(op_sret);
    780780        }
     
    793793            emitFastArithImmToInt(X86::eax);
    794794            emitFastArithImmToInt(X86::ecx);
    795             __ shll_CLr(X86::eax);
     795            lshift32(X86::ecx, X86::eax);
    796796            emitFastArithIntToImmOrSlowCase(X86::eax);
    797797            emitPutVirtualRegister(currentInstruction[1].u.operand);
     
    833833                emitJumpSlowCaseIfNotImmNum(X86::ecx);
    834834                emitFastArithImmToInt(X86::ecx);
    835                 __ sarl_CLr(X86::eax);
     835                rshift32(X86::ecx, X86::eax);
    836836            }
    837837            emitFastArithPotentiallyReTagImmediate(X86::eax);
     
    867867            emitFastArithDeTagImmediate(X86::eax);
    868868            addSlowCase(emitFastArithDeTagImmediateJumpIfZero(X86::ecx));
    869             __ cdq();
    870             __ idivl_r(X86::ecx);
     869            mod32(X86::ecx, X86::eax, X86::edx);
    871870            emitFastArithReTagImmediate(X86::edx);
    872871            move(X86::edx, X86::eax);
     
    10061005        }
    10071006        case op_catch: {
    1008             emitGetCTIParam(CTI_ARGS_callFrame, X86::edi); // edi := r
     1007            emitGetCTIParam(CTI_ARGS_callFrame, callFrameRegister);
    10091008            emitPutVirtualRegister(currentInstruction[1].u.operand);
    10101009            NEXT_OPCODE(op_catch);
     
    12001199        case op_profile_will_call: {
    12011200            emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax);
    1202             __ cmpl_i32m(0, X86::eax);
    1203             JmpSrc noProfiler = __ je();
     1201            Jump noProfiler = jzPtr(Address(X86::eax));
    12041202            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax);
    12051203            emitCTICall(Interpreter::cti_op_profile_will_call);
    1206             __ link(noProfiler, __ label());
     1204            noProfiler.link(this);
    12071205
    12081206            NEXT_OPCODE(op_profile_will_call);
     
    12101208        case op_profile_did_call: {
    12111209            emitGetCTIParam(CTI_ARGS_profilerReference, X86::eax);
    1212             __ cmpl_i32m(0, X86::eax);
    1213             JmpSrc noProfiler = __ je();
     1210            Jump noProfiler = jzPtr(Address(X86::eax));
    12141211            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax);
    12151212            emitCTICall(Interpreter::cti_op_profile_did_call);
    1216             __ link(noProfiler, __ label());
     1213            noProfiler.link(this);
    12171214
    12181215            NEXT_OPCODE(op_profile_did_call);
     
    12471244    unsigned jmpTableCount = m_jmpTable.size();
    12481245    for (unsigned i = 0; i < jmpTableCount; ++i)
    1249         __ link(m_jmpTable[i].from, m_labels[m_jmpTable[i].to]);
     1246        m_jmpTable[i].from.linkTo(m_labels[m_jmpTable[i].toBytecodeIndex], this);
    12501247    m_jmpTable.clear();
    12511248}
     
    17381735
    17391736        emitGetCTIParam(CTI_ARGS_registerFile, X86::eax);
    1740         __ leal_mr(m_codeBlock->m_numCalleeRegisters * sizeof(Register), X86::edi, X86::edx);
     1737        addPtr(Imm32(m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, X86::edx);
     1738       
    17411739        slowRegisterFileCheck = jg32(X86::edx, Address(X86::eax, FIELD_OFFSET(RegisterFile, m_end)));
    1742         afterRegisterFileCheck = MacroAssembler::Label(this);
     1740        afterRegisterFileCheck = label();
    17431741    }
    17441742
     
    17601758    ASSERT(m_jmpTable.isEmpty());
    17611759
    1762     RefPtr<ExecutablePool> allocator = m_globalData->poolForSize(__ size());
    1763     m_codeBlock->setExecutablePool(allocator.get());
    1764     void* code = __ executableCopy(allocator.get());
     1760    RefPtr<ExecutablePool> allocator = m_globalData->poolForSize(m_assembler.size());
     1761    void* code = m_assembler.executableCopy(allocator.get());
     1762    JITCodeRef codeRef(code, allocator);
     1763 
     1764    RepatchBuffer repatchBuffer(code);
    17651765
    17661766    // Translate vPC offsets into addresses in JIT generated code, for switch tables.
     
    17731773            ASSERT(record.jumpTable.simpleJumpTable->branchOffsets.size() == record.jumpTable.simpleJumpTable->ctiOffsets.size());
    17741774
    1775             record.jumpTable.simpleJumpTable->ctiDefault = __ getRelocatedAddress(code, m_labels[bytecodeIndex + 3 + record.defaultOffset]);
     1775            record.jumpTable.simpleJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);
    17761776
    17771777            for (unsigned j = 0; j < record.jumpTable.simpleJumpTable->branchOffsets.size(); ++j) {
    17781778                unsigned offset = record.jumpTable.simpleJumpTable->branchOffsets[j];
    1779                 record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? __ getRelocatedAddress(code, m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
     1779                record.jumpTable.simpleJumpTable->ctiOffsets[j] = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.simpleJumpTable->ctiDefault;
    17801780            }
    17811781        } else {
    17821782            ASSERT(record.type == SwitchRecord::String);
    17831783
    1784             record.jumpTable.stringJumpTable->ctiDefault = __ getRelocatedAddress(code, m_labels[bytecodeIndex + 3 + record.defaultOffset]);
     1784            record.jumpTable.stringJumpTable->ctiDefault = repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + record.defaultOffset]);
    17851785
    17861786            StringJumpTable::StringOffsetTable::iterator end = record.jumpTable.stringJumpTable->offsetTable.end();           
    17871787            for (StringJumpTable::StringOffsetTable::iterator it = record.jumpTable.stringJumpTable->offsetTable.begin(); it != end; ++it) {
    17881788                unsigned offset = it->second.branchOffset;
    1789                 it->second.ctiOffset = offset ? __ getRelocatedAddress(code, m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
     1789                it->second.ctiOffset = offset ? repatchBuffer.addressOf(m_labels[bytecodeIndex + 3 + offset]) : record.jumpTable.stringJumpTable->ctiDefault;
    17901790            }
    17911791        }
     
    17941794    for (size_t i = 0; i < m_codeBlock->numberOfExceptionHandlers(); ++i) {
    17951795        HandlerInfo& handler = m_codeBlock->exceptionHandler(i);
    1796         handler.nativeCode = __ getRelocatedAddress(code, m_labels[handler.target]);
     1796        handler.nativeCode = repatchBuffer.addressOf(m_labels[handler.target]);
    17971797    }
    17981798
     
    18001800    for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
    18011801        if (iter->to)
    1802             X86Assembler::link(code, iter->from, iter->to);
    1803         m_codeBlock->pcVector().append(PC(__ getRelocatedAddress(code, iter->from), iter->bytecodeIndex));
     1802            repatchBuffer.link(iter->from, iter->to);
     1803        m_codeBlock->pcVector().append(PC(repatchBuffer.addressOf(iter->from), iter->bytecodeIndex));
    18041804    }
    18051805
    18061806    // Link absolute addresses for jsr
    18071807    for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter)
    1808         X86Assembler::linkAbsoluteAddress(code, iter->addrPosition, iter->target);
     1808        repatchBuffer.setPtr(iter->storeLocation, repatchBuffer.addressOf(iter->target));
    18091809
    18101810    for (unsigned i = 0; i < m_codeBlock->numberOfStructureStubInfos(); ++i) {
     
    18211821    }
    18221822
    1823     m_codeBlock->setJITCode(code);
     1823    m_codeBlock->setJITCode(codeRef);
    18241824}
    18251825
     
    18291829   
    18301830    // Check eax is an array
    1831     JmpSrc array_failureCases1 = emitJumpIfNotJSCell(X86::eax);
     1831    X86Assembler::JmpSrc array_failureCases1 = emitJumpIfNotJSCell(X86::eax);
    18321832    __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsArrayVptr), X86::eax);
    1833     JmpSrc array_failureCases2 = __ jne();
     1833    X86Assembler::JmpSrc array_failureCases2 = __ jne();
    18341834
    18351835    // Checks out okay! - get the length from the storage
     
    18381838
    18391839    __ cmpl_i32r(JSImmediate::maxImmediateInt, X86::eax);
    1840     JmpSrc array_failureCases3 = __ ja();
     1840    X86Assembler::JmpSrc array_failureCases3 = __ ja();
    18411841
    18421842    __ addl_rr(X86::eax, X86::eax);
     
    18471847    // (2) The second function provides fast property access for string length
    18481848   
    1849     JmpDst stringLengthBegin = __ align(16);
     1849    X86Assembler::JmpDst stringLengthBegin = __ align(16);
    18501850
    18511851    // Check eax is a string
    1852     JmpSrc string_failureCases1 = emitJumpIfNotJSCell(X86::eax);
     1852    X86Assembler::JmpSrc string_failureCases1 = emitJumpIfNotJSCell(X86::eax);
    18531853    __ cmpl_i32m(reinterpret_cast<unsigned>(m_interpreter->m_jsStringVptr), X86::eax);
    1854     JmpSrc string_failureCases2 = __ jne();
     1854    X86Assembler::JmpSrc string_failureCases2 = __ jne();
    18551855
    18561856    // Checks out okay! - get the length from the Ustring.
     
    18591859
    18601860    __ cmpl_i32r(JSImmediate::maxImmediateInt, X86::eax);
    1861     JmpSrc string_failureCases3 = __ ja();
     1861    X86Assembler::JmpSrc string_failureCases3 = __ ja();
    18621862
    18631863    __ addl_rr(X86::eax, X86::eax);
     
    18681868    // (3) Trampolines for the slow cases of op_call / op_call_eval / op_construct.
    18691869   
    1870     JmpDst virtualCallPreLinkBegin = __ align(16);
     1870    X86Assembler::JmpDst virtualCallPreLinkBegin = __ align(16);
    18711871
    18721872    // Load the callee CodeBlock* into eax
     
    18741874    __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);
    18751875    __ testl_rr(X86::eax, X86::eax);
    1876     JmpSrc hasCodeBlock1 = __ jne();
     1876    X86Assembler::JmpSrc hasCodeBlock1 = __ jne();
    18771877    __ popl_r(X86::ebx);
    1878     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1879     JmpSrc callJSFunction1 = __ call();
     1878    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1879    X86Assembler::JmpSrc callJSFunction1 = __ call();
    18801880    emitGetJITStubArg(1, X86::ecx);
    18811881    emitGetJITStubArg(3, X86::edx);
     
    18851885    // Check argCount matches callee arity.
    18861886    __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax);
    1887     JmpSrc arityCheckOkay1 = __ je();
     1887    X86Assembler::JmpSrc arityCheckOkay1 = __ je();
    18881888    __ popl_r(X86::ebx);
    18891889    emitPutJITStubArg(X86::ebx, 2);
    18901890    emitPutJITStubArg(X86::eax, 4);
    1891     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1892     JmpSrc callArityCheck1 = __ call();
    1893     __ movl_rr(X86::edx, X86::edi);
     1891    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1892    X86Assembler::JmpSrc callArityCheck1 = __ call();
     1893    __ movl_rr(X86::edx, callFrameRegister);
    18941894    emitGetJITStubArg(1, X86::ecx);
    18951895    emitGetJITStubArg(3, X86::edx);
     
    19011901    __ popl_r(X86::ebx);
    19021902    emitPutJITStubArg(X86::ebx, 2);
    1903     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1904     JmpSrc callDontLazyLinkCall = __ call();
     1903    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1904    X86Assembler::JmpSrc callDontLazyLinkCall = __ call();
    19051905    __ pushl_r(X86::ebx);
    19061906
    19071907    __ jmp_r(X86::eax);
    19081908
    1909     JmpDst virtualCallLinkBegin = __ align(16);
     1909    X86Assembler::JmpDst virtualCallLinkBegin = __ align(16);
    19101910
    19111911    // Load the callee CodeBlock* into eax
     
    19131913    __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);
    19141914    __ testl_rr(X86::eax, X86::eax);
    1915     JmpSrc hasCodeBlock2 = __ jne();
     1915    X86Assembler::JmpSrc hasCodeBlock2 = __ jne();
    19161916    __ popl_r(X86::ebx);
    1917     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1918     JmpSrc callJSFunction2 = __ call();
     1917    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1918    X86Assembler::JmpSrc callJSFunction2 = __ call();
    19191919    emitGetJITStubArg(1, X86::ecx);
    19201920    emitGetJITStubArg(3, X86::edx);
     
    19241924    // Check argCount matches callee arity.
    19251925    __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax);
    1926     JmpSrc arityCheckOkay2 = __ je();
     1926    X86Assembler::JmpSrc arityCheckOkay2 = __ je();
    19271927    __ popl_r(X86::ebx);
    19281928    emitPutJITStubArg(X86::ebx, 2);
    19291929    emitPutJITStubArg(X86::eax, 4);
    1930     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1931     JmpSrc callArityCheck2 = __ call();
    1932     __ movl_rr(X86::edx, X86::edi);
     1930    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1931    X86Assembler::JmpSrc callArityCheck2 = __ call();
     1932    __ movl_rr(X86::edx, callFrameRegister);
    19331933    emitGetJITStubArg(1, X86::ecx);
    19341934    emitGetJITStubArg(3, X86::edx);
     
    19401940    __ popl_r(X86::ebx);
    19411941    emitPutJITStubArg(X86::ebx, 2);
    1942     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1943     JmpSrc callLazyLinkCall = __ call();
     1942    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1943    X86Assembler::JmpSrc callLazyLinkCall = __ call();
    19441944    __ pushl_r(X86::ebx);
    19451945
    19461946    __ jmp_r(X86::eax);
    19471947
    1948     JmpDst virtualCallBegin = __ align(16);
     1948    X86Assembler::JmpDst virtualCallBegin = __ align(16);
    19491949
    19501950    // Load the callee CodeBlock* into eax
     
    19521952    __ movl_mr(FIELD_OFFSET(FunctionBodyNode, m_code), X86::eax, X86::eax);
    19531953    __ testl_rr(X86::eax, X86::eax);
    1954     JmpSrc hasCodeBlock3 = __ jne();
     1954    X86Assembler::JmpSrc hasCodeBlock3 = __ jne();
    19551955    __ popl_r(X86::ebx);
    1956     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1957     JmpSrc callJSFunction3 = __ call();
     1956    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1957    X86Assembler::JmpSrc callJSFunction3 = __ call();
    19581958    emitGetJITStubArg(1, X86::ecx);
    19591959    emitGetJITStubArg(3, X86::edx);
     
    19631963    // Check argCount matches callee arity.
    19641964    __ cmpl_rm(X86::edx, FIELD_OFFSET(CodeBlock, m_numParameters), X86::eax);
    1965     JmpSrc arityCheckOkay3 = __ je();
     1965    X86Assembler::JmpSrc arityCheckOkay3 = __ je();
    19661966    __ popl_r(X86::ebx);
    19671967    emitPutJITStubArg(X86::ebx, 2);
    19681968    emitPutJITStubArg(X86::eax, 4);
    1969     emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    1970     JmpSrc callArityCheck3 = __ call();
    1971     __ movl_rr(X86::edx, X86::edi);
     1969    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
     1970    X86Assembler::JmpSrc callArityCheck3 = __ call();
     1971    __ movl_rr(X86::edx, callFrameRegister);
    19721972    emitGetJITStubArg(1, X86::ecx);
    19731973    emitGetJITStubArg(3, X86::edx);
  • trunk/JavaScriptCore/jit/JIT.h

    r39268 r39284  
    108108
    109109    struct CallRecord {
    110         X86Assembler::JmpSrc from;
     110        MacroAssembler::Jump from;
    111111        unsigned bytecodeIndex;
    112112        void* to;
     
    116116        }
    117117
    118         CallRecord(X86Assembler::JmpSrc from, unsigned bytecodeIndex, void* to = 0)
     118        CallRecord(MacroAssembler::Jump from, unsigned bytecodeIndex, void* to = 0)
    119119            : from(from)
    120120            , bytecodeIndex(bytecodeIndex)
     
    124124    };
    125125
    126     struct JmpTable {
    127         X86Assembler::JmpSrc from;
    128         unsigned to;
    129        
    130         JmpTable(X86Assembler::JmpSrc f, unsigned t)
     126    struct JumpTable {
     127        MacroAssembler::Jump from;
     128        unsigned toBytecodeIndex;
     129
     130        JumpTable(MacroAssembler::Jump f, unsigned t)
    131131            : from(f)
    132             , to(t)
     132            , toBytecodeIndex(t)
    133133        {
    134134        }
     
    183183
    184184    struct StructureStubCompilationInfo {
    185         typedef X86Assembler::JmpSrc JmpSrc;
    186         typedef X86Assembler::JmpDst JmpDst;
    187 
    188         JmpSrc callReturnLocation;
    189         JmpDst hotPathBegin;
    190         JmpSrc hotPathOther;
    191         JmpDst coldPathOther;
     185        X86Assembler::JmpSrc callReturnLocation;
     186        X86Assembler::JmpDst hotPathBegin;
     187        X86Assembler::JmpSrc hotPathOther;
     188        X86Assembler::JmpDst coldPathOther;
    192189    };
    193190
     
    204201        using MacroAssembler::JumpList;
    205202        using MacroAssembler::Label;
    206 
    207         typedef X86Assembler::RegisterID RegisterID;
    208         typedef X86Assembler::XMMRegisterID XMMRegisterID;
    209         typedef X86Assembler::JmpSrc JmpSrc;
    210         typedef X86Assembler::JmpDst JmpDst;
    211203
    212204        static const RegisterID callFrameRegister = X86::edi;
     
    330322        void privateCompilePatchGetArrayLength(void* returnAddress);
    331323
    332         void addSlowCase(JmpSrc);
    333         void addJump(JmpSrc, int);
    334         void emitJumpSlowToHot(JmpSrc, int);
     324        void addSlowCase(Jump);
     325        void addJump(Jump, int);
     326        void emitJumpSlowToHot(Jump, int);
    335327
    336328        void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex);
     
    346338        enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq };
    347339        void compileOpStrictEq(Instruction* instruction, CompileOpStrictEqType type);
    348         void putDoubleResultToJSNumberCellOrJSImmediate(XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell, XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2);
     340        void putDoubleResultToJSNumberCellOrJSImmediate(X86Assembler::XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, X86Assembler::JmpSrc* wroteJSNumberCell, X86Assembler::XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2);
    349341        void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
    350342        void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
     
    393385        void emitJumpSlowCaseIfNotImmNums(RegisterID, RegisterID, RegisterID);
    394386
    395         JmpSrc checkStructure(RegisterID reg, Structure* structure);
     387        Jump checkStructure(RegisterID reg, Structure* structure);
    396388
    397389        void emitFastArithDeTagImmediate(RegisterID);
    398         JmpSrc emitFastArithDeTagImmediateJumpIfZero(RegisterID);
     390        Jump emitFastArithDeTagImmediateJumpIfZero(RegisterID);
    399391        void emitFastArithReTagImmediate(RegisterID);
    400392        void emitFastArithPotentiallyReTagImmediate(RegisterID);
     
    405397        void emitTagAsBoolImmediate(RegisterID reg);
    406398
    407         JmpSrc emitNakedCall(RegisterID);
    408         JmpSrc emitNakedCall(void* function);
    409         JmpSrc emitCTICall_internal(void*);
    410         JmpSrc emitCTICall(CTIHelper_j helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    411         JmpSrc emitCTICall(CTIHelper_o helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    412         JmpSrc emitCTICall(CTIHelper_p helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    413         JmpSrc emitCTICall(CTIHelper_v helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    414         JmpSrc emitCTICall(CTIHelper_s helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    415         JmpSrc emitCTICall(CTIHelper_b helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    416         JmpSrc emitCTICall(CTIHelper_2 helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     399        Jump emitNakedCall(RegisterID);
     400        Jump emitNakedCall(void* function);
     401        Jump emitCTICall_internal(void*);
     402        Jump emitCTICall(CTIHelper_j helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     403        Jump emitCTICall(CTIHelper_o helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     404        Jump emitCTICall(CTIHelper_p helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     405        Jump emitCTICall(CTIHelper_v helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     406        Jump emitCTICall(CTIHelper_s helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     407        Jump emitCTICall(CTIHelper_b helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
     408        Jump emitCTICall(CTIHelper_2 helper) { return emitCTICall_internal(reinterpret_cast<void*>(helper)); }
    417409
    418410        void emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst);
     
    431423
    432424        Vector<CallRecord> m_calls;
    433         Vector<JmpDst> m_labels;
     425        Vector<Label> m_labels;
    434426        Vector<StructureStubCompilationInfo> m_propertyAccessCompilationInfo;
    435427        Vector<StructureStubCompilationInfo> m_callStructureStubCompilationInfo;
    436         Vector<JmpTable> m_jmpTable;
     428        Vector<JumpTable> m_jmpTable;
    437429
    438430        struct JSRInfo {
    439             JmpDst addrPosition;
    440             JmpDst target;
    441 
    442             JSRInfo(const JmpDst& storeLocation, const JmpDst& targetLocation)
    443                 : addrPosition(storeLocation)
     431            DataLabelPtr storeLocation;
     432            Label target;
     433
     434            JSRInfo(DataLabelPtr storeLocation, Label targetLocation)
     435                : storeLocation(storeLocation)
    444436                , target(targetLocation)
    445437            {
  • trunk/JavaScriptCore/jit/JITArithmetic.cpp

    r39268 r39284  
    4141#endif
    4242
     43#define __ m_assembler.
     44
    4345using namespace std;
    4446
     
    6870
    6971#else
     72
     73typedef X86Assembler::JmpSrc JmpSrc;
     74typedef X86Assembler::JmpDst JmpDst;
     75typedef X86Assembler::XMMRegisterID XMMRegisterID;
    7076
    7177#if PLATFORM(MAC)
  • trunk/JavaScriptCore/jit/JITCall.cpp

    r39268 r39284  
    4141#endif
    4242
     43#define __ m_assembler.
     44
    4345using namespace std;
    4446
     
    192194
    193195#else
     196
     197typedef X86Assembler::JmpSrc JmpSrc;
     198typedef X86Assembler::JmpDst JmpDst;
    194199
    195200static void unreachable()
  • trunk/JavaScriptCore/jit/JITInlineMethods.h

    r39268 r39284  
    3131#if ENABLE(JIT)
    3232
    33 #define __ m_assembler.
    34 
    3533#if PLATFORM(WIN)
    3634#undef FIELD_OFFSET // Fix conflict with winnt.h.
     
    4341
    4442namespace JSC {
    45 
    46 typedef X86Assembler::JmpSrc JmpSrc;
    4743
    4844static ALWAYS_INLINE uintptr_t asInteger(JSValue* value)
     
    190186}
    191187
    192 ALWAYS_INLINE JmpSrc JIT::emitNakedCall(X86::RegisterID r)
    193 {
    194     ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
    195 
    196     JmpSrc nakedCall = call(r);
     188ALWAYS_INLINE JIT::Jump JIT::emitNakedCall(X86::RegisterID r)
     189{
     190    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     191
     192    Jump nakedCall = call(r);
    197193    m_calls.append(CallRecord(nakedCall, m_bytecodeIndex));
    198194    return nakedCall;
    199195}
    200196
    201 ALWAYS_INLINE JmpSrc JIT::emitNakedCall(void* function)
    202 {
    203     ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
    204 
    205     JmpSrc nakedCall = call();
     197ALWAYS_INLINE JIT::Jump JIT::emitNakedCall(void* function)
     198{
     199    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     200
     201    Jump nakedCall = call();
    206202    m_calls.append(CallRecord(nakedCall, m_bytecodeIndex, function));
    207203    return nakedCall;
    208204}
    209205
    210 ALWAYS_INLINE JmpSrc JIT::emitCTICall_internal(void* helper)
     206ALWAYS_INLINE JIT::Jump JIT::emitCTICall_internal(void* helper)
    211207{
    212208    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     
    216212#endif
    217213    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    218     JmpSrc ctiCall = call();
     214    Jump ctiCall = call();
    219215    m_calls.append(CallRecord(ctiCall, m_bytecodeIndex, helper));
    220216#if ENABLE(OPCODE_SAMPLING)
     
    226222}
    227223
    228 ALWAYS_INLINE JmpSrc JIT::checkStructure(RegisterID reg, Structure* structure)
     224ALWAYS_INLINE JIT::Jump JIT::checkStructure(RegisterID reg, Structure* structure)
    229225{
    230226    return jnePtr(Address(reg, FIELD_OFFSET(JSCell, m_structure)), ImmPtr(structure));
     
    286282}
    287283
    288 ALWAYS_INLINE JmpSrc JIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg)
     284ALWAYS_INLINE JIT::Jump JIT::emitFastArithDeTagImmediateJumpIfZero(RegisterID reg)
    289285{
    290286    return jzSub32(Imm32(JSImmediate::TagBitTypeInteger), reg);
     
    324320}
    325321
    326 ALWAYS_INLINE void JIT::addSlowCase(JmpSrc jump)
     322ALWAYS_INLINE void JIT::addSlowCase(Jump jump)
    327323{
    328324    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     
    331327}
    332328
    333 ALWAYS_INLINE void JIT::addJump(JmpSrc jump, int relativeOffset)
    334 {
    335     ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
    336 
    337     m_jmpTable.append(JmpTable(jump, m_bytecodeIndex + relativeOffset));
    338 }
    339 
    340 ALWAYS_INLINE void JIT::emitJumpSlowToHot(JmpSrc jump, int relativeOffset)
    341 {
    342     ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
    343 
    344     __ link(jump, m_labels[m_bytecodeIndex + relativeOffset]);
     329ALWAYS_INLINE void JIT::addJump(Jump jump, int relativeOffset)
     330{
     331    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     332
     333    m_jmpTable.append(JumpTable(jump, m_bytecodeIndex + relativeOffset));
     334}
     335
     336ALWAYS_INLINE void JIT::emitJumpSlowToHot(Jump jump, int relativeOffset)
     337{
     338    ASSERT(m_bytecodeIndex != (unsigned)-1); // This method should only be called during hot/cold path generation, so that m_bytecodeIndex is set.
     339
     340    jump.linkTo(m_labels[m_bytecodeIndex + relativeOffset], this);
    345341}
    346342
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r39268 r39284  
    4141#endif
    4242
     43#define __ m_assembler.
     44
    4345using namespace std;
    4446
    4547namespace JSC {
     48
     49typedef X86Assembler::JmpSrc JmpSrc;
     50typedef X86Assembler::JmpDst JmpDst;
    4651
    4752#if !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
     
    513518
    514519    // Check eax is an object of the right Structure.
    515     bucketsOfFail.append(checkStructure(X86::eax, structure));
     520    JmpSrc baseObjectCheck = checkStructure(X86::eax, structure);
     521    bucketsOfFail.append(baseObjectCheck);
    516522
    517523    Structure* currStructure = structure;
     
    568574
    569575    // Check eax is an object of the right Structure.
    570     bucketsOfFail.append(checkStructure(X86::eax, structure));
     576    JmpSrc baseObjectCheck = checkStructure(X86::eax, structure);
     577    bucketsOfFail.append(baseObjectCheck);
    571578
    572579    Structure* currStructure = structure;
Note: See TracChangeset for help on using the changeset viewer.