Changeset 39266 in webkit for trunk/JavaScriptCore/jit/JIT.h


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/JIT.h

    r39265 r39266  
    108108
    109109    struct CallRecord {
    110         typedef X86Assembler::JmpSrc JmpSrc;
    111 
    112         JmpSrc from;
     110        X86Assembler::JmpSrc from;
     111        unsigned bytecodeIndex;
    113112        void* to;
    114         unsigned bytecodeIndex;
    115113
    116114        CallRecord()
     
    118116        }
    119117
    120         CallRecord(JmpSrc f, CTIHelper_j t, unsigned i)
    121             : from(f)
    122             , to(reinterpret_cast<void*>(t))
    123             , bytecodeIndex(i)
    124         {
    125         }
    126 
    127         CallRecord(JmpSrc f, CTIHelper_o t, unsigned i)
    128             : from(f)
    129             , to(reinterpret_cast<void*>(t))
    130             , bytecodeIndex(i)
    131         {
    132         }
    133 
    134         CallRecord(JmpSrc f, CTIHelper_p t, unsigned i)
    135             : from(f)
    136             , to(reinterpret_cast<void*>(t))
    137             , bytecodeIndex(i)
    138         {
    139         }
    140        
    141         CallRecord(JmpSrc f, CTIHelper_v t, unsigned i)
    142             : from(f)
    143             , to(reinterpret_cast<void*>(t))
    144             , bytecodeIndex(i)
    145         {
    146         }
    147        
    148         CallRecord(JmpSrc f, CTIHelper_s t, unsigned i)
    149             : from(f)
    150             , to(reinterpret_cast<void*>(t))
    151             , bytecodeIndex(i)
    152         {
    153         }
    154        
    155         CallRecord(JmpSrc f, CTIHelper_b t, unsigned i)
    156             : from(f)
    157             , to(reinterpret_cast<void*>(t))
    158             , bytecodeIndex(i)
    159         {
    160         }
    161 
    162         CallRecord(JmpSrc f, CTIHelper_2 t, unsigned i)
    163             : from(f)
    164             , to(reinterpret_cast<void*>(t))
    165             , bytecodeIndex(i)
    166         {
    167         }
    168 
    169         CallRecord(JmpSrc f, unsigned i)
    170             : from(f)
    171             , to(0)
    172             , bytecodeIndex(i)
     118        CallRecord(X86Assembler::JmpSrc from, unsigned bytecodeIndex, void* to = 0)
     119            : from(from)
     120            , bytecodeIndex(bytecodeIndex)
     121            , to(to)
    173122        {
    174123        }
     
    176125
    177126    struct JmpTable {
    178         typedef X86Assembler::JmpSrc JmpSrc;
    179 
    180         JmpSrc from;
     127        X86Assembler::JmpSrc from;
    181128        unsigned to;
    182129       
    183         JmpTable(JmpSrc f, unsigned t)
     130        JmpTable(X86Assembler::JmpSrc f, unsigned t)
    184131            : from(f)
    185132            , to(t)
     
    383330        void privateCompilePatchGetArrayLength(void* returnAddress);
    384331
    385         void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned i, unsigned propertyAccessInstructionIndex);
    386         void compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex);
    387         void compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned i, unsigned propertyAccessInstructionIndex);
    388         void compilePutByIdSlowCase(int baseVReg, Identifier* ident, int valueVReg, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex);
    389         void compileOpCall(OpcodeID, Instruction* instruction, unsigned i, unsigned callLinkInfoIndex);
     332        void addSlowCase(JmpSrc);
     333        void addJump(JmpSrc, int);
     334        void emitJumpSlowToHot(JmpSrc, int);
     335
     336        void compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident, unsigned propertyAccessInstructionIndex);
     337        void compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex);
     338        void compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg, unsigned propertyAccessInstructionIndex);
     339        void compilePutByIdSlowCase(int baseVReg, Identifier* ident, int valueVReg, Vector<SlowCaseEntry>::iterator& iter, unsigned propertyAccessInstructionIndex);
     340        void compileOpCall(OpcodeID, Instruction* instruction, unsigned callLinkInfoIndex);
    390341        void compileOpCallInitializeCallFrame();
    391342        void compileOpCallSetupArgs(Instruction*);
    392343        void compileOpCallEvalSetupArgs(Instruction*);
    393         void compileOpCallSlowCase(Instruction* instruction, unsigned i, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID);
     344        void compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID);
    394345        void compileOpConstructSetupArgs(Instruction*);
    395346        enum CompileOpStrictEqType { OpStrictEq, OpNStrictEq };
    396         void compileOpStrictEq(Instruction* instruction, unsigned i, CompileOpStrictEqType type);
    397         void putDoubleResultToJSNumberCellOrJSImmediate(XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell,  XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2);
    398         void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i);
    399         void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi, unsigned i);
    400 
    401         void emitGetVirtualRegister(int src, RegisterID dst, unsigned i);
    402         void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2, unsigned i);
     347        void compileOpStrictEq(Instruction* instruction, CompileOpStrictEqType type);
     348        void putDoubleResultToJSNumberCellOrJSImmediate(XMMRegisterID xmmSource, RegisterID jsNumberCell, unsigned dst, JmpSrc* wroteJSNumberCell, XMMRegisterID tempXmm, RegisterID tempReg1, RegisterID tempReg2);
     349        void compileBinaryArithOp(OpcodeID, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
     350        void compileBinaryArithOpSlowCase(OpcodeID, Vector<SlowCaseEntry>::iterator& iter, unsigned dst, unsigned src1, unsigned src2, OperandTypes opi);
     351
     352        void emitGetVirtualRegister(int src, RegisterID dst);
     353        void emitGetVirtualRegisters(int src1, RegisterID dst1, int src2, RegisterID dst2);
    403354        void emitPutVirtualRegister(unsigned dst, RegisterID from = X86::eax);
    404355
     
    423374
    424375        Jump emitJumpIfJSCell(RegisterID);
    425         void emitJumpSlowCaseIfJSCell(RegisterID, unsigned bytecodeIndex);
     376        void emitJumpSlowCaseIfJSCell(RegisterID);
    426377        Jump emitJumpIfNotJSCell(RegisterID);
    427         void emitJumpSlowCaseIfNotJSCell(RegisterID, unsigned bytecodeIndex);
    428         void emitJumpSlowCaseIfNotJSCell(RegisterID, unsigned bytecodeIndex, int VReg);
     378        void emitJumpSlowCaseIfNotJSCell(RegisterID);
     379        void emitJumpSlowCaseIfNotJSCell(RegisterID, int VReg);
    429380
    430381        Jump getSlowCase(Vector<SlowCaseEntry>::iterator& iter)
     
    439390        void linkSlowCaseIfNotJSCell(Vector<SlowCaseEntry>::iterator&, int vReg);
    440391
    441         void emitJumpSlowCaseIfNotImmNum(RegisterID, unsigned bytecodeIndex);
    442         void emitJumpSlowCaseIfNotImmNums(RegisterID, RegisterID, RegisterID, unsigned bytecodeIndex);
     392        void emitJumpSlowCaseIfNotImmNum(RegisterID);
     393        void emitJumpSlowCaseIfNotImmNums(RegisterID, RegisterID, RegisterID);
    443394
    444395        JmpSrc checkStructure(RegisterID reg, Structure* structure);
     
    449400        void emitFastArithPotentiallyReTagImmediate(RegisterID);
    450401        void emitFastArithImmToInt(RegisterID);
    451         void emitFastArithIntToImmOrSlowCase(RegisterID, unsigned bytecodeIndex);
     402        void emitFastArithIntToImmOrSlowCase(RegisterID);
    452403        void emitFastArithIntToImmNoCheck(RegisterID);
    453404
    454405        void emitTagAsBoolImmediate(RegisterID reg);
    455406
    456         JmpSrc emitNakedCall(unsigned bytecodeIndex, RegisterID);
    457         JmpSrc emitNakedCall(unsigned bytecodeIndex, void* function);
    458         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_j);
    459         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_o);
    460         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_p);
    461         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_v);
    462         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_s);
    463         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_b);
    464         JmpSrc emitCTICall(unsigned bytecodeIndex, CTIHelper_2);
     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)); }
    465417
    466418        void emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst);
    467419        void emitPutVariableObjectRegister(RegisterID src, RegisterID variableObject, int index);
    468420       
    469         void emitSlowScriptCheck(unsigned bytecodeIndex);
     421        void emitSlowScriptCheck();
    470422#ifndef NDEBUG
    471423        void printBytecodeOperandTypes(unsigned src1, unsigned src2);
     
    495447        };
    496448
     449        unsigned m_bytecodeIndex;
    497450        Vector<JSRInfo> m_jsrSites;
    498451        Vector<SlowCaseEntry> m_slowCases;
Note: See TracChangeset for help on using the changeset viewer.