Ignore:
Timestamp:
Feb 22, 2009, 3:26:07 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-02-22 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Next step in splitting JIT functionality out of the Interpreter class:
Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.


Also, moved timeout checking into its own class, located in JSGlobalData,
so both the Interpreter and the JIT could have access to it.

  • JavaScriptCore.exp:
  • JavaScriptCore.pri:
  • JavaScriptCore.scons:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • JavaScriptCoreSources.bkl:
  • interpreter/CallFrame.h:
  • interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::Interpreter::privateExecute):
  • interpreter/Interpreter.h:
  • interpreter/Register.h:
  • jit/JIT.cpp: (JSC::): (JSC::JIT::emitTimeoutCheck): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArithSlow_op_lshift): (JSC::JIT::compileFastArithSlow_op_rshift): (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::compileOpCallSlowCase):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::compileGetByIdSlowCase): (JSC::JIT::compilePutByIdSlowCase): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::patchGetByIdSelf): (JSC::JIT::patchPutByIdReplace): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdSelf): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdChain): (JSC::JIT::privateCompilePutByIdReplace):
  • jit/JITStubs.cpp: (JSC::JITStubs::tryCachePutByID): (JSC::JITStubs::tryCacheGetByID): (JSC::JITStubs::cti_op_convert_this): (JSC::JITStubs::cti_op_end): (JSC::JITStubs::cti_op_add): (JSC::JITStubs::cti_op_pre_inc): (JSC::JITStubs::cti_timeout_check): (JSC::JITStubs::cti_register_file_check): (JSC::JITStubs::cti_op_loop_if_less): (JSC::JITStubs::cti_op_loop_if_lesseq): (JSC::JITStubs::cti_op_new_object): (JSC::JITStubs::cti_op_put_by_id_generic): (JSC::JITStubs::cti_op_get_by_id_generic): (JSC::JITStubs::cti_op_put_by_id): (JSC::JITStubs::cti_op_put_by_id_second): (JSC::JITStubs::cti_op_put_by_id_fail): (JSC::JITStubs::cti_op_get_by_id): (JSC::JITStubs::cti_op_get_by_id_second): (JSC::JITStubs::cti_op_get_by_id_self_fail): (JSC::JITStubs::cti_op_get_by_id_proto_list): (JSC::JITStubs::cti_op_get_by_id_proto_list_full): (JSC::JITStubs::cti_op_get_by_id_proto_fail): (JSC::JITStubs::cti_op_get_by_id_array_fail): (JSC::JITStubs::cti_op_get_by_id_string_fail): (JSC::JITStubs::cti_op_instanceof): (JSC::JITStubs::cti_op_del_by_id): (JSC::JITStubs::cti_op_mul): (JSC::JITStubs::cti_op_new_func): (JSC::JITStubs::cti_op_call_JSFunction): (JSC::JITStubs::cti_op_call_arityCheck): (JSC::JITStubs::cti_vm_dontLazyLinkCall): (JSC::JITStubs::cti_vm_lazyLinkCall): (JSC::JITStubs::cti_op_push_activation): (JSC::JITStubs::cti_op_call_NotJSFunction): (JSC::JITStubs::cti_op_create_arguments): (JSC::JITStubs::cti_op_create_arguments_no_params): (JSC::JITStubs::cti_op_tear_off_activation): (JSC::JITStubs::cti_op_tear_off_arguments): (JSC::JITStubs::cti_op_profile_will_call): (JSC::JITStubs::cti_op_profile_did_call): (JSC::JITStubs::cti_op_ret_scopeChain): (JSC::JITStubs::cti_op_new_array): (JSC::JITStubs::cti_op_resolve): (JSC::JITStubs::cti_op_construct_JSConstruct): (JSC::JITStubs::cti_op_construct_NotJSConstruct): (JSC::JITStubs::cti_op_get_by_val): (JSC::JITStubs::cti_op_get_by_val_byte_array): (JSC::JITStubs::cti_op_resolve_func): (JSC::JITStubs::cti_op_sub): (JSC::JITStubs::cti_op_put_by_val): (JSC::JITStubs::cti_op_put_by_val_array): (JSC::JITStubs::cti_op_put_by_val_byte_array): (JSC::JITStubs::cti_op_lesseq): (JSC::JITStubs::cti_op_loop_if_true): (JSC::JITStubs::cti_op_negate): (JSC::JITStubs::cti_op_resolve_base): (JSC::JITStubs::cti_op_resolve_skip): (JSC::JITStubs::cti_op_resolve_global): (JSC::JITStubs::cti_op_div): (JSC::JITStubs::cti_op_pre_dec): (JSC::JITStubs::cti_op_jless): (JSC::JITStubs::cti_op_not): (JSC::JITStubs::cti_op_jtrue): (JSC::JITStubs::cti_op_post_inc): (JSC::JITStubs::cti_op_eq): (JSC::JITStubs::cti_op_lshift): (JSC::JITStubs::cti_op_bitand): (JSC::JITStubs::cti_op_rshift): (JSC::JITStubs::cti_op_bitnot): (JSC::JITStubs::cti_op_resolve_with_base): (JSC::JITStubs::cti_op_new_func_exp): (JSC::JITStubs::cti_op_mod): (JSC::JITStubs::cti_op_less): (JSC::JITStubs::cti_op_neq): (JSC::JITStubs::cti_op_post_dec): (JSC::JITStubs::cti_op_urshift): (JSC::JITStubs::cti_op_bitxor): (JSC::JITStubs::cti_op_new_regexp): (JSC::JITStubs::cti_op_bitor): (JSC::JITStubs::cti_op_call_eval): (JSC::JITStubs::cti_op_throw): (JSC::JITStubs::cti_op_get_pnames): (JSC::JITStubs::cti_op_next_pname): (JSC::JITStubs::cti_op_push_scope): (JSC::JITStubs::cti_op_pop_scope): (JSC::JITStubs::cti_op_typeof): (JSC::JITStubs::cti_op_is_undefined): (JSC::JITStubs::cti_op_is_boolean): (JSC::JITStubs::cti_op_is_number): (JSC::JITStubs::cti_op_is_string): (JSC::JITStubs::cti_op_is_object): (JSC::JITStubs::cti_op_is_function): (JSC::JITStubs::cti_op_stricteq): (JSC::JITStubs::cti_op_nstricteq): (JSC::JITStubs::cti_op_to_jsnumber): (JSC::JITStubs::cti_op_in): (JSC::JITStubs::cti_op_push_new_scope): (JSC::JITStubs::cti_op_jmp_scopes): (JSC::JITStubs::cti_op_put_by_index): (JSC::JITStubs::cti_op_switch_imm): (JSC::JITStubs::cti_op_switch_char): (JSC::JITStubs::cti_op_switch_string): (JSC::JITStubs::cti_op_del_by_val): (JSC::JITStubs::cti_op_put_getter): (JSC::JITStubs::cti_op_put_setter): (JSC::JITStubs::cti_op_new_error): (JSC::JITStubs::cti_op_debug): (JSC::JITStubs::cti_vm_throw):
  • jit/JITStubs.h: (JSC::):
  • runtime/JSFunction.h:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
  • runtime/JSGlobalData.h:
  • runtime/JSGlobalObject.cpp:
  • runtime/JSGlobalObject.h:
  • runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp. (JSC::TimeoutChecker::TimeoutChecker): (JSC::TimeoutChecker::reset): (JSC::TimeoutChecker::didTimeOut):
  • runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h. (JSC::TimeoutChecker::setTimeoutInterval): (JSC::TimeoutChecker::ticksUntilNextCheck): (JSC::TimeoutChecker::start): (JSC::TimeoutChecker::stop):

WebCore:

2009-02-20 Geoffrey Garen <[email protected]>

Reviewed by Sam Weinig.

Updated for JavaScriptCore changes to timeout checking.

  • bindings/js/JSCustomPositionCallback.cpp: (WebCore::JSCustomPositionCallback::handleEvent):
  • bindings/js/JSCustomPositionErrorCallback.cpp: (WebCore::JSCustomPositionErrorCallback::handleEvent):
  • bindings/js/JSCustomSQLStatementCallback.cpp: (WebCore::JSCustomSQLStatementCallback::handleEvent):
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp: (WebCore::JSCustomSQLStatementErrorCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionCallback.cpp: (WebCore::JSCustomSQLTransactionCallback::handleEvent):
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp: (WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):
  • bindings/js/JSCustomVoidCallback.cpp: (WebCore::JSCustomVoidCallback::handleEvent):
  • bindings/js/JSCustomXPathNSResolver.cpp: (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
  • bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::JSDOMWindowBase): (WebCore::JSDOMWindowBase::commonJSGlobalData):
  • bindings/js/JSEventListener.cpp: (WebCore::JSAbstractEventListener::handleEvent):
  • bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::executeFunctionInContext):
  • bindings/js/ScriptController.cpp: (WebCore::ScriptController::evaluate):
  • bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::evaluate): (WebCore::WorkerScriptController::forbidExecution):
  • bindings/objc/WebScriptObject.mm: (-[WebScriptObject callWebScriptMethod:withArguments:]): (-[WebScriptObject evaluateWebScript:]):
  • bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke): (_NPN_Evaluate): (_NPN_Construct):
  • bridge/jni/jni_jsobject.mm: (JavaJSObject::call): (JavaJSObject::eval):
File:
1 edited

Legend:

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

    r41089 r41126  
    5858    emitPutJITStubArg(regT0, 1);
    5959    emitPutJITStubArgConstant(ident, 2);
    60     emitCTICall(Interpreter::cti_op_get_by_id_generic);
     60    emitCTICall(JITStubs::cti_op_get_by_id_generic);
    6161    emitPutVirtualRegister(resultVReg);
    6262}
     
    7979    emitPutJITStubArg(regT0, 1);
    8080    emitPutJITStubArg(regT1, 3);
    81     emitCTICall(Interpreter::cti_op_put_by_id_generic);
     81    emitCTICall(JITStubs::cti_op_put_by_id_generic);
    8282}
    8383
     
    135135    emitPutJITStubArg(regT0, 1);
    136136    emitPutJITStubArgConstant(ident, 2);
    137     Call call = emitCTICall(Interpreter::cti_op_get_by_id);
     137    Call call = emitCTICall(JITStubs::cti_op_get_by_id);
    138138    emitPutVirtualRegister(resultVReg);
    139139
     
    177177    emitPutJITStubArg(regT0, 1);
    178178    emitPutJITStubArg(regT1, 3);
    179     Call call = emitCTICall(Interpreter::cti_op_put_by_id);
     179    Call call = emitCTICall(JITStubs::cti_op_put_by_id);
    180180
    181181    // Track the location of the call; this will be used to recover patch information.
     
    266266    PatchBuffer patchBuffer(code);
    267267
    268     patchBuffer.link(failureCall, Interpreter::cti_op_put_by_id_fail);
     268    patchBuffer.link(failureCall, JITStubs::cti_op_put_by_id_fail);
    269269
    270270    if (willNeedStorageRealloc)
     
    279279{
    280280    // We don't want to patch more than once - in future go to cti_op_get_by_id_generic.
    281     // Should probably go to Interpreter::cti_op_get_by_id_fail, but that doesn't do anything interesting right now.
    282     returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_self_fail);
     281    // Should probably go to JITStubs::cti_op_get_by_id_fail, but that doesn't do anything interesting right now.
     282    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_self_fail);
    283283
    284284    // Patch the offset into the propoerty map to load from, then patch the Structure to look for.
     
    290290{
    291291    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    292     // Should probably go to Interpreter::cti_op_put_by_id_fail, but that doesn't do anything interesting right now.
    293     returnAddress.relinkCallerToFunction(Interpreter::cti_op_put_by_id_generic);
     292    // Should probably go to JITStubs::cti_op_put_by_id_fail, but that doesn't do anything interesting right now.
     293    returnAddress.relinkCallerToFunction(JITStubs::cti_op_put_by_id_generic);
    294294
    295295    // Patch the offset into the propoerty map to load from, then patch the Structure to look for.
     
    303303
    304304    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    305     returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_array_fail);
     305    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_array_fail);
    306306
    307307    // Check eax is an array
     
    354354    PatchBuffer patchBuffer(code);
    355355
    356     patchBuffer.link(failureCases1Call, Interpreter::cti_op_get_by_id_self_fail);
    357     patchBuffer.link(failureCases2Call, Interpreter::cti_op_get_by_id_self_fail);
     356    patchBuffer.link(failureCases1Call, JITStubs::cti_op_get_by_id_self_fail);
     357    patchBuffer.link(failureCases2Call, JITStubs::cti_op_get_by_id_self_fail);
    358358
    359359    stubInfo->stubRoutine = patchBuffer.entry();
     
    366366#if USE(CTI_REPATCH_PIC)
    367367    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    368     returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_proto_list);
     368    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
    369369
    370370    // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is
     
    432432    PatchBuffer patchBuffer(code);
    433433
    434     patchBuffer.link(failureCases1, Interpreter::cti_op_get_by_id_proto_fail);
    435     patchBuffer.link(failureCases2, Interpreter::cti_op_get_by_id_proto_fail);
    436     patchBuffer.link(failureCases3, Interpreter::cti_op_get_by_id_proto_fail);
     434    patchBuffer.link(failureCases1, JITStubs::cti_op_get_by_id_proto_fail);
     435    patchBuffer.link(failureCases2, JITStubs::cti_op_get_by_id_proto_fail);
     436    patchBuffer.link(failureCases3, JITStubs::cti_op_get_by_id_proto_fail);
    437437
    438438    stubInfo->stubRoutine = patchBuffer.entry();
     
    582582#if USE(CTI_REPATCH_PIC)
    583583    // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
    584     returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_proto_list);
     584    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
    585585
    586586    ASSERT(count);
     
    664664    void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
    665665
    666     patchBuffer.link(bucketsOfFail, Interpreter::cti_op_get_by_id_proto_fail);
     666    patchBuffer.link(bucketsOfFail, JITStubs::cti_op_get_by_id_proto_fail);
    667667
    668668    stubInfo->stubRoutine = patchBuffer.entry();
     
    689689    PatchBuffer patchBuffer(code);
    690690   
    691     patchBuffer.link(failureCases1Call, Interpreter::cti_op_put_by_id_fail);
    692     patchBuffer.link(failureCases2Call, Interpreter::cti_op_put_by_id_fail);
     691    patchBuffer.link(failureCases1Call, JITStubs::cti_op_put_by_id_fail);
     692    patchBuffer.link(failureCases2Call, JITStubs::cti_op_put_by_id_fail);
    693693
    694694    stubInfo->stubRoutine = patchBuffer.entry();
Note: See TracChangeset for help on using the changeset viewer.