Ignore:
Timestamp:
Dec 12, 2008, 7:18:10 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Geoff Garen.

Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.

No impact on performance.

  • jit/JIT.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::emitSlowScriptCheck): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile):
  • jit/JIT.h: (JSC::CallRecord::CallRecord): (JSC::JmpTable::JmpTable): (JSC::JIT::emitCTICall):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileBinaryArithOp): (JSC::JIT::compileBinaryArithOpSlowCase):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::emitGetVirtualRegister): (JSC::JIT::emitGetVirtualRegisters): (JSC::JIT::emitNakedCall): (JSC::JIT::emitCTICall_internal): (JSC::JIT::emitJumpSlowCaseIfJSCell): (JSC::JIT::emitJumpSlowCaseIfNotJSCell): (JSC::JIT::emitJumpSlowCaseIfNotImmNum): (JSC::JIT::emitJumpSlowCaseIfNotImmNums): (JSC::JIT::emitFastArithIntToImmOrSlowCase): (JSC::JIT::addSlowCase): (JSC::JIT::addJump): (JSC::JIT::emitJumpSlowToHot):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compilePutByIdSlowCase):
File:
1 edited

Legend:

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

    r39265 r39266  
    121121#if !ENABLE(JIT_OPTIMIZE_CALL)
    122122
    123 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned i, unsigned)
     123void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned)
    124124{
    125125    int dst = instruction[1].u.operand;
     
    131131    Jump wasEval;
    132132    if (opcodeID == op_call_eval) {
    133         emitGetVirtualRegister(callee, X86::ecx, i);
     133        emitGetVirtualRegister(callee, X86::ecx);
    134134        compileOpCallEvalSetupArgs(instruction);
    135135
    136         emitCTICall(i, Interpreter::cti_op_call_eval);
     136        emitCTICall(Interpreter::cti_op_call_eval);
    137137        wasEval = jnePtr(ImmPtr(JSImmediate::impossibleValue()), X86::eax);
    138138    }
    139139
    140     emitGetVirtualRegister(callee, X86::ecx, i);
     140    emitGetVirtualRegister(callee, X86::ecx);
    141141    // The arguments have been set up on the hot path for op_call_eval
    142142    if (opcodeID == op_call)
     
    146146
    147147    // Check for JSFunctions.
    148     emitJumpSlowCaseIfNotJSCell(X86::ecx, i);
    149     m_slowCases.append(SlowCaseEntry(jnePtr(X86::ecx, ImmPtr(m_interpreter->m_jsFunctionVptr)), i));
     148    emitJumpSlowCaseIfNotJSCell(X86::ecx);
     149    addSlowCase(jnePtr(X86::ecx, ImmPtr(m_interpreter->m_jsFunctionVptr)));
    150150
    151151    // First, in the case of a construct, allocate the new object.
    152152    if (opcodeID == op_construct) {
    153         emitCTICall(i, Interpreter::cti_op_construct_JSConstruct);
     153        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
    154154        emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
    155         emitGetVirtualRegister(callee, X86::ecx, i);
     155        emitGetVirtualRegister(callee, X86::ecx);
    156156    }
    157157
     
    161161    move(Imm32(argCount), X86::edx);
    162162
    163     emitNakedCall(i, m_interpreter->m_ctiVirtualCall);
     163    emitNakedCall(m_interpreter->m_ctiVirtualCall);
    164164
    165165    if (opcodeID == op_call_eval)
     
    174174}
    175175
    176 void JIT::compileOpCallSlowCase(Instruction* instruction, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned, OpcodeID opcodeID)
     176void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned, OpcodeID opcodeID)
    177177{
    178178    int dst = instruction[1].u.operand;
     
    182182
    183183    // This handles host functions
    184     emitCTICall(i, ((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
     184    emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
    185185    // Put the return value in dst. In the interpreter, op_ret does this.
    186186    emitPutVirtualRegister(dst);
     
    199199}
    200200
    201 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned i, unsigned callLinkInfoIndex)
     201void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned callLinkInfoIndex)
    202202{
    203203    int dst = instruction[1].u.operand;
     
    209209    JmpSrc wasEval;
    210210    if (opcodeID == op_call_eval) {
    211         emitGetVirtualRegister(callee, X86::ecx, i);
     211        emitGetVirtualRegister(callee, X86::ecx);
    212212        compileOpCallEvalSetupArgs(instruction);
    213213
    214         emitCTICall(i, Interpreter::cti_op_call_eval);
     214        emitCTICall(Interpreter::cti_op_call_eval);
    215215        __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::eax);
    216216        wasEval = __ jne();
     
    219219    // This plants a check for a cached JSFunction value, so we can plant a fast link to the callee.
    220220    // This deliberately leaves the callee in ecx, used when setting up the stack frame below
    221     emitGetVirtualRegister(callee, X86::ecx, i);
     221    emitGetVirtualRegister(callee, X86::ecx);
    222222    __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::ecx);
    223223    JmpDst addressOfLinkedFunctionCheck = __ label();
    224     m_slowCases.append(SlowCaseEntry(__ jne(), i));
     224    addSlowCase(__ jne());
    225225    ASSERT(X86Assembler::getDifferenceBetweenLabels(addressOfLinkedFunctionCheck, __ label()) == repatchOffsetOpCallCall);
    226226    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck;
     
    235235        emitPutCTIArg(X86::ecx, 0);
    236236        emitPutCTIArgFromVirtualRegister(proto, 12, X86::eax);
    237         emitCTICall(i, Interpreter::cti_op_construct_JSConstruct);
     237        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
    238238        emitPutVirtualRegister(thisRegister);
    239         emitGetVirtualRegister(callee, X86::ecx, i);
     239        emitGetVirtualRegister(callee, X86::ecx);
    240240    }
    241241
     
    251251
    252252    // Call to the callee
    253     m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(i, reinterpret_cast<void*>(unreachable));
     253    m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(reinterpret_cast<void*>(unreachable));
    254254   
    255255    if (opcodeID == op_call_eval)
     
    264264}
    265265
    266 void JIT::compileOpCallSlowCase(Instruction* instruction, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID)
     266void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID)
    267267{
    268268    int dst = instruction[1].u.operand;
     
    287287    // First, in the case of a construct, allocate the new object.
    288288    if (opcodeID == op_construct) {
    289         emitCTICall(i, Interpreter::cti_op_construct_JSConstruct);
     289        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
    290290        emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
    291         emitGetVirtualRegister(callee, X86::ecx, i);
     291        emitGetVirtualRegister(callee, X86::ecx);
    292292    }
    293293
     
    299299
    300300    m_callStructureStubCompilationInfo[callLinkInfoIndex].callReturnLocation =
    301         emitNakedCall(i, m_interpreter->m_ctiVirtualCallPreLink);
     301        emitNakedCall(m_interpreter->m_ctiVirtualCallPreLink);
    302302
    303303    JmpSrc storeResultForFirstRun = __ jmp();
     
    323323    __ link(callLinkFailNotObject, notJSFunctionlabel);
    324324    __ link(callLinkFailNotJSFunction, notJSFunctionlabel);
    325     emitCTICall(i, ((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
     325    emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
    326326    JmpSrc wasNotJSFunction = __ jmp();
    327327
     
    331331    // First, in the case of a construct, allocate the new object.
    332332    if (opcodeID == op_construct) {
    333         emitCTICall(i, Interpreter::cti_op_construct_JSConstruct);
     333        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
    334334        emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
    335         emitGetVirtualRegister(callee, X86::ecx, i);
     335        emitGetVirtualRegister(callee, X86::ecx);
    336336    }
    337337
     
    341341    __ movl_i32r(argCount, X86::edx);
    342342
    343     emitNakedCall(i, m_interpreter->m_ctiVirtualCall);
     343    emitNakedCall(m_interpreter->m_ctiVirtualCall);
    344344
    345345    // Put the return value in dst. In the interpreter, op_ret does this.
Note: See TracChangeset for help on using the changeset viewer.