Ignore:
Timestamp:
May 8, 2009, 1:51:53 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-08 Geoffrey Garen <[email protected]>

Reviewed by Gavin Barraclough.


More abstraction for JITStub calls from JITed code.


Added a JITStubCall class that automatically handles things like assigning
arguments to different stack slots and storing return values. Deployed
the class in about a billion places. A bunch more places remain to be
fixed up, but this is a good stopping point for now.

  • jit/JIT.cpp: (JSC::JIT::emitTimeoutCheck): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile):
  • jit/JIT.h: (JSC::JIT::JSRInfo::JSRInfo): (JSC::JITStubCall::JITStubCall): (JSC::JITStubCall::addArgument): (JSC::JITStubCall::call): (JSC::JITStubCall::): (JSC::CallEvalJITStub::CallEvalJITStub):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArithSlow_op_lshift): (JSC::JIT::compileFastArithSlow_op_rshift): (JSC::JIT::compileFastArithSlow_op_jnless): (JSC::JIT::compileFastArithSlow_op_bitand): (JSC::JIT::compileFastArithSlow_op_mod): (JSC::JIT::compileFastArith_op_mod): (JSC::JIT::compileFastArithSlow_op_post_inc): (JSC::JIT::compileFastArithSlow_op_post_dec): (JSC::JIT::compileFastArithSlow_op_pre_inc): (JSC::JIT::compileFastArithSlow_op_pre_dec): (JSC::JIT::compileFastArith_op_add): (JSC::JIT::compileFastArith_op_mul): (JSC::JIT::compileFastArith_op_sub): (JSC::JIT::compileBinaryArithOpSlowCase): (JSC::JIT::compileFastArithSlow_op_add): (JSC::JIT::compileFastArithSlow_op_mul):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall): (JSC::):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdSlowCase):
  • jit/JITStubs.cpp: (JSC::JITStubs::cti_op_resolve_func): (JSC::JITStubs::cti_op_resolve_with_base):
File:
1 edited

Legend:

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

    r43122 r43409  
    5656    emitGetVirtualRegister(baseVReg, regT0);
    5757
    58     emitPutJITStubArg(regT0, 1);
    59     emitPutJITStubArgConstant(ident, 2);
    60     emitCTICall(JITStubs::cti_op_get_by_id_generic);
    61     emitPutVirtualRegister(resultVReg);
    62 }
    63 
     58    JITStubCall stubCall(this, JITStubs::cti_op_get_by_id_generic);
     59    stubCall.addArgument(regT0);
     60    stubCall.addArgument(ImmPtr(ident));
     61    stubCall.call(resultVReg);
     62}
    6463
    6564void JIT::compileGetByIdSlowCase(int, int, Identifier*, Vector<SlowCaseEntry>::iterator&, unsigned)
     
    7675    emitGetVirtualRegisters(baseVReg, regT0, valueVReg, regT1);
    7776
    78     emitPutJITStubArgConstant(ident, 2);
    79     emitPutJITStubArg(regT0, 1);
    80     emitPutJITStubArg(regT1, 3);
    81     emitCTICall(JITStubs::cti_op_put_by_id_generic);
     77    JITStubCall stubCall(this, JITStubs::cti_op_put_by_id_generic);
     78    stubCall.addArgument(regT0);
     79    stubCall.addArgument(ImmPtr(ident));
     80    stubCall.addArgument(regT1);
     81    stubCall.call(resultVReg);
    8282}
    8383
     
    133133    Label coldPathBegin(this);
    134134#endif
    135     emitPutJITStubArg(regT0, 1);
    136     emitPutJITStubArgConstant(ident, 2);
    137     Call call = emitCTICall(JITStubs::cti_op_get_by_id);
    138     emitPutVirtualRegister(resultVReg);
     135    JITStubCall stubCall(this, JITStubs::cti_op_get_by_id);
     136    stubCall.addArgument(regT0);
     137    stubCall.addArgument(ImmPtr(ident));
     138    Call call = stubCall.call(resultVReg);
    139139
    140140    ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall);
     
    174174    linkSlowCase(iter);
    175175
    176     emitPutJITStubArgConstant(ident, 2);
    177     emitPutJITStubArg(regT0, 1);
    178     emitPutJITStubArg(regT1, 3);
    179     Call call = emitCTICall(JITStubs::cti_op_put_by_id);
     176    JITStubCall stubCall(this, JITStubs::cti_op_put_by_id);
     177    stubCall.addArgument(regT0);
     178    stubCall.addArgument(ImmPtr(ident));
     179    stubCall.addArgument(regT1);
     180    Call call = stubCall.call();
    180181
    181182    // Track the location of the call; this will be used to recover patch information.
Note: See TracChangeset for help on using the changeset viewer.