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/JITPropertyAccess.cpp

    r39261 r39266  
    4747#if !ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
    4848
    49 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned i, unsigned)
     49void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned)
    5050{
    5151    // As for put_by_id, get_by_id requires the offset of the Structure and the offset of the access to be repatched.
     
    5454    // to jump back to if one of these trampolies finds a match.
    5555
    56     emitGetVirtualRegister(baseVReg, X86::eax, i);
     56    emitGetVirtualRegister(baseVReg, X86::eax);
    5757
    5858    emitPutCTIArg(X86::eax, 0);
    5959    emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    60     emitCTICall(i, Interpreter::cti_op_get_by_id_generic);
     60    emitCTICall(Interpreter::cti_op_get_by_id_generic);
    6161    emitPutVirtualRegister(resultVReg);
    6262}
    6363
    6464
    65 void JIT::compileGetByIdSlowCase(int, int, Identifier*, unsigned, Vector<SlowCaseEntry>::iterator&, unsigned)
     65void JIT::compileGetByIdSlowCase(int, int, Identifier*, Vector<SlowCaseEntry>::iterator&, unsigned)
    6666{
    6767    ASSERT_NOT_REACHED();
    6868}
    6969
    70 void JIT::compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned i, unsigned)
     70void JIT::compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned)
    7171{
    7272    // In order to be able to repatch both the Structure, and the object offset, we store one pointer,
     
    7474    // such that the Structure & offset are always at the same distance from this.
    7575
    76     emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx, i);
     76    emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx);
    7777
    7878    emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    7979    emitPutCTIArg(X86::eax, 0);
    8080    emitPutCTIArg(X86::edx, 8);
    81     emitCTICall(i, Interpreter::cti_op_put_by_id_generic);
    82 }
    83 
    84 void JIT::compilePutByIdSlowCase(int, Identifier*, int, unsigned, Vector<SlowCaseEntry>::iterator&, unsigned)
     81    emitCTICall(Interpreter::cti_op_put_by_id_generic);
     82}
     83
     84void JIT::compilePutByIdSlowCase(int, Identifier*, int, Vector<SlowCaseEntry>::iterator&, unsigned)
    8585{
    8686    ASSERT_NOT_REACHED();
     
    8989#else
    9090
    91 void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier*, unsigned i, unsigned propertyAccessInstructionIndex)
     91void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier*, unsigned propertyAccessInstructionIndex)
    9292{
    9393    // As for put_by_id, get_by_id requires the offset of the Structure and the offset of the access to be repatched.
     
    9696    // to jump back to if one of these trampolies finds a match.
    9797
    98     emitGetVirtualRegister(baseVReg, X86::eax, i);
    99 
    100     emitJumpSlowCaseIfNotJSCell(X86::eax, i, baseVReg);
     98    emitGetVirtualRegister(baseVReg, X86::eax);
     99
     100    emitJumpSlowCaseIfNotJSCell(X86::eax, baseVReg);
    101101
    102102    JmpDst hotPathBegin = __ label();
     
    105105    __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax);
    106106    ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdStructure);
    107     m_slowCases.append(SlowCaseEntry(__ jne(), i));
     107    addSlowCase(__ jne());
    108108    ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetGetByIdBranchToSlowCase);
    109109
     
    115115
    116116
    117 void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)
     117void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)
    118118{
    119119    // As for the hot path of get_by_id, above, we ensure that we can use an architecture specific offset
     
    131131    emitPutCTIArg(X86::eax, 0);
    132132    emitPutCTIArgConstant(reinterpret_cast<unsigned>(ident), 4);
    133     JmpSrc call = emitCTICall(i, Interpreter::cti_op_get_by_id);
     133    JmpSrc call = emitCTICall(Interpreter::cti_op_get_by_id);
    134134    ASSERT(X86Assembler::getDifferenceBetweenLabels(coldPathBegin, call) == repatchOffsetGetByIdSlowCaseCall);
    135135    emitPutVirtualRegister(resultVReg);
     
    139139}
    140140
    141 void JIT::compilePutByIdHotPath(int baseVReg, Identifier*, int valueVReg, unsigned i, unsigned propertyAccessInstructionIndex)
     141void JIT::compilePutByIdHotPath(int baseVReg, Identifier*, int valueVReg, unsigned propertyAccessInstructionIndex)
    142142{
    143143    // In order to be able to repatch both the Structure, and the object offset, we store one pointer,
     
    145145    // such that the Structure & offset are always at the same distance from this.
    146146
    147     emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx, i);
     147    emitGetVirtualRegisters(baseVReg, X86::eax, valueVReg, X86::edx);
    148148
    149149    // Jump to a slow case if either the base object is an immediate, or if the Structure does not match.
    150     emitJumpSlowCaseIfNotJSCell(X86::eax, i, baseVReg);
     150    emitJumpSlowCaseIfNotJSCell(X86::eax, baseVReg);
    151151
    152152    JmpDst hotPathBegin = __ label();
     
    156156    __ cmpl_i32m(repatchGetByIdDefaultStructure, FIELD_OFFSET(JSCell, m_structure), X86::eax);
    157157    ASSERT(X86Assembler::getDifferenceBetweenLabels(hotPathBegin, __ label()) == repatchOffsetPutByIdStructure);
    158     m_slowCases.append(SlowCaseEntry(__ jne(), i));
     158    addSlowCase(__ jne());
    159159
    160160    // Plant a load from a bogus ofset in the object's property map; we will patch this later, if it is to be used.
     
    164164}
    165165
    166 void JIT::compilePutByIdSlowCase(int baseVReg, Identifier* ident, int, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)
     166void JIT::compilePutByIdSlowCase(int baseVReg, Identifier* ident, int, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex)
    167167{
    168168    linkSlowCaseIfNotJSCell(iter, baseVReg);
     
    172172    emitPutCTIArg(X86::eax, 0);
    173173    emitPutCTIArg(X86::edx, 8);
    174     JmpSrc call = emitCTICall(i, Interpreter::cti_op_put_by_id);
     174    JmpSrc call = emitCTICall(Interpreter::cti_op_put_by_id);
    175175
    176176    // Track the location of the call; this will be used to recover repatch information.
Note: See TracChangeset for help on using the changeset viewer.