Changeset 39020 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Dec 4, 2008, 10:58:40 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoff Garen.

Start porting the JIT to use the MacroAssembler.

https://bugs.webkit.org/show_bug.cgi?id=22671
No change in performance.

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc): (JSC::MacroAssembler::add32): (JSC::MacroAssembler::and32): (JSC::MacroAssembler::lshift32): (JSC::MacroAssembler::rshift32): (JSC::MacroAssembler::storePtr): (JSC::MacroAssembler::store32): (JSC::MacroAssembler::poke): (JSC::MacroAssembler::move): (JSC::MacroAssembler::compareImm32ForBranchEquality): (JSC::MacroAssembler::jnePtr): (JSC::MacroAssembler::jnset32): (JSC::MacroAssembler::jset32): (JSC::MacroAssembler::jzeroSub32): (JSC::MacroAssembler::joverAdd32): (JSC::MacroAssembler::call):
  • assembler/X86Assembler.h: (JSC::X86Assembler::shll_i8r):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileBinaryArithOp):
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetVirtualRegister): (JSC::JIT::emitPutCTIArg): (JSC::JIT::emitPutCTIArgConstant): (JSC::JIT::emitGetCTIArg): (JSC::JIT::emitPutCTIArgFromVirtualRegister): (JSC::JIT::emitPutCTIParam): (JSC::JIT::emitGetCTIParam): (JSC::JIT::emitPutToCallFrameHeader): (JSC::JIT::emitPutImmediateToCallFrameHeader): (JSC::JIT::emitGetFromCallFrameHeader): (JSC::JIT::emitPutVirtualRegister): (JSC::JIT::emitInitRegister): (JSC::JIT::emitNakedCall): (JSC::JIT::restoreArgumentReference): (JSC::JIT::restoreArgumentReferenceForTrampoline): (JSC::JIT::emitCTICall): (JSC::JIT::checkStructure): (JSC::JIT::emitJumpSlowCaseIfNotJSCell): (JSC::JIT::emitJumpSlowCaseIfNotImmNum): (JSC::JIT::emitJumpSlowCaseIfNotImmNums): (JSC::JIT::emitFastArithDeTagImmediate): (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero): (JSC::JIT::emitFastArithReTagImmediate): (JSC::JIT::emitFastArithPotentiallyReTagImmediate): (JSC::JIT::emitFastArithImmToInt): (JSC::JIT::emitFastArithIntToImmOrSlowCase): (JSC::JIT::emitFastArithIntToImmNoCheck): (JSC::JIT::emitTagAsBoolImmediate):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition):
File:
1 edited

Legend:

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

    r38992 r39020  
    566566            int skip = instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain;
    567567
    568             emitGetVirtualRegister(RegisterFile::ScopeChain, X86::eax, i);
     568            emitGetFromCallFrameHeader(RegisterFile::ScopeChain, X86::eax);
    569569            while (skip--)
    570570                __ movl_mr(FIELD_OFFSET(ScopeChainNode, next), X86::eax, X86::eax);
     
    579579            int skip = instruction[i + 2].u.operand + m_codeBlock->needsFullScopeChain;
    580580
    581             emitGetVirtualRegister(RegisterFile::ScopeChain, X86::edx, i);
     581            emitGetFromCallFrameHeader(RegisterFile::ScopeChain, X86::edx);
    582582            emitGetVirtualRegister(instruction[i + 3].u.operand, X86::eax, i);
    583583            while (skip--)
     
    609609
    610610            // Grab the return address.
    611             emitGetVirtualRegister(RegisterFile::ReturnPC, X86::edx, i);
     611            emitGetFromCallFrameHeader(RegisterFile::ReturnPC, X86::edx);
    612612
    613613            // Restore our caller's "r".
    614             emitGetVirtualRegister(RegisterFile::CallerFrame, X86::edi, i);
     614            emitGetFromCallFrameHeader(RegisterFile::CallerFrame, X86::edi);
    615615
    616616            // Return.
     
    948948        case op_eq: {
    949949            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    950             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     950            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    951951            __ cmpl_rr(X86::edx, X86::eax);
    952952            __ sete_r(X86::eax);
     
    10721072        case op_neq: {
    10731073            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    1074             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     1074            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    10751075            __ cmpl_rr(X86::eax, X86::edx);
    10761076
     
    10991099        case op_bitxor: {
    11001100            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    1101             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     1101            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    11021102            __ xorl_rr(X86::edx, X86::eax);
    11031103            emitFastArithReTagImmediate(X86::eax);
     
    11161116        case op_bitor: {
    11171117            emitGetVirtualRegisters(instruction[i + 2].u.operand, X86::eax, instruction[i + 3].u.operand, X86::edx, i);
    1118             emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, i);
     1118            emitJumpSlowCaseIfNotImmNums(X86::eax, X86::edx, X86::ecx, i);
    11191119            __ orl_rr(X86::edx, X86::eax);
    11201120            emitPutVirtualRegister(instruction[i + 1].u.operand);
     
    20062006    if (m_codeBlock->codeType == FunctionCode) {
    20072007        // In the case of a fast linked call, we do not set this up in the caller.
    2008         __ movl_i32m(reinterpret_cast<unsigned>(m_codeBlock), RegisterFile::CodeBlock * static_cast<int>(sizeof(Register)), X86::edi);
     2008        emitPutImmediateToCallFrameHeader(m_codeBlock, RegisterFile::CodeBlock);
    20092009
    20102010        emitGetCTIParam(CTI_ARGS_registerFile, X86::eax);
     
    21412141    JmpSrc hasCodeBlock1 = __ jne();
    21422142    __ popl_r(X86::ebx);
    2143     __ restoreArgumentReference();
     2143    restoreArgumentReference();
    21442144    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21452145    JmpSrc callJSFunction1 = __ call();
     
    21552155    emitPutCTIArg(X86::ebx, 4);
    21562156    emitPutCTIArg(X86::eax, 12);
    2157     __ restoreArgumentReference();
     2157    restoreArgumentReference();
    21582158    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21592159    JmpSrc callArityCheck1 = __ call();
     
    21682168    __ popl_r(X86::ebx);
    21692169    emitPutCTIArg(X86::ebx, 4);
    2170     __ restoreArgumentReference();
     2170    restoreArgumentReference();
    21712171    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21722172    JmpSrc callDontLazyLinkCall = __ call();
     
    21832183    JmpSrc hasCodeBlock2 = __ jne();
    21842184    __ popl_r(X86::ebx);
    2185     __ restoreArgumentReference();
     2185    restoreArgumentReference();
    21862186    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21872187    JmpSrc callJSFunction2 = __ call();
     
    21972197    emitPutCTIArg(X86::ebx, 4);
    21982198    emitPutCTIArg(X86::eax, 12);
    2199     __ restoreArgumentReference();
     2199    restoreArgumentReference();
    22002200    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    22012201    JmpSrc callArityCheck2 = __ call();
     
    22102210    __ popl_r(X86::ebx);
    22112211    emitPutCTIArg(X86::ebx, 4);
    2212     __ restoreArgumentReference();
     2212    restoreArgumentReference();
    22132213    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    22142214    JmpSrc callLazyLinkCall = __ call();
     
    22252225    JmpSrc hasCodeBlock3 = __ jne();
    22262226    __ popl_r(X86::ebx);
    2227     __ restoreArgumentReference();
     2227    restoreArgumentReference();
    22282228    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    22292229    JmpSrc callJSFunction3 = __ call();
     
    22392239    emitPutCTIArg(X86::ebx, 4);
    22402240    emitPutCTIArg(X86::eax, 12);
    2241     __ restoreArgumentReference();
     2241    restoreArgumentReference();
    22422242    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    22432243    JmpSrc callArityCheck3 = __ call();
Note: See TracChangeset for help on using the changeset viewer.