JavaScriptCore:
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Feb 2009 23:26:07 +0000 (23:26 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 Feb 2009 23:26:07 +0000 (23:26 +0000)
2009-02-22  Geoffrey Garen  <ggaren@apple.com>

        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  <ggaren@apple.com>

        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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

42 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/JavaScriptCore.pri
JavaScriptCore/JavaScriptCore.scons
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/JavaScriptCoreSources.bkl
JavaScriptCore/interpreter/CallFrame.h
JavaScriptCore/interpreter/Interpreter.cpp
JavaScriptCore/interpreter/Interpreter.h
JavaScriptCore/interpreter/Register.h
JavaScriptCore/jit/JIT.cpp
JavaScriptCore/jit/JIT.h
JavaScriptCore/jit/JITArithmetic.cpp
JavaScriptCore/jit/JITCall.cpp
JavaScriptCore/jit/JITPropertyAccess.cpp
JavaScriptCore/jit/JITStubs.cpp
JavaScriptCore/jit/JITStubs.h
JavaScriptCore/runtime/JSFunction.h
JavaScriptCore/runtime/JSGlobalData.cpp
JavaScriptCore/runtime/JSGlobalData.h
JavaScriptCore/runtime/JSGlobalObject.cpp
JavaScriptCore/runtime/JSGlobalObject.h
JavaScriptCore/runtime/TimeoutChecker.cpp [new file with mode: 0644]
JavaScriptCore/runtime/TimeoutChecker.h [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/JSCustomPositionCallback.cpp
WebCore/bindings/js/JSCustomPositionErrorCallback.cpp
WebCore/bindings/js/JSCustomSQLStatementCallback.cpp
WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp
WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp
WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp
WebCore/bindings/js/JSCustomVoidCallback.cpp
WebCore/bindings/js/JSCustomXPathNSResolver.cpp
WebCore/bindings/js/JSDOMWindowBase.cpp
WebCore/bindings/js/JSEventListener.cpp
WebCore/bindings/js/ScheduledAction.cpp
WebCore/bindings/js/ScriptController.cpp
WebCore/bindings/js/WorkerScriptController.cpp
WebCore/bindings/objc/WebScriptObject.mm
WebCore/bridge/NP_jsobject.cpp
WebCore/bridge/jni/jni_jsobject.mm

index 4e3fc42..8726e82 100644 (file)
@@ -1,3 +1,192 @@
+2009-02-22  Geoffrey Garen  <ggaren@apple.com>
+
+        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):
+
 2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>
 
         Unreviewed build fix after r41100.
index 8bdacf2..23b5919 100644 (file)
@@ -132,15 +132,13 @@ __ZN3JSC13jsOwnedStringEPNS_12JSGlobalDataERKNS_7UStringE
 __ZN3JSC14JSGlobalObject10globalExecEv
 __ZN3JSC14JSGlobalObject12defineGetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectE
 __ZN3JSC14JSGlobalObject12defineSetterEPNS_9ExecStateERKNS_10IdentifierEPNS_8JSObjectE
-__ZN3JSC14JSGlobalObject14setTimeoutTimeEj
-__ZN3JSC14JSGlobalObject16stopTimeoutCheckEv
 __ZN3JSC14JSGlobalObject17putWithAttributesEPNS_9ExecStateERKNS_10IdentifierENS_10JSValuePtrEj
-__ZN3JSC14JSGlobalObject17startTimeoutCheckEv
 __ZN3JSC14JSGlobalObject3putEPNS_9ExecStateERKNS_10IdentifierENS_10JSValuePtrERNS_15PutPropertySlotE
 __ZN3JSC14JSGlobalObject4initEPNS_8JSObjectE
 __ZN3JSC14JSGlobalObject4markEv
 __ZN3JSC14JSGlobalObjectD2Ev
 __ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE
+__ZN3JSC14TimeoutChecker5resetEv
 __ZN3JSC14constructArrayEPNS_9ExecStateERKNS_7ArgListE
 __ZN3JSC15JSWrapperObject4markEv
 __ZN3JSC15toInt32SlowCaseEdRb
index 364af3e..1a4dd15 100644 (file)
@@ -72,6 +72,7 @@ SOURCES += \
     runtime/JSVariableObject.cpp \
     runtime/JSActivation.cpp \
     runtime/JSNotAnObject.cpp \
+    runtime/TimeoutChecker.cpp \
     bytecode/CodeBlock.cpp \
     bytecode/StructureStubInfo.cpp \
     bytecode/JumpTable.cpp \
index 0a81afe..30665cf 100644 (file)
@@ -114,6 +114,7 @@ sources['runtime'] = [
     'runtime/StringPrototype.cpp',
     'runtime/Structure.cpp',
     'runtime/StructureChain.cpp',
+    'runtime/TimeoutChecker.cpp',
     'runtime/UString.cpp',
 ]
 sources['bytecode'] = [
index 9755040..a19b310 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\runtime\TimeoutChecker.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\runtime\TimeoutChecker.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\jit\JITStubs.h"\r
                                >\r
                        </File>\r
index 8eb84c5..9b6a608 100644 (file)
@@ -85,6 +85,8 @@
                1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1482B7E20A43076000517CFC /* JSObjectRef.cpp */; };
                149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; };
                14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */; };
+               14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */; };
+               14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14ABDF600A437FEF00ECCA01 /* JSCallbackObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14ABDF5E0A437FEF00ECCA01 /* JSCallbackObject.cpp */; };
                14B8EC720A5652090062BE54 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
                14BD59C50A3E8F9F00BAF59C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
                149B24FF0D8AF6D1009CB8C7 /* Register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Register.h; sourceTree = "<group>"; };
                14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITStubs.cpp; sourceTree = "<group>"; };
                14A396A60CD2933100B5B4FF /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
+               14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeoutChecker.cpp; sourceTree = "<group>"; };
+               14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeoutChecker.h; sourceTree = "<group>"; };
                14A6581A0F4E36F4000150FD /* JITStubs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubs.h; sourceTree = "<group>"; };
                14ABB36E099C076400E2A24F /* JSValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSValue.h; sourceTree = "<group>"; };
                14ABB454099C2A0F00E2A24F /* JSType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSType.h; sourceTree = "<group>"; };
                                7E4EE7080EBB7963005934AA /* StructureChain.h */,
                                BC9041470EB9250900FE26FA /* StructureTransitionTable.h */,
                                14A396A60CD2933100B5B4FF /* SymbolTable.h */,
+                               14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */,
+                               14A42E3E0F4F60EE00599099 /* TimeoutChecker.h */,
                                5D53726D0E1C546B0021E549 /* Tracing.d */,
                                5D53726E0E1C54880021E549 /* Tracing.h */,
                                6507D2970E871E4A00D7D896 /* TypeInfo.h */,
                                860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */,
                                860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */,
                                86CCEFDE0F413F8900FD7F9E /* JITCode.h in Headers */,
+                               14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                A7A1F7AC0F252B3C00E184E2 /* ByteArray.cpp in Sources */,
                                BC3135650F302FA3003DFD3A /* DebuggerActivation.cpp in Sources */,
                                0B330C270F38C62300692DE3 /* TypeTraits.cpp in Sources */,
+                               14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 8f92682..b3a461b 100644 (file)
@@ -152,6 +152,7 @@ Source files for JSCore.
         bytecode/StructureStubInfo.cpp
         bytecode/JumpTable.cpp
         runtime/ExceptionHelpers.cpp
+        runtime/TimeoutChecker.cpp
         interpreter/Interpreter.cpp
         bytecode/Opcode.cpp
         bytecode/SamplingTool.cpp
index d6b9b79..10d0b99 100644 (file)
@@ -97,6 +97,7 @@ namespace JSC  {
         friend class JSActivation;
         friend class JSGlobalObject;
         friend class Interpreter;
+        friend class JITStubs;
 
         static CallFrame* create(Register* callFrameBase) { return static_cast<CallFrame*>(callFrameBase); }
         Register* registers() { return this; }
index e8e403b..61a236a 100644 (file)
 #include "AssemblerBuffer.h"
 #endif
 
-#if PLATFORM(DARWIN)
-#include <mach/mach.h>
-#endif
-
-#if HAVE(SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-#if PLATFORM(WIN_OS)
-#include <windows.h>
-#endif
-
-#if PLATFORM(QT)
-#include <QDateTime>
-#endif
-
 using namespace std;
 
 namespace JSC {
 
-// Preferred number of milliseconds between each timeout check
-static const int preferredScriptCheckTimeInterval = 1000;
-
 static ALWAYS_INLINE unsigned bytecodeOffsetForPC(CallFrame* callFrame, CodeBlock* codeBlock, void* pc)
 {
 #if ENABLE(JIT)
@@ -374,13 +355,7 @@ Interpreter::Interpreter()
     , m_ctiVirtualCall(0)
 #endif
     , m_reentryDepth(0)
-    , m_timeoutTime(0)
-    , m_timeAtLastCheckTimeout(0)
-    , m_timeExecuting(0)
-    , m_timeoutCheckCount(0)
-    , m_ticksUntilNextTimeoutCheck(initialTickCountThreshold)
 {
-    initTimeout();
     privateExecute(InitializeAndReturn, 0, 0, 0);
     
     // Bizarrely, calling fastMalloc here is faster than allocating space on the stack.
@@ -886,91 +861,6 @@ NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHook
     }
 }
 
-void Interpreter::resetTimeoutCheck()
-{
-    m_ticksUntilNextTimeoutCheck = initialTickCountThreshold;
-    m_timeAtLastCheckTimeout = 0;
-    m_timeExecuting = 0;
-}
-
-// Returns the time the current thread has spent executing, in milliseconds.
-static inline unsigned getCPUTime()
-{
-#if PLATFORM(DARWIN)
-    mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
-    thread_basic_info_data_t info;
-
-    // Get thread information
-    mach_port_t threadPort = mach_thread_self();
-    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
-    mach_port_deallocate(mach_task_self(), threadPort);
-    
-    unsigned time = info.user_time.seconds * 1000 + info.user_time.microseconds / 1000;
-    time += info.system_time.seconds * 1000 + info.system_time.microseconds / 1000;
-    
-    return time;
-#elif HAVE(SYS_TIME_H)
-    // FIXME: This should probably use getrusage with the RUSAGE_THREAD flag.
-    struct timeval tv;
-    gettimeofday(&tv, 0);
-    return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-#elif PLATFORM(QT)
-    QDateTime t = QDateTime::currentDateTime();
-    return t.toTime_t() * 1000 + t.time().msec();
-#elif PLATFORM(WIN_OS)
-    union {
-        FILETIME fileTime;
-        unsigned long long fileTimeAsLong;
-    } userTime, kernelTime;
-    
-    // GetThreadTimes won't accept NULL arguments so we pass these even though
-    // they're not used.
-    FILETIME creationTime, exitTime;
-    
-    GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
-    
-    return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
-#else
-#error Platform does not have getCurrentTime function
-#endif
-}
-
-bool Interpreter::checkTimeout(JSGlobalObject* globalObject)
-{
-    unsigned currentTime = getCPUTime();
-    
-    if (!m_timeAtLastCheckTimeout) {
-        // Suspicious amount of looping in a script -- start timing it
-        m_timeAtLastCheckTimeout = currentTime;
-        return false;
-    }
-    
-    unsigned timeDiff = currentTime - m_timeAtLastCheckTimeout;
-    
-    if (timeDiff == 0)
-        timeDiff = 1;
-    
-    m_timeExecuting += timeDiff;
-    m_timeAtLastCheckTimeout = currentTime;
-    
-    // Adjust the tick threshold so we get the next checkTimeout call in the interval specified in 
-    // preferredScriptCheckTimeInterval
-    m_ticksUntilNextTimeoutCheck = static_cast<unsigned>((static_cast<float>(preferredScriptCheckTimeInterval) / timeDiff) * m_ticksUntilNextTimeoutCheck);
-    // If the new threshold is 0 reset it to the default threshold. This can happen if the timeDiff is higher than the
-    // preferred script check time interval.
-    if (m_ticksUntilNextTimeoutCheck == 0)
-        m_ticksUntilNextTimeoutCheck = initialTickCountThreshold;
-    
-    if (m_timeoutTime && m_timeExecuting > m_timeoutTime) {
-        if (globalObject->shouldInterruptScript())
-            return true;
-        
-        resetTimeoutCheck();
-    }
-    
-    return false;
-}
-
 NEVER_INLINE ScopeChainNode* Interpreter::createExceptionScope(CallFrame* callFrame, const Instruction* vPC)
 {
     int dst = (++vPC)->u.operand;
@@ -1195,7 +1085,7 @@ JSValuePtr Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registe
 
     Instruction* vPC = callFrame->codeBlock()->instructions().begin();
     Profiler** enabledProfilerReference = Profiler::enabledProfilerReference();
-    unsigned tickCount = m_ticksUntilNextTimeoutCheck + 1;
+    unsigned tickCount = globalData->timeoutChecker.ticksUntilNextCheck();
 
 #define CHECK_FOR_EXCEPTION() \
     do { \
@@ -1211,11 +1101,11 @@ JSValuePtr Interpreter::privateExecute(ExecutionFlag flag, RegisterFile* registe
 
 #define CHECK_FOR_TIMEOUT() \
     if (!--tickCount) { \
-        if (checkTimeout(callFrame->dynamicGlobalObject())) { \
+        if (globalData->timeoutChecker.didTimeOut(callFrame)) { \
             exceptionValue = jsNull(); \
             goto vm_throw; \
         } \
-        tickCount = m_ticksUntilNextTimeoutCheck; \
+        tickCount = globalData->timeoutChecker.ticksUntilNextCheck(); \
     }
     
 #if ENABLE(OPCODE_SAMPLING)
index 2c44f91..d18b849 100644 (file)
@@ -53,52 +53,6 @@ namespace JSC {
     class SamplingTool;
     struct HandlerInfo;
 
-#if ENABLE(JIT)
-
-#if USE(JIT_STUB_ARGUMENT_VA_LIST)
-    #define STUB_ARGS void* args, ...
-    #define ARGS (reinterpret_cast<void**>(vl_args) - 1)
-#else // JIT_STUB_ARGUMENT_REGISTER or JIT_STUB_ARGUMENT_STACK
-    #define STUB_ARGS void** args
-    #define ARGS (args)
-#endif
-
-#if USE(JIT_STUB_ARGUMENT_REGISTER)
-    #if PLATFORM(X86_64)
-    #define JIT_STUB
-    #elif COMPILER(MSVC)
-    #define JIT_STUB __fastcall
-    #elif COMPILER(GCC)
-    #define JIT_STUB  __attribute__ ((fastcall))
-    #else
-    #error Need to support register calling convention in this compiler
-    #endif
-#else // JIT_STUB_ARGUMENT_VA_LIST or JIT_STUB_ARGUMENT_STACK
-    #if COMPILER(MSVC)
-    #define JIT_STUB __cdecl
-    #else
-    #define JIT_STUB
-    #endif
-#endif
-
-// The Mac compilers are fine with this, 
-#if PLATFORM(MAC)
-    struct VoidPtrPair {
-        void* first;
-        void* second;
-    };
-#define RETURN_PAIR(a,b) VoidPtrPair pair = { a, b }; return pair
-#else
-    typedef uint64_t VoidPtrPair;
-    union VoidPtrPairValue {
-        struct { void* first; void* second; } s;
-        VoidPtrPair i;
-    };
-#define RETURN_PAIR(a,b) VoidPtrPairValue pair = {{ a, b }}; return pair.i
-#endif
-
-#endif // ENABLE(JIT)
-
     enum DebugHookID {
         WillExecuteProgram,
         DidExecuteProgram,
@@ -112,6 +66,7 @@ namespace JSC {
 
     class Interpreter {
         friend class JIT;
+        friend class JITStubs;
     public:
         Interpreter();
         ~Interpreter();
@@ -150,149 +105,10 @@ namespace JSC {
         void retrieveLastCaller(CallFrame*, int& lineNumber, intptr_t& sourceID, UString& sourceURL, JSValuePtr& function) const;
         
         void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc);
-        void setTimeoutTime(unsigned timeoutTime) { m_timeoutTime = timeoutTime; }
-        
-        void startTimeoutCheck()
-        {
-            if (!m_timeoutCheckCount)
-                resetTimeoutCheck();
-            
-            ++m_timeoutCheckCount;
-        }
         
-        void stopTimeoutCheck()
-        {
-            ASSERT(m_timeoutCheckCount);
-            --m_timeoutCheckCount;
-        }
-
-        inline void initTimeout()
-        {
-            ASSERT(!m_timeoutCheckCount);
-            resetTimeoutCheck();
-            m_timeoutTime = 0;
-            m_timeoutCheckCount = 0;
-        }
-
         void setSampler(SamplingTool* sampler) { m_sampler = sampler; }
         SamplingTool* sampler() { return m_sampler; }
 
-#if ENABLE(JIT)
-
-        static int JIT_STUB cti_timeout_check(STUB_ARGS);
-        static void JIT_STUB cti_register_file_check(STUB_ARGS);
-
-        static JSObject* JIT_STUB cti_op_convert_this(STUB_ARGS);
-        static void JIT_STUB cti_op_end(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_add(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_pre_inc(STUB_ARGS);
-        static int JIT_STUB cti_op_loop_if_less(STUB_ARGS);
-        static int JIT_STUB cti_op_loop_if_lesseq(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_object(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_id(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_id_second(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_id_generic(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_id_fail(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_second(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_generic(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_self_fail(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_list(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_list_full(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_fail(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_array_fail(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_string_fail(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_del_by_id(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_instanceof(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_mul(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_func(STUB_ARGS);
-        static void* JIT_STUB cti_op_call_JSFunction(STUB_ARGS);
-        static VoidPtrPair JIT_STUB cti_op_call_arityCheck(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_call_NotJSFunction(STUB_ARGS);
-        static void JIT_STUB cti_op_create_arguments(STUB_ARGS);
-        static void JIT_STUB cti_op_create_arguments_no_params(STUB_ARGS);
-        static void JIT_STUB cti_op_tear_off_activation(STUB_ARGS);
-        static void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS);
-        static void JIT_STUB cti_op_profile_will_call(STUB_ARGS);
-        static void JIT_STUB cti_op_profile_did_call(STUB_ARGS);
-        static void JIT_STUB cti_op_ret_scopeChain(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_array(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_global(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_construct_JSConstruct(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_construct_NotJSConstruct(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val_byte_array(STUB_ARGS);
-        static VoidPtrPair JIT_STUB cti_op_resolve_func(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_sub(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_val(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_val_array(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_val_byte_array(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_lesseq(STUB_ARGS);
-        static int JIT_STUB cti_op_loop_if_true(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_base(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_negate(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_skip(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_div(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_pre_dec(STUB_ARGS);
-        static int JIT_STUB cti_op_jless(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_not(STUB_ARGS);
-        static int JIT_STUB cti_op_jtrue(STUB_ARGS);
-        static VoidPtrPair JIT_STUB cti_op_post_inc(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_eq(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_lshift(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitand(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_rshift(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitnot(STUB_ARGS);
-        static VoidPtrPair JIT_STUB cti_op_resolve_with_base(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_func_exp(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_mod(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_less(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_neq(STUB_ARGS);
-        static VoidPtrPair JIT_STUB cti_op_post_dec(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_urshift(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitxor(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_regexp(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitor(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_call_eval(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_throw(STUB_ARGS);
-        static JSPropertyNameIterator* JIT_STUB cti_op_get_pnames(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_next_pname(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_push_scope(STUB_ARGS);
-        static void JIT_STUB cti_op_pop_scope(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_typeof(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_undefined(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_boolean(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_number(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_string(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_object(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_function(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_stricteq(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_nstricteq(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_to_jsnumber(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_in(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_push_new_scope(STUB_ARGS);
-        static void JIT_STUB cti_op_jmp_scopes(STUB_ARGS);
-        static void JIT_STUB cti_op_put_by_index(STUB_ARGS);
-        static void* JIT_STUB cti_op_switch_imm(STUB_ARGS);
-        static void* JIT_STUB cti_op_switch_char(STUB_ARGS);
-        static void* JIT_STUB cti_op_switch_string(STUB_ARGS);
-        static JSValueEncodedAsPointer* JIT_STUB cti_op_del_by_val(STUB_ARGS);
-        static void JIT_STUB cti_op_put_getter(STUB_ARGS);
-        static void JIT_STUB cti_op_put_setter(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_new_error(STUB_ARGS);
-        static void JIT_STUB cti_op_debug(STUB_ARGS);
-
-        static JSValueEncodedAsPointer* JIT_STUB cti_vm_throw(STUB_ARGS);
-        static void* JIT_STUB cti_vm_dontLazyLinkCall(STUB_ARGS);
-        static void* JIT_STUB cti_vm_lazyLinkCall(STUB_ARGS);
-        static JSObject* JIT_STUB cti_op_push_activation(STUB_ARGS);
-        
-#endif // ENABLE(JIT)
-
-        // Default number of ticks before a timeout check should be done.
-        static const int initialTickCountThreshold = 1024;
-
         bool isJSArray(JSValuePtr v) { return v.isCell() && v.asCell()->vptr() == m_jsArrayVptr; }
         bool isJSString(JSValuePtr v) { return v.isCell() && v.asCell()->vptr() == m_jsStringVptr; }
         bool isJSByteArray(JSValuePtr v) { return v.isCell() && v.asCell()->vptr() == m_jsByteArrayVptr; }
@@ -325,9 +141,6 @@ namespace JSC {
         void dumpCallFrame(CallFrame*);
         void dumpRegisters(CallFrame*);
 
-        bool checkTimeout(JSGlobalObject*);
-        void resetTimeoutCheck();
-
         void tryCacheGetByID(CallFrame*, CodeBlock*, Instruction*, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot&);
         void uncacheGetByID(CodeBlock*, Instruction* vPC);
         void tryCachePutByID(CallFrame*, CodeBlock*, Instruction*, JSValuePtr baseValue, const PutPropertySlot&);
@@ -335,11 +148,6 @@ namespace JSC {
         
         bool isCallBytecode(Opcode opcode) { return opcode == getOpcode(op_call) || opcode == getOpcode(op_construct) || opcode == getOpcode(op_call_eval); }
 
-#if ENABLE(JIT)
-        void tryCTICacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot&);
-        void tryCTICachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot&);
-#endif
-
         SamplingTool* m_sampler;
 
 #if ENABLE(JIT)
@@ -352,11 +160,6 @@ namespace JSC {
 #endif
 
         int m_reentryDepth;
-        unsigned m_timeoutTime;
-        unsigned m_timeAtLastCheckTimeout;
-        unsigned m_timeExecuting;
-        unsigned m_timeoutCheckCount;
-        unsigned m_ticksUntilNextTimeoutCheck;
 
         RegisterFile m_registerFile;
         
index ff36bbc..5277a0f 100644 (file)
@@ -60,8 +60,9 @@ namespace JSC {
     private:
         friend class ExecState;
         friend class Interpreter;
+        friend class JITStubs;
 
-        // Only CallFrame and Interpreter should use these functions.
+        // Only CallFrame, Interpreter, and JITStubs should use these functions.
 
         Register(intptr_t);
 
index 19ae66e..33b7f40 100644 (file)
@@ -79,14 +79,14 @@ asm(
 ".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
 #if USE(JIT_STUB_ARGUMENT_VA_LIST)
-    "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPvz) "\n"
+    "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPvz) "\n"
 #else
 #if USE(JIT_STUB_ARGUMENT_REGISTER)
     "movl %esp, %ecx" "\n"
 #else // JIT_STUB_ARGUMENT_STACK
     "movl %esp, 0(%esp)" "\n"
 #endif
-    "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPPv) "\n"
+    "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPPv) "\n"
 #endif
     "addl $0x1c, %esp" "\n"
     "popl %ebx" "\n"
@@ -138,7 +138,7 @@ asm(
 SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
 #if USE(JIT_STUB_ARGUMENT_REGISTER)
     "movq %rsp, %rdi" "\n"
-    "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPPv) "\n"
+    "call " SYMBOL_STRING(_ZN3JSC8JITStubs12cti_vm_throwEPPv) "\n"
 #else // JIT_STUB_ARGUMENT_VA_LIST or JIT_STUB_ARGUMENT_STACK
 #error "JIT_STUB_ARGUMENT configuration not supported."
 #endif
@@ -186,7 +186,7 @@ extern "C" {
 #else // JIT_STUB_ARGUMENT_VA_LIST or JIT_STUB_ARGUMENT_STACK
 #error "JIT_STUB_ARGUMENT configuration not supported."
 #endif
-            call JSC::Interpreter::cti_vm_throw;
+            call JSC::JITStubs::cti_vm_throw;
             add esp, 0x1c;
             pop ebx;
             pop edi;
@@ -284,10 +284,10 @@ void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqTy
     emitPutVirtualRegister(dst);
 }
 
-void JIT::emitSlowScriptCheck()
+void JIT::emitTimeoutCheck()
 {
     Jump skipTimeout = branchSub32(NonZero, Imm32(1), timeoutCheckRegister);
-    emitCTICall(Interpreter::cti_timeout_check);
+    emitCTICall(JITStubs::cti_timeout_check);
     move(regT0, timeoutCheckRegister);
     skipTimeout.link(this);
 
@@ -303,7 +303,7 @@ void JIT::emitSlowScriptCheck()
     case name: { \
         emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \
         emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2); \
-        emitCTICall(Interpreter::cti_##name); \
+        emitCTICall(JITStubs::cti_##name); \
         emitPutVirtualRegister(currentInstruction[1].u.operand); \
         NEXT_OPCODE(name); \
     }
@@ -311,7 +311,7 @@ void JIT::emitSlowScriptCheck()
 #define CTI_COMPILE_UNARY_OP(name) \
     case name: { \
         emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2); \
-        emitCTICall(Interpreter::cti_##name); \
+        emitCTICall(JITStubs::cti_##name); \
         emitPutVirtualRegister(currentInstruction[1].u.operand); \
         NEXT_OPCODE(name); \
     }
@@ -348,7 +348,7 @@ void JIT::privateCompileMainPass()
         }
         case op_end: {
             if (m_codeBlock->needsFullScopeChain())
-                emitCTICall(Interpreter::cti_op_end);
+                emitCTICall(JITStubs::cti_op_end);
             ASSERT(returnValueRegister != callFrameRegister);
             emitGetVirtualRegister(currentInstruction[1].u.operand, returnValueRegister);
             push(Address(callFrameRegister, RegisterFile::ReturnPC * static_cast<int>(sizeof(Register))));
@@ -365,14 +365,14 @@ void JIT::privateCompileMainPass()
             NEXT_OPCODE(op_pre_inc);
         }
         case op_loop: {
-            emitSlowScriptCheck();
+            emitTimeoutCheck();
 
             unsigned target = currentInstruction[1].u.operand;
             addJump(jump(), target + 1);
             NEXT_OPCODE(op_end);
         }
         case op_loop_if_less: {
-            emitSlowScriptCheck();
+            emitTimeoutCheck();
 
             unsigned op1 = currentInstruction[1].u.operand;
             unsigned op2 = currentInstruction[2].u.operand;
@@ -395,7 +395,7 @@ void JIT::privateCompileMainPass()
             NEXT_OPCODE(op_loop_if_less);
         }
         case op_loop_if_lesseq: {
-            emitSlowScriptCheck();
+            emitTimeoutCheck();
 
             unsigned op1 = currentInstruction[1].u.operand;
             unsigned op2 = currentInstruction[2].u.operand;
@@ -418,7 +418,7 @@ void JIT::privateCompileMainPass()
             NEXT_OPCODE(op_loop_if_less);
         }
         case op_new_object: {
-            emitCTICall(Interpreter::cti_op_new_object);
+            emitCTICall(JITStubs::cti_op_new_object);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_object);
         }
@@ -485,7 +485,7 @@ void JIT::privateCompileMainPass()
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
             emitPutJITStubArgConstant(ident, 2);
-            emitCTICall(Interpreter::cti_op_del_by_id);
+            emitCTICall(JITStubs::cti_op_del_by_id);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_del_by_id);
         }
@@ -496,7 +496,7 @@ void JIT::privateCompileMainPass()
         case op_new_func: {
             FuncDeclNode* func = m_codeBlock->function(currentInstruction[2].u.operand);
             emitPutJITStubArgConstant(func, 1);
-            emitCTICall(Interpreter::cti_op_new_func);
+            emitCTICall(JITStubs::cti_op_new_func);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_func);
         }
@@ -552,17 +552,17 @@ void JIT::privateCompileMainPass()
         }
         case op_tear_off_activation: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);
-            emitCTICall(Interpreter::cti_op_tear_off_activation);
+            emitCTICall(JITStubs::cti_op_tear_off_activation);
             NEXT_OPCODE(op_tear_off_activation);
         }
         case op_tear_off_arguments: {
-            emitCTICall(Interpreter::cti_op_tear_off_arguments);
+            emitCTICall(JITStubs::cti_op_tear_off_arguments);
             NEXT_OPCODE(op_tear_off_arguments);
         }
         case op_ret: {
             // We could JIT generate the deref, only calling out to C when the refcount hits zero.
             if (m_codeBlock->needsFullScopeChain())
-                emitCTICall(Interpreter::cti_op_ret_scopeChain);
+                emitCTICall(JITStubs::cti_op_ret_scopeChain);
 
             ASSERT(callFrameRegister != regT1);
             ASSERT(regT1 != returnValueRegister);
@@ -586,14 +586,14 @@ void JIT::privateCompileMainPass()
         case op_new_array: {
             emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1);
             emitPutJITStubArgConstant(currentInstruction[3].u.operand, 2);
-            emitCTICall(Interpreter::cti_op_new_array);
+            emitCTICall(JITStubs::cti_op_new_array);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_array);
         }
         case op_resolve: {
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 1);
-            emitCTICall(Interpreter::cti_op_resolve);
+            emitCTICall(JITStubs::cti_op_resolve);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_resolve);
         }
@@ -635,7 +635,7 @@ void JIT::privateCompileMainPass()
         case op_resolve_func: {
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
             emitPutJITStubArgConstant(ident, 1);
-            emitCTICall(Interpreter::cti_op_resolve_func);
+            emitCTICall(JITStubs::cti_op_resolve_func);
             emitPutVirtualRegister(currentInstruction[2].u.operand, regT1);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_resolve_func);
@@ -674,7 +674,7 @@ void JIT::privateCompileMainPass()
         }
         CTI_COMPILE_BINARY_OP(op_lesseq)
         case op_loop_if_true: {
-            emitSlowScriptCheck();
+            emitTimeoutCheck();
 
             unsigned target = currentInstruction[2].u.operand;
             emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
@@ -691,13 +691,13 @@ void JIT::privateCompileMainPass()
         case op_resolve_base: {
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 1);
-            emitCTICall(Interpreter::cti_op_resolve_base);
+            emitCTICall(JITStubs::cti_op_resolve_base);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_resolve_base);
         }
         case op_negate: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
-            emitCTICall(Interpreter::cti_op_negate);
+            emitCTICall(JITStubs::cti_op_negate);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_negate);
         }
@@ -705,7 +705,7 @@ void JIT::privateCompileMainPass()
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 1);
             emitPutJITStubArgConstant(currentInstruction[3].u.operand + m_codeBlock->needsFullScopeChain(), 2);
-            emitCTICall(Interpreter::cti_op_resolve_skip);
+            emitCTICall(JITStubs::cti_op_resolve_skip);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_resolve_skip);
         }
@@ -735,7 +735,7 @@ void JIT::privateCompileMainPass()
             emitPutJITStubArgConstant(globalObject, 1);
             emitPutJITStubArgConstant(ident, 2);
             emitPutJITStubArgConstant(currentIndex, 3);
-            emitCTICall(Interpreter::cti_op_resolve_global);
+            emitCTICall(JITStubs::cti_op_resolve_global);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             end.link(this);
             NEXT_OPCODE(op_resolve_global);
@@ -884,7 +884,7 @@ void JIT::privateCompileMainPass()
         case op_resolve_with_base: {
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
             emitPutJITStubArgConstant(ident, 1);
-            emitCTICall(Interpreter::cti_op_resolve_with_base);
+            emitCTICall(JITStubs::cti_op_resolve_with_base);
             emitPutVirtualRegister(currentInstruction[2].u.operand, regT1);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_resolve_with_base);
@@ -892,7 +892,7 @@ void JIT::privateCompileMainPass()
         case op_new_func_exp: {
             FuncExprNode* func = m_codeBlock->functionExpression(currentInstruction[2].u.operand);
             emitPutJITStubArgConstant(func, 1);
-            emitCTICall(Interpreter::cti_op_new_func_exp);
+            emitCTICall(JITStubs::cti_op_new_func_exp);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_func_exp);
         }
@@ -940,7 +940,7 @@ void JIT::privateCompileMainPass()
         case op_new_regexp: {
             RegExp* regExp = m_codeBlock->regexp(currentInstruction[2].u.operand);
             emitPutJITStubArgConstant(regExp, 1);
-            emitCTICall(Interpreter::cti_op_new_regexp);
+            emitCTICall(JITStubs::cti_op_new_regexp);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_regexp);
         }
@@ -953,7 +953,7 @@ void JIT::privateCompileMainPass()
         }
         case op_throw: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);
-            emitCTICall(Interpreter::cti_op_throw);
+            emitCTICall(JITStubs::cti_op_throw);
             ASSERT(regT0 == returnValueRegister);
 #if PLATFORM(X86_64)
             addPtr(Imm32(0x48), X86::esp);
@@ -976,14 +976,14 @@ void JIT::privateCompileMainPass()
         }
         case op_get_pnames: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
-            emitCTICall(Interpreter::cti_op_get_pnames);
+            emitCTICall(JITStubs::cti_op_get_pnames);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_get_pnames);
         }
         case op_next_pname: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
             unsigned target = currentInstruction[3].u.operand;
-            emitCTICall(Interpreter::cti_op_next_pname);
+            emitCTICall(JITStubs::cti_op_next_pname);
             Jump endOfIter = branchTestPtr(Zero, regT0);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             addJump(jump(), target + 3);
@@ -992,12 +992,12 @@ void JIT::privateCompileMainPass()
         }
         case op_push_scope: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);
-            emitCTICall(Interpreter::cti_op_push_scope);
+            emitCTICall(JITStubs::cti_op_push_scope);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_push_scope);
         }
         case op_pop_scope: {
-            emitCTICall(Interpreter::cti_op_pop_scope);
+            emitCTICall(JITStubs::cti_op_pop_scope);
             NEXT_OPCODE(op_pop_scope);
         }
         CTI_COMPILE_UNARY_OP(op_typeof)
@@ -1035,7 +1035,7 @@ void JIT::privateCompileMainPass()
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 1);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2);
-            emitCTICall(Interpreter::cti_op_push_new_scope);
+            emitCTICall(JITStubs::cti_op_push_new_scope);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_push_new_scope);
         }
@@ -1047,7 +1047,7 @@ void JIT::privateCompileMainPass()
         case op_jmp_scopes: {
             unsigned count = currentInstruction[1].u.operand;
             emitPutJITStubArgConstant(count, 1);
-            emitCTICall(Interpreter::cti_op_jmp_scopes);
+            emitCTICall(JITStubs::cti_op_jmp_scopes);
             unsigned target = currentInstruction[2].u.operand;
             addJump(jump(), target + 2);
             NEXT_OPCODE(op_jmp_scopes);
@@ -1056,7 +1056,7 @@ void JIT::privateCompileMainPass()
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT2);
             emitPutJITStubArgConstant(currentInstruction[2].u.operand, 2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2);
-            emitCTICall(Interpreter::cti_op_put_by_index);
+            emitCTICall(JITStubs::cti_op_put_by_index);
             NEXT_OPCODE(op_put_by_index);
         }
         case op_switch_imm: {
@@ -1071,7 +1071,7 @@ void JIT::privateCompileMainPass()
 
             emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2);
             emitPutJITStubArgConstant(tableIndex, 2);
-            emitCTICall(Interpreter::cti_op_switch_imm);
+            emitCTICall(JITStubs::cti_op_switch_imm);
             jump(regT0);
             NEXT_OPCODE(op_switch_imm);
         }
@@ -1087,7 +1087,7 @@ void JIT::privateCompileMainPass()
 
             emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2);
             emitPutJITStubArgConstant(tableIndex, 2);
-            emitCTICall(Interpreter::cti_op_switch_char);
+            emitCTICall(JITStubs::cti_op_switch_char);
             jump(regT0);
             NEXT_OPCODE(op_switch_char);
         }
@@ -1102,14 +1102,14 @@ void JIT::privateCompileMainPass()
 
             emitPutJITStubArgFromVirtualRegister(scrutinee, 1, regT2);
             emitPutJITStubArgConstant(tableIndex, 2);
-            emitCTICall(Interpreter::cti_op_switch_string);
+            emitCTICall(JITStubs::cti_op_switch_string);
             jump(regT0);
             NEXT_OPCODE(op_switch_string);
         }
         case op_del_by_val: {
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2);
-            emitCTICall(Interpreter::cti_op_del_by_val);
+            emitCTICall(JITStubs::cti_op_del_by_val);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_del_by_val);
         }
@@ -1118,7 +1118,7 @@ void JIT::privateCompileMainPass()
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2);
-            emitCTICall(Interpreter::cti_op_put_getter);
+            emitCTICall(JITStubs::cti_op_put_getter);
             NEXT_OPCODE(op_put_getter);
         }
         case op_put_setter: {
@@ -1126,7 +1126,7 @@ void JIT::privateCompileMainPass()
             Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
             emitPutJITStubArgConstant(ident, 2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 3, regT2);
-            emitCTICall(Interpreter::cti_op_put_setter);
+            emitCTICall(JITStubs::cti_op_put_setter);
             NEXT_OPCODE(op_put_setter);
         }
         case op_new_error: {
@@ -1134,7 +1134,7 @@ void JIT::privateCompileMainPass()
             emitPutJITStubArgConstant(currentInstruction[2].u.operand, 1);
             emitPutJITStubArgConstant(JSValuePtr::encode(message), 2);
             emitPutJITStubArgConstant(m_bytecodeIndex, 3);
-            emitCTICall(Interpreter::cti_op_new_error);
+            emitCTICall(JITStubs::cti_op_new_error);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_new_error);
         }
@@ -1142,7 +1142,7 @@ void JIT::privateCompileMainPass()
             emitPutJITStubArgConstant(currentInstruction[1].u.operand, 1);
             emitPutJITStubArgConstant(currentInstruction[2].u.operand, 2);
             emitPutJITStubArgConstant(currentInstruction[3].u.operand, 3);
-            emitCTICall(Interpreter::cti_op_debug);
+            emitCTICall(JITStubs::cti_op_debug);
             NEXT_OPCODE(op_debug);
         }
         case op_eq_null: {
@@ -1211,16 +1211,16 @@ void JIT::privateCompileMainPass()
             for (size_t j = 0; j < count; ++j)
                 emitInitRegister(j);
 
-            emitCTICall(Interpreter::cti_op_push_activation);
+            emitCTICall(JITStubs::cti_op_push_activation);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
 
             NEXT_OPCODE(op_enter_with_activation);
         }
         case op_create_arguments: {
             if (m_codeBlock->m_numParameters == 1)
-                emitCTICall(Interpreter::cti_op_create_arguments_no_params);
+                emitCTICall(JITStubs::cti_op_create_arguments_no_params);
             else
-                emitCTICall(Interpreter::cti_op_create_arguments);
+                emitCTICall(JITStubs::cti_op_create_arguments);
             NEXT_OPCODE(op_create_arguments);
         }
         case op_convert_this: {
@@ -1236,7 +1236,7 @@ void JIT::privateCompileMainPass()
             emitGetCTIParam(STUB_ARGS_profilerReference, regT0);
             Jump noProfiler = branchTestPtr(Zero, Address(regT0));
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0);
-            emitCTICall(Interpreter::cti_op_profile_will_call);
+            emitCTICall(JITStubs::cti_op_profile_will_call);
             noProfiler.link(this);
 
             NEXT_OPCODE(op_profile_will_call);
@@ -1245,7 +1245,7 @@ void JIT::privateCompileMainPass()
             emitGetCTIParam(STUB_ARGS_profilerReference, regT0);
             Jump noProfiler = branchTestPtr(Zero, Address(regT0));
             emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, regT0);
-            emitCTICall(Interpreter::cti_op_profile_did_call);
+            emitCTICall(JITStubs::cti_op_profile_did_call);
             noProfiler.link(this);
 
             NEXT_OPCODE(op_profile_did_call);
@@ -1304,7 +1304,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_convert_this);
+            emitCTICall(JITStubs::cti_op_convert_this);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_convert_this);
         }
@@ -1331,7 +1331,7 @@ void JIT::privateCompileSlowCases()
             notImm.link(this);
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_get_by_val);
+            emitCTICall(JITStubs::cti_op_get_by_val);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_get_by_val));
 
@@ -1368,14 +1368,14 @@ void JIT::privateCompileSlowCases()
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
-                emitCTICall(Interpreter::cti_op_loop_if_less);
+                emitCTICall(JITStubs::cti_op_loop_if_less);
                 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3);
             } else {
                 linkSlowCase(iter);
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArg(regT1, 2);
-                emitCTICall(Interpreter::cti_op_loop_if_less);
+                emitCTICall(JITStubs::cti_op_loop_if_less);
                 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3);
             }
             NEXT_OPCODE(op_loop_if_less);
@@ -1395,14 +1395,14 @@ void JIT::privateCompileSlowCases()
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, regT2);
-                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
+                emitCTICall(JITStubs::cti_op_loop_if_lesseq);
                 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3);
             } else {
                 linkSlowCase(iter);
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArg(regT1, 2);
-                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
+                emitCTICall(JITStubs::cti_op_loop_if_lesseq);
                 emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 3);
             }
             NEXT_OPCODE(op_loop_if_lesseq);
@@ -1422,7 +1422,7 @@ void JIT::privateCompileSlowCases()
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
             emitPutJITStubArg(regT2, 3);
-            emitCTICall(Interpreter::cti_op_put_by_val);
+            emitCTICall(JITStubs::cti_op_put_by_val);
             emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_put_by_val));
 
             // slow cases for immediate int accesses to arrays
@@ -1432,14 +1432,14 @@ void JIT::privateCompileSlowCases()
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
             emitPutJITStubArg(regT2, 3);
-            emitCTICall(Interpreter::cti_op_put_by_val_array);
+            emitCTICall(JITStubs::cti_op_put_by_val_array);
 
             NEXT_OPCODE(op_put_by_val);
         }
         case op_loop_if_true: {
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_jtrue);
+            emitCTICall(JITStubs::cti_op_jtrue);
             unsigned target = currentInstruction[2].u.operand;
             emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 2);
             NEXT_OPCODE(op_loop_if_true);
@@ -1455,14 +1455,14 @@ void JIT::privateCompileSlowCases()
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, regT2);
-                emitCTICall(Interpreter::cti_op_jless);
+                emitCTICall(JITStubs::cti_op_jless);
                 emitJumpSlowToHot(branchTest32(Zero, regT0), target + 3);
             } else {
                 linkSlowCase(iter);
                 linkSlowCase(iter);
                 emitPutJITStubArg(regT0, 1);
                 emitPutJITStubArg(regT1, 2);
-                emitCTICall(Interpreter::cti_op_jless);
+                emitCTICall(JITStubs::cti_op_jless);
                 emitJumpSlowToHot(branchTest32(Zero, regT0), target + 3);
             }
             NEXT_OPCODE(op_jnless);
@@ -1471,14 +1471,14 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             xorPtr(Imm32(static_cast<int32_t>(JSImmediate::FullTagTypeBool)), regT0);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_not);
+            emitCTICall(JITStubs::cti_op_not);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_not);
         }
         case op_jfalse: {
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_jtrue);
+            emitCTICall(JITStubs::cti_op_jtrue);
             unsigned target = currentInstruction[2].u.operand;
             emitJumpSlowToHot(branchTest32(Zero, regT0), target + 2); // inverted!
             NEXT_OPCODE(op_jfalse);
@@ -1490,7 +1490,7 @@ void JIT::privateCompileSlowCases()
         case op_bitnot: {
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_bitnot);
+            emitCTICall(JITStubs::cti_op_bitnot);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_bitnot);
         }
@@ -1501,7 +1501,7 @@ void JIT::privateCompileSlowCases()
         case op_jtrue: {
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_jtrue);
+            emitCTICall(JITStubs::cti_op_jtrue);
             unsigned target = currentInstruction[2].u.operand;
             emitJumpSlowToHot(branchTest32(NonZero, regT0), target + 2);
             NEXT_OPCODE(op_jtrue);
@@ -1514,7 +1514,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_bitxor);
+            emitCTICall(JITStubs::cti_op_bitxor);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_bitxor);
         }
@@ -1522,7 +1522,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_bitor);
+            emitCTICall(JITStubs::cti_op_bitor);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_bitor);
         }
@@ -1530,7 +1530,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_eq);
+            emitCTICall(JITStubs::cti_op_eq);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_eq);
         }
@@ -1538,7 +1538,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_neq);
+            emitCTICall(JITStubs::cti_op_neq);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_neq);
         }
@@ -1550,7 +1550,7 @@ void JIT::privateCompileSlowCases()
 #endif
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_stricteq);
+            emitCTICall(JITStubs::cti_op_stricteq);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_stricteq);
         }
@@ -1562,7 +1562,7 @@ void JIT::privateCompileSlowCases()
 #endif
             emitPutJITStubArg(regT0, 1);
             emitPutJITStubArg(regT1, 2);
-            emitCTICall(Interpreter::cti_op_nstricteq);
+            emitCTICall(JITStubs::cti_op_nstricteq);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_nstricteq);
         }
@@ -1573,7 +1573,7 @@ void JIT::privateCompileSlowCases()
             emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 1, regT2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[3].u.operand, 2, regT2);
             emitPutJITStubArgFromVirtualRegister(currentInstruction[4].u.operand, 3, regT2);
-            emitCTICall(Interpreter::cti_op_instanceof);
+            emitCTICall(JITStubs::cti_op_instanceof);
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_instanceof);
         }
@@ -1603,7 +1603,7 @@ void JIT::privateCompileSlowCases()
             linkSlowCase(iter);
 
             emitPutJITStubArg(regT0, 1);
-            emitCTICall(Interpreter::cti_op_to_jsnumber);
+            emitCTICall(JITStubs::cti_op_to_jsnumber);
 
             emitPutVirtualRegister(currentInstruction[1].u.operand);
             NEXT_OPCODE(op_to_jsnumber);
@@ -1661,7 +1661,7 @@ void JIT::privateCompile()
     if (m_codeBlock->codeType() == FunctionCode) {
         slowRegisterFileCheck.link(this);
         m_bytecodeIndex = 0; // emitCTICall will add to the map, but doesn't actually need this...
-        emitCTICall(Interpreter::cti_register_file_check);
+        emitCTICall(JITStubs::cti_register_file_check);
 #ifndef NDEBUG
         // reset this, in order to guard it's use with asserts
         m_bytecodeIndex = (unsigned)-1;
@@ -1917,24 +1917,24 @@ void JIT::privateCompileCTIMachineTrampolines()
     PatchBuffer patchBuffer(code);
 
 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
-    patchBuffer.link(array_failureCases1Call, Interpreter::cti_op_get_by_id_array_fail);
-    patchBuffer.link(array_failureCases2Call, Interpreter::cti_op_get_by_id_array_fail);
-    patchBuffer.link(array_failureCases3Call, Interpreter::cti_op_get_by_id_array_fail);
-    patchBuffer.link(string_failureCases1Call, Interpreter::cti_op_get_by_id_string_fail);
-    patchBuffer.link(string_failureCases2Call, Interpreter::cti_op_get_by_id_string_fail);
-    patchBuffer.link(string_failureCases3Call, Interpreter::cti_op_get_by_id_string_fail);
+    patchBuffer.link(array_failureCases1Call, JITStubs::cti_op_get_by_id_array_fail);
+    patchBuffer.link(array_failureCases2Call, JITStubs::cti_op_get_by_id_array_fail);
+    patchBuffer.link(array_failureCases3Call, JITStubs::cti_op_get_by_id_array_fail);
+    patchBuffer.link(string_failureCases1Call, JITStubs::cti_op_get_by_id_string_fail);
+    patchBuffer.link(string_failureCases2Call, JITStubs::cti_op_get_by_id_string_fail);
+    patchBuffer.link(string_failureCases3Call, JITStubs::cti_op_get_by_id_string_fail);
 
     m_interpreter->m_ctiArrayLengthTrampoline = patchBuffer.trampolineAt(arrayLengthBegin);
     m_interpreter->m_ctiStringLengthTrampoline = patchBuffer.trampolineAt(stringLengthBegin);
 #endif
-    patchBuffer.link(callArityCheck1, Interpreter::cti_op_call_arityCheck);
-    patchBuffer.link(callArityCheck2, Interpreter::cti_op_call_arityCheck);
-    patchBuffer.link(callArityCheck3, Interpreter::cti_op_call_arityCheck);
-    patchBuffer.link(callJSFunction1, Interpreter::cti_op_call_JSFunction);
-    patchBuffer.link(callJSFunction2, Interpreter::cti_op_call_JSFunction);
-    patchBuffer.link(callJSFunction3, Interpreter::cti_op_call_JSFunction);
-    patchBuffer.link(callDontLazyLinkCall, Interpreter::cti_vm_dontLazyLinkCall);
-    patchBuffer.link(callLazyLinkCall, Interpreter::cti_vm_lazyLinkCall);
+    patchBuffer.link(callArityCheck1, JITStubs::cti_op_call_arityCheck);
+    patchBuffer.link(callArityCheck2, JITStubs::cti_op_call_arityCheck);
+    patchBuffer.link(callArityCheck3, JITStubs::cti_op_call_arityCheck);
+    patchBuffer.link(callJSFunction1, JITStubs::cti_op_call_JSFunction);
+    patchBuffer.link(callJSFunction2, JITStubs::cti_op_call_JSFunction);
+    patchBuffer.link(callJSFunction3, JITStubs::cti_op_call_JSFunction);
+    patchBuffer.link(callDontLazyLinkCall, JITStubs::cti_vm_dontLazyLinkCall);
+    patchBuffer.link(callLazyLinkCall, JITStubs::cti_vm_lazyLinkCall);
 
     m_interpreter->m_ctiVirtualCallPreLink = patchBuffer.trampolineAt(virtualCallPreLinkBegin);
     m_interpreter->m_ctiVirtualCallLink = patchBuffer.trampolineAt(virtualCallLinkBegin);
index ce6557e..5d3bb07 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "Interpreter.h"
 #include "JITCode.h"
+#include "JITStubs.h"
 #include "Opcode.h"
 #include "RegisterFile.h"
 #include "MacroAssembler.h"
@@ -526,7 +527,7 @@ namespace JSC {
         void emitGetVariableObjectRegister(RegisterID variableObject, int index, RegisterID dst);
         void emitPutVariableObjectRegister(RegisterID src, RegisterID variableObject, int index);
         
-        void emitSlowScriptCheck();
+        void emitTimeoutCheck();
 #ifndef NDEBUG
         void printBytecodeOperandTypes(unsigned src1, unsigned src2);
 #endif
index 5eb301d..fcf612a 100644 (file)
@@ -85,7 +85,7 @@ void JIT::compileFastArithSlow_op_lshift(unsigned result, unsigned op1, unsigned
 #endif
     emitPutJITStubArg(regT0, 1);
     emitPutJITStubArg(regT2, 2);
-    emitCTICall(Interpreter::cti_op_lshift);
+    emitCTICall(JITStubs::cti_op_lshift);
     emitPutVirtualRegister(result);
 }
 
@@ -134,7 +134,7 @@ void JIT::compileFastArithSlow_op_rshift(unsigned result, unsigned, unsigned op2
     }
 
     emitPutJITStubArg(regT0, 1);
-    emitCTICall(Interpreter::cti_op_rshift);
+    emitCTICall(JITStubs::cti_op_rshift);
     emitPutVirtualRegister(result);
 }
 
@@ -182,7 +182,7 @@ void JIT::compileFastArithSlow_op_bitand(unsigned result, unsigned op1, unsigned
         emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
         emitPutJITStubArg(regT1, 2);
     }
-    emitCTICall(Interpreter::cti_op_bitand);
+    emitCTICall(JITStubs::cti_op_bitand);
     emitPutVirtualRegister(result);
 }
 
@@ -223,7 +223,7 @@ void JIT::compileFastArithSlow_op_mod(unsigned result, unsigned, unsigned, Vecto
 #endif
     emitPutJITStubArg(X86::eax, 1);
     emitPutJITStubArg(X86::ecx, 2);
-    emitCTICall(Interpreter::cti_op_mod);
+    emitCTICall(JITStubs::cti_op_mod);
     emitPutVirtualRegister(result);
 }
 #else
@@ -231,7 +231,7 @@ void JIT::compileFastArith_op_mod(unsigned result, unsigned op1, unsigned op2)
 {
     emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
     emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
-    emitCTICall(Interpreter::cti_op_mod);
+    emitCTICall(JITStubs::cti_op_mod);
     emitPutVirtualRegister(result);
 }
 void JIT::compileFastArithSlow_op_mod(unsigned, unsigned, unsigned, Vector<SlowCaseEntry>::iterator&)
@@ -260,7 +260,7 @@ void JIT::compileFastArithSlow_op_post_inc(unsigned result, unsigned srcDst, Vec
     linkSlowCase(iter);
     linkSlowCase(iter);
     emitPutJITStubArg(regT0, 1);
-    emitCTICall(Interpreter::cti_op_post_inc);
+    emitCTICall(JITStubs::cti_op_post_inc);
     emitPutVirtualRegister(srcDst, regT1);
     emitPutVirtualRegister(result);
 }
@@ -285,7 +285,7 @@ void JIT::compileFastArithSlow_op_post_dec(unsigned result, unsigned srcDst, Vec
     linkSlowCase(iter);
     linkSlowCase(iter);
     emitPutJITStubArg(regT0, 1);
-    emitCTICall(Interpreter::cti_op_post_dec);
+    emitCTICall(JITStubs::cti_op_post_dec);
     emitPutVirtualRegister(srcDst, regT1);
     emitPutVirtualRegister(result);
 }
@@ -310,7 +310,7 @@ void JIT::compileFastArithSlow_op_pre_inc(unsigned srcDst, Vector<SlowCaseEntry>
     emitGetVirtualRegister(srcDst, regT0);
     notImm.link(this);
     emitPutJITStubArg(regT0, 1);
-    emitCTICall(Interpreter::cti_op_pre_inc);
+    emitCTICall(JITStubs::cti_op_pre_inc);
     emitPutVirtualRegister(srcDst);
 }
 
@@ -334,7 +334,7 @@ void JIT::compileFastArithSlow_op_pre_dec(unsigned srcDst, Vector<SlowCaseEntry>
     emitGetVirtualRegister(srcDst, regT0);
     notImm.link(this);
     emitPutJITStubArg(regT0, 1);
-    emitCTICall(Interpreter::cti_op_pre_dec);
+    emitCTICall(JITStubs::cti_op_pre_dec);
     emitPutVirtualRegister(srcDst);
 }
 
@@ -349,7 +349,7 @@ void JIT::compileFastArith_op_add(Instruction* currentInstruction)
 
     emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
     emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
-    emitCTICall(Interpreter::cti_op_add);
+    emitCTICall(JITStubs::cti_op_add);
     emitPutVirtualRegister(result);
 }
 void JIT::compileFastArithSlow_op_add(Instruction*, Vector<SlowCaseEntry>::iterator&)
@@ -365,7 +365,7 @@ void JIT::compileFastArith_op_mul(Instruction* currentInstruction)
 
     emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
     emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
-    emitCTICall(Interpreter::cti_op_mul);
+    emitCTICall(JITStubs::cti_op_mul);
     emitPutVirtualRegister(result);
 }
 void JIT::compileFastArithSlow_op_mul(Instruction*, Vector<SlowCaseEntry>::iterator&)
@@ -381,7 +381,7 @@ void JIT::compileFastArith_op_sub(Instruction* currentInstruction)
 
     emitPutJITStubArgFromVirtualRegister(op1, 1, regT2);
     emitPutJITStubArgFromVirtualRegister(op2, 2, regT2);
-    emitCTICall(Interpreter::cti_op_sub);
+    emitCTICall(JITStubs::cti_op_sub);
     emitPutVirtualRegister(result);
 }
 void JIT::compileFastArithSlow_op_sub(Instruction*, Vector<SlowCaseEntry>::iterator&)
@@ -425,12 +425,12 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
     emitPutJITStubArg(X86::eax, 1);
     emitPutJITStubArg(X86::edx, 2);
     if (opcodeID == op_add)
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
     else if (opcodeID == op_sub)
-        emitCTICall(Interpreter::cti_op_sub);
+        emitCTICall(JITStubs::cti_op_sub);
     else {
         ASSERT(opcodeID == op_mul);
-        emitCTICall(Interpreter::cti_op_mul);
+        emitCTICall(JITStubs::cti_op_mul);
     }
     Jump end = jump();
 
@@ -480,7 +480,7 @@ void JIT::compileFastArith_op_add(Instruction* currentInstruction)
     if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
         emitPutVirtualRegister(result);
         return;
     }
@@ -512,13 +512,13 @@ void JIT::compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<Sl
         linkSlowCase(iter);
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
     } else if (isOperandConstantImmediateInt(op2)) {
         linkSlowCase(iter);
         linkSlowCase(iter);
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
     } else
         compileBinaryArithOpSlowCase(op_add, iter, result, op1, op2, types);
 
@@ -563,7 +563,7 @@ void JIT::compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<Sl
         // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_mul);
+        emitCTICall(JITStubs::cti_op_mul);
     } else
         compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, types);
 
@@ -857,12 +857,12 @@ void JIT::compileBinaryArithOpSlowCase(OpcodeID opcodeID, Vector<SlowCaseEntry>:
     emitPutJITStubArgFromVirtualRegister(src1, 1, X86::ecx);
     emitPutJITStubArgFromVirtualRegister(src2, 2, X86::ecx);
     if (opcodeID == op_add)
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
     else if (opcodeID == op_sub)
-        emitCTICall(Interpreter::cti_op_sub);
+        emitCTICall(JITStubs::cti_op_sub);
     else {
         ASSERT(opcodeID == op_mul);
-        emitCTICall(Interpreter::cti_op_mul);
+        emitCTICall(JITStubs::cti_op_mul);
     }
     emitPutVirtualRegister(dst);
 }
@@ -892,7 +892,7 @@ void JIT::compileFastArith_op_add(Instruction* currentInstruction)
         else {
             emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
             emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-            emitCTICall(Interpreter::cti_op_add);
+            emitCTICall(JITStubs::cti_op_add);
             emitPutVirtualRegister(result);
         }
     }
@@ -910,7 +910,7 @@ void JIT::compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<Sl
         notImm.link(this);
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArg(X86::eax, 2);
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
         emitPutVirtualRegister(result);
     } else if (isOperandConstantImmediateInt(op2)) {
         Jump notImm = getSlowCase(iter);
@@ -919,7 +919,7 @@ void JIT::compileFastArithSlow_op_add(Instruction* currentInstruction, Vector<Sl
         notImm.link(this);
         emitPutJITStubArg(X86::eax, 1);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_add);
+        emitCTICall(JITStubs::cti_op_add);
         emitPutVirtualRegister(result);
     } else {
         OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
@@ -968,7 +968,7 @@ void JIT::compileFastArithSlow_op_mul(Instruction* currentInstruction, Vector<Sl
         // There is an extra slow case for (op1 * -N) or (-N * op2), to check for 0 since this should produce a result of -0.
         emitPutJITStubArgFromVirtualRegister(op1, 1, X86::ecx);
         emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
-        emitCTICall(Interpreter::cti_op_mul);
+        emitCTICall(JITStubs::cti_op_mul);
         emitPutVirtualRegister(result);
     } else
         compileBinaryArithOpSlowCase(op_mul, iter, result, op1, op2, OperandTypes::fromInt(currentInstruction[4].u.operand));
index 1366098..28094bd 100644 (file)
@@ -132,7 +132,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned)
         emitGetVirtualRegister(callee, regT2);
         compileOpCallEvalSetupArgs(instruction);
 
-        emitCTICall(Interpreter::cti_op_call_eval);
+        emitCTICall(JITStubs::cti_op_call_eval);
         wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
     }
 
@@ -149,7 +149,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned)
 
     // First, in the case of a construct, allocate the new object.
     if (opcodeID == op_construct) {
-        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
+        emitCTICall(JITStubs::cti_op_construct_JSConstruct);
         emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
         emitGetVirtualRegister(callee, regT2);
     }
@@ -178,7 +178,7 @@ void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>:
     linkSlowCase(iter);
 
     // This handles host functions
-    emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
+    emitCTICall(((opcodeID == op_construct) ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction));
     // Put the return value in dst. In the interpreter, op_ret does this.
     emitPutVirtualRegister(dst);
 
@@ -200,7 +200,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
         emitGetVirtualRegister(callee, regT2);
         compileOpCallEvalSetupArgs(instruction);
 
-        emitCTICall(Interpreter::cti_op_call_eval);
+        emitCTICall(JITStubs::cti_op_call_eval);
         wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
     }
 
@@ -222,7 +222,7 @@ void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned ca
 
         emitPutJITStubArg(regT2, 1);
         emitPutJITStubArgFromVirtualRegister(proto, 4, regT0);
-        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
+        emitCTICall(JITStubs::cti_op_construct_JSConstruct);
         emitPutVirtualRegister(thisRegister);
         emitGetVirtualRegister(callee, regT2);
     }
@@ -270,7 +270,7 @@ void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>:
 
     // First, in the case of a construct, allocate the new object.
     if (opcodeID == op_construct) {
-        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
+        emitCTICall(JITStubs::cti_op_construct_JSConstruct);
         emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
         emitGetVirtualRegister(callee, regT2);
     }
@@ -304,7 +304,7 @@ void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>:
     isNotObject.link(this);
     callLinkFailNotObject.link(this);
     callLinkFailNotJSFunction.link(this);
-    emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));
+    emitCTICall(((opcodeID == op_construct) ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction));
     Jump wasNotJSFunction = jump();
 
     // Next, handle JSFunctions...
@@ -312,7 +312,7 @@ void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>:
 
     // First, in the case of a construct, allocate the new object.
     if (opcodeID == op_construct) {
-        emitCTICall(Interpreter::cti_op_construct_JSConstruct);
+        emitCTICall(JITStubs::cti_op_construct_JSConstruct);
         emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);
         emitGetVirtualRegister(callee, regT2);
     }
index 6a91550..c5a8eca 100644 (file)
@@ -57,7 +57,7 @@ void JIT::compileGetByIdHotPath(int resultVReg, int baseVReg, Identifier* ident,
 
     emitPutJITStubArg(regT0, 1);
     emitPutJITStubArgConstant(ident, 2);
-    emitCTICall(Interpreter::cti_op_get_by_id_generic);
+    emitCTICall(JITStubs::cti_op_get_by_id_generic);
     emitPutVirtualRegister(resultVReg);
 }
 
@@ -78,7 +78,7 @@ void JIT::compilePutByIdHotPath(int baseVReg, Identifier* ident, int valueVReg,
     emitPutJITStubArgConstant(ident, 2);
     emitPutJITStubArg(regT0, 1);
     emitPutJITStubArg(regT1, 3);
-    emitCTICall(Interpreter::cti_op_put_by_id_generic);
+    emitCTICall(JITStubs::cti_op_put_by_id_generic);
 }
 
 void JIT::compilePutByIdSlowCase(int, Identifier*, int, Vector<SlowCaseEntry>::iterator&, unsigned)
@@ -134,7 +134,7 @@ void JIT::compileGetByIdSlowCase(int resultVReg, int baseVReg, Identifier* ident
 #endif
     emitPutJITStubArg(regT0, 1);
     emitPutJITStubArgConstant(ident, 2);
-    Call call = emitCTICall(Interpreter::cti_op_get_by_id);
+    Call call = emitCTICall(JITStubs::cti_op_get_by_id);
     emitPutVirtualRegister(resultVReg);
 
     ASSERT(differenceBetween(coldPathBegin, call) == patchOffsetGetByIdSlowCaseCall);
@@ -176,7 +176,7 @@ void JIT::compilePutByIdSlowCase(int baseVReg, Identifier* ident, int, Vector<Sl
     emitPutJITStubArgConstant(ident, 2);
     emitPutJITStubArg(regT0, 1);
     emitPutJITStubArg(regT1, 3);
-    Call call = emitCTICall(Interpreter::cti_op_put_by_id);
+    Call call = emitCTICall(JITStubs::cti_op_put_by_id);
 
     // Track the location of the call; this will be used to recover patch information.
     m_propertyAccessCompilationInfo[propertyAccessInstructionIndex].callReturnLocation = call;
@@ -265,7 +265,7 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure
     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
     PatchBuffer patchBuffer(code);
 
-    patchBuffer.link(failureCall, Interpreter::cti_op_put_by_id_fail);
+    patchBuffer.link(failureCall, JITStubs::cti_op_put_by_id_fail);
 
     if (willNeedStorageRealloc)
         patchBuffer.link(callTarget, resizePropertyStorage);
@@ -278,8 +278,8 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure
 void JIT::patchGetByIdSelf(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress)
 {
     // We don't want to patch more than once - in future go to cti_op_get_by_id_generic.
-    // Should probably go to Interpreter::cti_op_get_by_id_fail, but that doesn't do anything interesting right now.
-    returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_self_fail);
+    // Should probably go to JITStubs::cti_op_get_by_id_fail, but that doesn't do anything interesting right now.
+    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_self_fail);
 
     // Patch the offset into the propoerty map to load from, then patch the Structure to look for.
     stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetGetByIdStructure).repatch(structure);
@@ -289,8 +289,8 @@ void JIT::patchGetByIdSelf(StructureStubInfo* stubInfo, Structure* structure, si
 void JIT::patchPutByIdReplace(StructureStubInfo* stubInfo, Structure* structure, size_t cachedOffset, ProcessorReturnAddress returnAddress)
 {
     // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
-    // Should probably go to Interpreter::cti_op_put_by_id_fail, but that doesn't do anything interesting right now.
-    returnAddress.relinkCallerToFunction(Interpreter::cti_op_put_by_id_generic);
+    // Should probably go to JITStubs::cti_op_put_by_id_fail, but that doesn't do anything interesting right now.
+    returnAddress.relinkCallerToFunction(JITStubs::cti_op_put_by_id_generic);
 
     // Patch the offset into the propoerty map to load from, then patch the Structure to look for.
     stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetPutByIdStructure).repatch(structure);
@@ -302,7 +302,7 @@ void JIT::privateCompilePatchGetArrayLength(ProcessorReturnAddress returnAddress
     StructureStubInfo* stubInfo = &m_codeBlock->getStubInfo(returnAddress);
 
     // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
-    returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_array_fail);
+    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_array_fail);
 
     // Check eax is an array
     Jump failureCases1 = branchPtr(NotEqual, Address(regT0), ImmPtr(m_interpreter->m_jsArrayVptr));
@@ -353,8 +353,8 @@ void JIT::privateCompileGetByIdSelf(StructureStubInfo* stubInfo, Structure* stru
     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
     PatchBuffer patchBuffer(code);
 
-    patchBuffer.link(failureCases1Call, Interpreter::cti_op_get_by_id_self_fail);
-    patchBuffer.link(failureCases2Call, Interpreter::cti_op_get_by_id_self_fail);
+    patchBuffer.link(failureCases1Call, JITStubs::cti_op_get_by_id_self_fail);
+    patchBuffer.link(failureCases2Call, JITStubs::cti_op_get_by_id_self_fail);
 
     stubInfo->stubRoutine = patchBuffer.entry();
 
@@ -365,7 +365,7 @@ void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* str
 {
 #if USE(CTI_REPATCH_PIC)
     // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
-    returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_proto_list);
+    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
 
     // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is
     // referencing the prototype object - let's speculatively load it's table nice and early!)
@@ -431,9 +431,9 @@ void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* str
     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
     PatchBuffer patchBuffer(code);
 
-    patchBuffer.link(failureCases1, Interpreter::cti_op_get_by_id_proto_fail);
-    patchBuffer.link(failureCases2, Interpreter::cti_op_get_by_id_proto_fail);
-    patchBuffer.link(failureCases3, Interpreter::cti_op_get_by_id_proto_fail);
+    patchBuffer.link(failureCases1, JITStubs::cti_op_get_by_id_proto_fail);
+    patchBuffer.link(failureCases2, JITStubs::cti_op_get_by_id_proto_fail);
+    patchBuffer.link(failureCases3, JITStubs::cti_op_get_by_id_proto_fail);
 
     stubInfo->stubRoutine = patchBuffer.entry();
 
@@ -581,7 +581,7 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str
 {
 #if USE(CTI_REPATCH_PIC)
     // We don't want to patch more than once - in future go to cti_op_put_by_id_generic.
-    returnAddress.relinkCallerToFunction(Interpreter::cti_op_get_by_id_proto_list);
+    returnAddress.relinkCallerToFunction(JITStubs::cti_op_get_by_id_proto_list);
 
     ASSERT(count);
     
@@ -663,7 +663,7 @@ void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* str
 
     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
 
-    patchBuffer.link(bucketsOfFail, Interpreter::cti_op_get_by_id_proto_fail);
+    patchBuffer.link(bucketsOfFail, JITStubs::cti_op_get_by_id_proto_fail);
 
     stubInfo->stubRoutine = patchBuffer.entry();
 
@@ -688,8 +688,8 @@ void JIT::privateCompilePutByIdReplace(StructureStubInfo* stubInfo, Structure* s
     void* code = m_assembler.executableCopy(m_codeBlock->executablePool());
     PatchBuffer patchBuffer(code);
     
-    patchBuffer.link(failureCases1Call, Interpreter::cti_op_put_by_id_fail);
-    patchBuffer.link(failureCases2Call, Interpreter::cti_op_put_by_id_fail);
+    patchBuffer.link(failureCases1Call, JITStubs::cti_op_put_by_id_fail);
+    patchBuffer.link(failureCases2Call, JITStubs::cti_op_put_by_id_fail);
 
     stubInfo->stubRoutine = patchBuffer.entry();
     
index e38b481..5d232ca 100644 (file)
  */
 
 #include "config.h"
-#include "Interpreter.h"
+#include "JITStubs.h"
+
+#if ENABLE(JIT)
 
 #include "Arguments.h"
-#include "BatchedTransitionOptimizer.h"
+#include "CallFrame.h"
 #include "CodeBlock.h"
-#include "DebuggerCallFrame.h"
-#include "EvalCodeCache.h"
+#include "Collector.h"
+#include "Debugger.h"
 #include "ExceptionHelpers.h"
-#include "CallFrame.h"
 #include "GlobalEvalFunction.h"
+#include "JIT.h"
 #include "JSActivation.h"
 #include "JSArray.h"
 #include "JSByteArray.h"
 #include "JSStaticScopeObject.h"
 #include "JSString.h"
 #include "ObjectPrototype.h"
+#include "Operations.h"
 #include "Parser.h"
 #include "Profiler.h"
 #include "RegExpObject.h"
 #include "RegExpPrototype.h"
 #include "Register.h"
-#include "Collector.h"
-#include "Debugger.h"
-#include "Operations.h"
 #include "SamplingTool.h"
 #include <stdio.h>
 
-#if ENABLE(JIT)
-#include "JIT.h"
-#endif
-
-#if ENABLE(ASSEMBLER)
-#include "AssemblerBuffer.h"
-#endif
-
-#if PLATFORM(DARWIN)
-#include <mach/mach.h>
-#endif
-
-#if HAVE(SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-#if PLATFORM(WIN_OS)
-#include <windows.h>
-#endif
-
-#if PLATFORM(QT)
-#include <QDateTime>
-#endif
-
 using namespace std;
 
 namespace JSC {
 
-#if ENABLE(JIT)
-
 #if ENABLE(OPCODE_SAMPLING)
     #define CTI_SAMPLER ARG_globalData->interpreter->sampler()
 #else
@@ -96,7 +70,7 @@ namespace JSC {
 
 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
 
-NEVER_INLINE void Interpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot& slot)
+NEVER_INLINE void JITStubs::tryCachePutByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot& slot)
 {
     // The interpreter checks for recursion here; I do not believe this can occur in CTI.
 
@@ -105,7 +79,7 @@ NEVER_INLINE void Interpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBloc
 
     // Uncacheable: give up.
     if (!slot.isCacheable()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_put_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_put_by_id_generic));
         return;
     }
     
@@ -113,13 +87,13 @@ NEVER_INLINE void Interpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBloc
     Structure* structure = baseCell->structure();
 
     if (structure->isDictionary()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_put_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_put_by_id_generic));
         return;
     }
 
     // If baseCell != base, then baseCell must be a proxy for another object.
     if (baseCell != slot.base()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_put_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_put_by_id_generic));
         return;
     }
 
@@ -152,35 +126,38 @@ NEVER_INLINE void Interpreter::tryCTICachePutByID(CallFrame* callFrame, CodeBloc
 #endif
 }
 
-NEVER_INLINE void Interpreter::tryCTICacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot& slot)
+NEVER_INLINE void JITStubs::tryCacheGetByID(CallFrame* callFrame, CodeBlock* codeBlock, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot& slot)
 {
     // FIXME: Write a test that proves we need to check for recursion here just
     // like the interpreter does, then add a check for recursion.
 
     // FIXME: Cache property access for immediates.
     if (!baseValue.isCell()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_get_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_get_by_id_generic));
         return;
     }
+    
+    Interpreter* interpreter = callFrame->interpreter();
 
-    if (isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
+    if (interpreter->isJSArray(baseValue) && propertyName == callFrame->propertyNames().length) {
 #if USE(CTI_REPATCH_PIC)
         JIT::compilePatchGetArrayLength(callFrame->scopeChain()->globalData, codeBlock, returnAddress);
 #else
-        ctiPatchCallByReturnAddress(returnAddress, m_ctiArrayLengthTrampoline);
+        ctiPatchCallByReturnAddress(returnAddress, interpreter->m_ctiArrayLengthTrampoline);
 #endif
         return;
     }
-    if (isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
+    
+    if (interpreter->isJSString(baseValue) && propertyName == callFrame->propertyNames().length) {
         // The tradeoff of compiling an patched inline string length access routine does not seem
         // to pay off, so we currently only do this for arrays.
-        ctiPatchCallByReturnAddress(returnAddress, m_ctiStringLengthTrampoline);
+        ctiPatchCallByReturnAddress(returnAddress, interpreter->m_ctiStringLengthTrampoline);
         return;
     }
 
     // Uncacheable: give up.
     if (!slot.isCacheable()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_get_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_get_by_id_generic));
         return;
     }
 
@@ -188,7 +165,7 @@ NEVER_INLINE void Interpreter::tryCTICacheGetByID(CallFrame* callFrame, CodeBloc
     Structure* structure = baseCell->structure();
 
     if (structure->isDictionary()) {
-        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(cti_op_get_by_id_generic));
+        ctiPatchCallByReturnAddress(returnAddress, reinterpret_cast<void*>(JITStubs::cti_op_get_by_id_generic));
         return;
     }
 
@@ -343,7 +320,7 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD
         } \
     } while (0)
 
-JSObject* Interpreter::cti_op_convert_this(STUB_ARGS)
+JSObject* JITStubs::cti_op_convert_this(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -355,7 +332,7 @@ JSObject* Interpreter::cti_op_convert_this(STUB_ARGS)
     return result;
 }
 
-void Interpreter::cti_op_end(STUB_ARGS)
+void JITStubs::cti_op_end(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -364,7 +341,7 @@ void Interpreter::cti_op_end(STUB_ARGS)
     scopeChain->deref();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_add(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_add(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -409,7 +386,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_add(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_pre_inc(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_pre_inc(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -421,20 +398,22 @@ JSValueEncodedAsPointer* Interpreter::cti_op_pre_inc(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-int Interpreter::cti_timeout_check(STUB_ARGS)
+int JITStubs::cti_timeout_check(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
-    Interpreter* interpreter = ARG_globalData->interpreter;
+    
+    JSGlobalData* globalData = ARG_globalData;
+    TimeoutChecker& timeoutChecker = globalData->timeoutChecker;
 
-    if (interpreter->checkTimeout(ARG_callFrame->dynamicGlobalObject())) {
-        ARG_globalData->exception = createInterruptedExecutionException(ARG_globalData);
+    if (timeoutChecker.didTimeOut(ARG_callFrame)) {
+        globalData->exception = createInterruptedExecutionException(globalData);
         VM_THROW_EXCEPTION_AT_END();
     }
     
-    return interpreter->m_ticksUntilNextTimeoutCheck;
+    return timeoutChecker.ticksUntilNextCheck();
 }
 
-void Interpreter::cti_register_file_check(STUB_ARGS)
+void JITStubs::cti_register_file_check(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -448,7 +427,7 @@ void Interpreter::cti_register_file_check(STUB_ARGS)
     throwStackOverflowError(oldCallFrame, ARG_globalData, oldCallFrame->returnPC(), STUB_RETURN_ADDRESS);
 }
 
-int Interpreter::cti_op_loop_if_less(STUB_ARGS)
+int JITStubs::cti_op_loop_if_less(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -461,7 +440,7 @@ int Interpreter::cti_op_loop_if_less(STUB_ARGS)
     return result;
 }
 
-int Interpreter::cti_op_loop_if_lesseq(STUB_ARGS)
+int JITStubs::cti_op_loop_if_lesseq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -474,14 +453,14 @@ int Interpreter::cti_op_loop_if_lesseq(STUB_ARGS)
     return result;
 }
 
-JSObject* Interpreter::cti_op_new_object(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_object(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return constructEmptyObject(ARG_callFrame);
 }
 
-void Interpreter::cti_op_put_by_id_generic(STUB_ARGS)
+void JITStubs::cti_op_put_by_id_generic(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -490,7 +469,7 @@ void Interpreter::cti_op_put_by_id_generic(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_generic(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_generic(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -507,7 +486,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_generic(STUB_ARGS)
 
 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS)
 
-void Interpreter::cti_op_put_by_id(STUB_ARGS)
+void JITStubs::cti_op_put_by_id(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -522,17 +501,17 @@ void Interpreter::cti_op_put_by_id(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-void Interpreter::cti_op_put_by_id_second(STUB_ARGS)
+void JITStubs::cti_op_put_by_id_second(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     PutPropertySlot slot;
     ARG_src1.put(ARG_callFrame, *ARG_id2, ARG_src3, slot);
-    ARG_globalData->interpreter->tryCTICachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), STUB_RETURN_ADDRESS, ARG_src1, slot);
+    tryCachePutByID(ARG_callFrame, ARG_callFrame->codeBlock(), STUB_RETURN_ADDRESS, ARG_src1, slot);
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-void Interpreter::cti_op_put_by_id_fail(STUB_ARGS)
+void JITStubs::cti_op_put_by_id_fail(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -545,7 +524,7 @@ void Interpreter::cti_op_put_by_id_fail(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -562,7 +541,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_second(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_second(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -573,13 +552,13 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_second(STUB_ARGS)
     PropertySlot slot(baseValue);
     JSValuePtr result = baseValue.get(callFrame, ident, slot);
 
-    ARG_globalData->interpreter->tryCTICacheGetByID(callFrame, callFrame->codeBlock(), STUB_RETURN_ADDRESS, baseValue, ident, slot);
+    tryCacheGetByID(callFrame, callFrame->codeBlock(), STUB_RETURN_ADDRESS, baseValue, ident, slot);
 
     CHECK_FOR_EXCEPTION_AT_END();
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_self_fail(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_self_fail(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -654,7 +633,7 @@ static PolymorphicAccessStructureList* getPolymorphicAccessStructureListSlot(Str
     return prototypeStructureList;
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_list(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_proto_list(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -715,7 +694,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_list(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_list_full(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_proto_list_full(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -727,7 +706,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_list_full(STUB_ARGS
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_fail(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_proto_fail(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -739,7 +718,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_proto_fail(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_array_fail(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_array_fail(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -751,7 +730,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_array_fail(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_string_fail(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_id_string_fail(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -765,7 +744,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_id_string_fail(STUB_ARGS)
 
 #endif
 
-JSValueEncodedAsPointer* Interpreter::cti_op_instanceof(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_instanceof(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -804,7 +783,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_instanceof(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_del_by_id(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_del_by_id(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -817,7 +796,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_del_by_id(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_mul(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_mul(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -835,14 +814,14 @@ JSValueEncodedAsPointer* Interpreter::cti_op_mul(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSObject* Interpreter::cti_op_new_func(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_func(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return ARG_func1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
 }
 
-void* Interpreter::cti_op_call_JSFunction(STUB_ARGS)
+void* JITStubs::cti_op_call_JSFunction(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -851,7 +830,7 @@ void* Interpreter::cti_op_call_JSFunction(STUB_ARGS)
     ASSERT(ARG_src1.getCallData(callData) == CallTypeJS);
 #endif
 
-    ScopeChainNode* callDataScopeChain = asFunction(ARG_src1)->m_scopeChain.node();
+    ScopeChainNode* callDataScopeChain = asFunction(ARG_src1)->scope().node();
     CodeBlock* newCodeBlock = &asFunction(ARG_src1)->body()->bytecode(callDataScopeChain);
 
     if (!newCodeBlock->jitCode())
@@ -860,7 +839,7 @@ void* Interpreter::cti_op_call_JSFunction(STUB_ARGS)
     return newCodeBlock;
 }
 
-VoidPtrPair Interpreter::cti_op_call_arityCheck(STUB_ARGS)
+VoidPtrPair JITStubs::cti_op_call_arityCheck(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -905,12 +884,12 @@ VoidPtrPair Interpreter::cti_op_call_arityCheck(STUB_ARGS)
     RETURN_PAIR(newCodeBlock, callFrame);
 }
 
-void* Interpreter::cti_vm_dontLazyLinkCall(STUB_ARGS)
+void* JITStubs::cti_vm_dontLazyLinkCall(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     JSFunction* callee = asFunction(ARG_src1);
-    CodeBlock* codeBlock = &callee->body()->bytecode(callee->m_scopeChain.node());
+    CodeBlock* codeBlock = &callee->body()->bytecode(callee->scope().node());
     if (!codeBlock->jitCode())
         JIT::compile(ARG_globalData, codeBlock);
 
@@ -919,12 +898,12 @@ void* Interpreter::cti_vm_dontLazyLinkCall(STUB_ARGS)
     return codeBlock->jitCode().addressForCall();
 }
 
-void* Interpreter::cti_vm_lazyLinkCall(STUB_ARGS)
+void* JITStubs::cti_vm_lazyLinkCall(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     JSFunction* callee = asFunction(ARG_src1);
-    CodeBlock* codeBlock = &callee->body()->bytecode(callee->m_scopeChain.node());
+    CodeBlock* codeBlock = &callee->body()->bytecode(callee->scope().node());
     if (!codeBlock->jitCode())
         JIT::compile(ARG_globalData, codeBlock);
 
@@ -934,7 +913,7 @@ void* Interpreter::cti_vm_lazyLinkCall(STUB_ARGS)
     return codeBlock->jitCode().addressForCall();
 }
 
-JSObject* Interpreter::cti_op_push_activation(STUB_ARGS)
+JSObject* JITStubs::cti_op_push_activation(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -943,7 +922,7 @@ JSObject* Interpreter::cti_op_push_activation(STUB_ARGS)
     return activation;
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_call_NotJSFunction(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_call_NotJSFunction(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -992,7 +971,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_call_NotJSFunction(STUB_ARGS)
     VM_THROW_EXCEPTION();
 }
 
-void Interpreter::cti_op_create_arguments(STUB_ARGS)
+void JITStubs::cti_op_create_arguments(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1001,7 +980,7 @@ void Interpreter::cti_op_create_arguments(STUB_ARGS)
     ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
 }
 
-void Interpreter::cti_op_create_arguments_no_params(STUB_ARGS)
+void JITStubs::cti_op_create_arguments_no_params(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1010,7 +989,7 @@ void Interpreter::cti_op_create_arguments_no_params(STUB_ARGS)
     ARG_callFrame[RegisterFile::ArgumentsRegister] = arguments;
 }
 
-void Interpreter::cti_op_tear_off_activation(STUB_ARGS)
+void JITStubs::cti_op_tear_off_activation(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1018,7 +997,7 @@ void Interpreter::cti_op_tear_off_activation(STUB_ARGS)
     asActivation(ARG_src1)->copyRegisters(ARG_callFrame->optionalCalleeArguments());
 }
 
-void Interpreter::cti_op_tear_off_arguments(STUB_ARGS)
+void JITStubs::cti_op_tear_off_arguments(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1026,7 +1005,7 @@ void Interpreter::cti_op_tear_off_arguments(STUB_ARGS)
     ARG_callFrame->optionalCalleeArguments()->copyRegisters();
 }
 
-void Interpreter::cti_op_profile_will_call(STUB_ARGS)
+void JITStubs::cti_op_profile_will_call(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1034,7 +1013,7 @@ void Interpreter::cti_op_profile_will_call(STUB_ARGS)
     (*ARG_profilerReference)->willExecute(ARG_callFrame, ARG_src1);
 }
 
-void Interpreter::cti_op_profile_did_call(STUB_ARGS)
+void JITStubs::cti_op_profile_did_call(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1042,7 +1021,7 @@ void Interpreter::cti_op_profile_did_call(STUB_ARGS)
     (*ARG_profilerReference)->didExecute(ARG_callFrame, ARG_src1);
 }
 
-void Interpreter::cti_op_ret_scopeChain(STUB_ARGS)
+void JITStubs::cti_op_ret_scopeChain(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1050,7 +1029,7 @@ void Interpreter::cti_op_ret_scopeChain(STUB_ARGS)
     ARG_callFrame->scopeChain()->deref();
 }
 
-JSObject* Interpreter::cti_op_new_array(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_array(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1058,7 +1037,7 @@ JSObject* Interpreter::cti_op_new_array(STUB_ARGS)
     return constructArray(ARG_callFrame, argList);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_resolve(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_resolve(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1086,7 +1065,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_resolve(STUB_ARGS)
     VM_THROW_EXCEPTION();
 }
 
-JSObject* Interpreter::cti_op_construct_JSConstruct(STUB_ARGS)
+JSObject* JITStubs::cti_op_construct_JSConstruct(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1099,11 +1078,11 @@ JSObject* Interpreter::cti_op_construct_JSConstruct(STUB_ARGS)
     if (ARG_src4.isObject())
         structure = asObject(ARG_src4)->inheritorID();
     else
-        structure = asFunction(ARG_src1)->m_scopeChain.node()->globalObject()->emptyObjectStructure();
+        structure = asFunction(ARG_src1)->scope().node()->globalObject()->emptyObjectStructure();
     return new (ARG_globalData) JSObject(structure);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_construct_NotJSConstruct(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_construct_NotJSConstruct(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1137,7 +1116,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_construct_NotJSConstruct(STUB_ARGS)
     VM_THROW_EXCEPTION();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_val(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_val(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1174,7 +1153,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_val(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_get_by_val_byte_array(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_get_by_val_byte_array(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
     
@@ -1205,7 +1184,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_get_by_val_byte_array(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-VoidPtrPair Interpreter::cti_op_resolve_func(STUB_ARGS)
+VoidPtrPair JITStubs::cti_op_resolve_func(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1247,7 +1226,7 @@ VoidPtrPair Interpreter::cti_op_resolve_func(STUB_ARGS)
     VM_THROW_EXCEPTION_2();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_sub(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_sub(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1265,7 +1244,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_sub(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-void Interpreter::cti_op_put_by_val(STUB_ARGS)
+void JITStubs::cti_op_put_by_val(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1313,7 +1292,7 @@ void Interpreter::cti_op_put_by_val(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-void Interpreter::cti_op_put_by_val_array(STUB_ARGS)
+void JITStubs::cti_op_put_by_val_array(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1341,7 +1320,7 @@ void Interpreter::cti_op_put_by_val_array(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-void Interpreter::cti_op_put_by_val_byte_array(STUB_ARGS)
+void JITStubs::cti_op_put_by_val_byte_array(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
     
@@ -1384,7 +1363,7 @@ void Interpreter::cti_op_put_by_val_byte_array(STUB_ARGS)
     CHECK_FOR_EXCEPTION_AT_END();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_lesseq(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_lesseq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1394,7 +1373,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_lesseq(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-int Interpreter::cti_op_loop_if_true(STUB_ARGS)
+int JITStubs::cti_op_loop_if_true(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1407,7 +1386,7 @@ int Interpreter::cti_op_loop_if_true(STUB_ARGS)
     return result;
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_negate(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_negate(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1423,14 +1402,14 @@ JSValueEncodedAsPointer* Interpreter::cti_op_negate(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_resolve_base(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_resolve_base(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(JSC::resolveBase(ARG_callFrame, *ARG_id1, ARG_callFrame->scopeChain()));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_resolve_skip(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_resolve_skip(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1463,7 +1442,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_resolve_skip(STUB_ARGS)
     VM_THROW_EXCEPTION();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_resolve_global(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_resolve_global(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1495,7 +1474,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_resolve_global(STUB_ARGS)
     VM_THROW_EXCEPTION();
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_div(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_div(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1513,7 +1492,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_div(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_pre_dec(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_pre_dec(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1525,7 +1504,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_pre_dec(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-int Interpreter::cti_op_jless(STUB_ARGS)
+int JITStubs::cti_op_jless(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1538,7 +1517,7 @@ int Interpreter::cti_op_jless(STUB_ARGS)
     return result;
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_not(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_not(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1551,7 +1530,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_not(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-int Interpreter::cti_op_jtrue(STUB_ARGS)
+int JITStubs::cti_op_jtrue(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1564,7 +1543,7 @@ int Interpreter::cti_op_jtrue(STUB_ARGS)
     return result;
 }
 
-VoidPtrPair Interpreter::cti_op_post_inc(STUB_ARGS)
+VoidPtrPair JITStubs::cti_op_post_inc(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1578,7 +1557,7 @@ VoidPtrPair Interpreter::cti_op_post_inc(STUB_ARGS)
     RETURN_PAIR(JSValuePtr::encode(number), JSValuePtr::encode(jsNumber(ARG_globalData, number.uncheckedGetNumber() + 1)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_eq(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_eq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1593,7 +1572,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_eq(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_lshift(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_lshift(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1613,7 +1592,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_lshift(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_bitand(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_bitand(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1631,7 +1610,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_bitand(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_rshift(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_rshift(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1651,7 +1630,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_rshift(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_bitnot(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_bitnot(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1667,7 +1646,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_bitnot(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-VoidPtrPair Interpreter::cti_op_resolve_with_base(STUB_ARGS)
+VoidPtrPair JITStubs::cti_op_resolve_with_base(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1701,14 +1680,14 @@ VoidPtrPair Interpreter::cti_op_resolve_with_base(STUB_ARGS)
     VM_THROW_EXCEPTION_2();
 }
 
-JSObject* Interpreter::cti_op_new_func_exp(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_func_exp(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return ARG_funcexp1->makeFunction(ARG_callFrame, ARG_callFrame->scopeChain());
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_mod(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_mod(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1722,7 +1701,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_mod(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_less(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_less(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1732,7 +1711,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_less(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_neq(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_neq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1747,7 +1726,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_neq(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-VoidPtrPair Interpreter::cti_op_post_dec(STUB_ARGS)
+VoidPtrPair JITStubs::cti_op_post_dec(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1761,7 +1740,7 @@ VoidPtrPair Interpreter::cti_op_post_dec(STUB_ARGS)
     RETURN_PAIR(JSValuePtr::encode(number), JSValuePtr::encode(jsNumber(ARG_globalData, number.uncheckedGetNumber() - 1)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_urshift(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_urshift(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1779,7 +1758,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_urshift(STUB_ARGS)
     }
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_bitxor(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_bitxor(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1793,14 +1772,14 @@ JSValueEncodedAsPointer* Interpreter::cti_op_bitxor(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSObject* Interpreter::cti_op_new_regexp(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_regexp(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return new (ARG_globalData) RegExpObject(ARG_callFrame->lexicalGlobalObject()->regExpStructure(), ARG_regexp1);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_bitor(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_bitor(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1814,7 +1793,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_bitor(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_call_eval(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_call_eval(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1845,7 +1824,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_call_eval(STUB_ARGS)
     return JSValuePtr::encode(jsImpossibleValue());
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_throw(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_throw(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1871,14 +1850,14 @@ JSValueEncodedAsPointer* Interpreter::cti_op_throw(STUB_ARGS)
     return JSValuePtr::encode(exceptionValue);
 }
 
-JSPropertyNameIterator* Interpreter::cti_op_get_pnames(STUB_ARGS)
+JSPropertyNameIterator* JITStubs::cti_op_get_pnames(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSPropertyNameIterator::create(ARG_callFrame, ARG_src1);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_next_pname(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_next_pname(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1889,7 +1868,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_next_pname(STUB_ARGS)
     return JSValuePtr::encode(temp);
 }
 
-JSObject* Interpreter::cti_op_push_scope(STUB_ARGS)
+JSObject* JITStubs::cti_op_push_scope(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1899,21 +1878,21 @@ JSObject* Interpreter::cti_op_push_scope(STUB_ARGS)
     return o;
 }
 
-void Interpreter::cti_op_pop_scope(STUB_ARGS)
+void JITStubs::cti_op_pop_scope(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     ARG_callFrame->setScopeChain(ARG_callFrame->scopeChain()->pop());
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_typeof(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_typeof(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsTypeStringForValue(ARG_callFrame, ARG_src1));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_undefined(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_undefined(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1921,42 +1900,42 @@ JSValueEncodedAsPointer* Interpreter::cti_op_is_undefined(STUB_ARGS)
     return JSValuePtr::encode(jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined()));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_boolean(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_boolean(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsBoolean(ARG_src1.isBoolean()));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_number(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_number(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsBoolean(ARG_src1.isNumber()));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_string(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_string(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsBoolean(ARG_globalData->interpreter->isJSString(ARG_src1)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_object(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_object(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsBoolean(jsIsObjectType(ARG_src1)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_is_function(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_is_function(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
     return JSValuePtr::encode(jsBoolean(jsIsFunctionType(ARG_src1)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_stricteq(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_stricteq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1966,7 +1945,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_stricteq(STUB_ARGS)
     return JSValuePtr::encode(jsBoolean(JSValuePtr::strictEqual(src1, src2)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_nstricteq(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_nstricteq(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1976,7 +1955,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_nstricteq(STUB_ARGS)
     return JSValuePtr::encode(jsBoolean(!JSValuePtr::strictEqual(src1, src2)));
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_to_jsnumber(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_to_jsnumber(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -1988,7 +1967,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_to_jsnumber(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_in(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_in(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2015,7 +1994,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_in(STUB_ARGS)
     return JSValuePtr::encode(jsBoolean(baseObj->hasProperty(callFrame, property)));
 }
 
-JSObject* Interpreter::cti_op_push_new_scope(STUB_ARGS)
+JSObject* JITStubs::cti_op_push_new_scope(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2026,7 +2005,7 @@ JSObject* Interpreter::cti_op_push_new_scope(STUB_ARGS)
     return scope;
 }
 
-void Interpreter::cti_op_jmp_scopes(STUB_ARGS)
+void JITStubs::cti_op_jmp_scopes(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2039,7 +2018,7 @@ void Interpreter::cti_op_jmp_scopes(STUB_ARGS)
     callFrame->setScopeChain(tmp);
 }
 
-void Interpreter::cti_op_put_by_index(STUB_ARGS)
+void JITStubs::cti_op_put_by_index(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2049,7 +2028,7 @@ void Interpreter::cti_op_put_by_index(STUB_ARGS)
     ARG_src1.put(callFrame, property, ARG_src3);
 }
 
-void* Interpreter::cti_op_switch_imm(STUB_ARGS)
+void* JITStubs::cti_op_switch_imm(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2069,7 +2048,7 @@ void* Interpreter::cti_op_switch_imm(STUB_ARGS)
     }
 }
 
-void* Interpreter::cti_op_switch_char(STUB_ARGS)
+void* JITStubs::cti_op_switch_char(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2089,7 +2068,7 @@ void* Interpreter::cti_op_switch_char(STUB_ARGS)
     return result;
 }
 
-void* Interpreter::cti_op_switch_string(STUB_ARGS)
+void* JITStubs::cti_op_switch_string(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2108,7 +2087,7 @@ void* Interpreter::cti_op_switch_string(STUB_ARGS)
     return result;
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_op_del_by_val(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_op_del_by_val(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2133,7 +2112,7 @@ JSValueEncodedAsPointer* Interpreter::cti_op_del_by_val(STUB_ARGS)
     return JSValuePtr::encode(result);
 }
 
-void Interpreter::cti_op_put_getter(STUB_ARGS)
+void JITStubs::cti_op_put_getter(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2145,7 +2124,7 @@ void Interpreter::cti_op_put_getter(STUB_ARGS)
     baseObj->defineGetter(callFrame, *ARG_id2, asObject(ARG_src3));
 }
 
-void Interpreter::cti_op_put_setter(STUB_ARGS)
+void JITStubs::cti_op_put_setter(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2157,7 +2136,7 @@ void Interpreter::cti_op_put_setter(STUB_ARGS)
     baseObj->defineSetter(callFrame, *ARG_id2, asObject(ARG_src3));
 }
 
-JSObject* Interpreter::cti_op_new_error(STUB_ARGS)
+JSObject* JITStubs::cti_op_new_error(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2171,7 +2150,7 @@ JSObject* Interpreter::cti_op_new_error(STUB_ARGS)
     return Error::create(callFrame, static_cast<ErrorType>(type), message.toString(callFrame), lineNumber, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL());
 }
 
-void Interpreter::cti_op_debug(STUB_ARGS)
+void JITStubs::cti_op_debug(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2184,7 +2163,7 @@ void Interpreter::cti_op_debug(STUB_ARGS)
     ARG_globalData->interpreter->debug(callFrame, static_cast<DebugHookID>(debugHookID), firstLine, lastLine);
 }
 
-JSValueEncodedAsPointer* Interpreter::cti_vm_throw(STUB_ARGS)
+JSValueEncodedAsPointer* JITStubs::cti_vm_throw(STUB_ARGS)
 {
     BEGIN_STUB_FUNCTION();
 
@@ -2222,6 +2201,6 @@ JSValueEncodedAsPointer* Interpreter::cti_vm_throw(STUB_ARGS)
 #undef VM_THROW_EXCEPTION_2
 #undef VM_THROW_EXCEPTION_AT_END
 
-#endif // ENABLE(JIT)
-
 } // namespace JSC
+
+#endif // ENABLE(JIT)
index 87ffd08..6122302 100644 (file)
 #ifndef JITStubs_h
 #define JITStubs_h
 
+#include "Register.h"
+#include <wtf/Platform.h>
+
+#if ENABLE(JIT)
+
 namespace JSC {
 
+    class JSObject;
+    class JSPropertyNameIterator;
+    class JSValueEncodedAsPointer;
+    class CodeBlock;
+    class JSValuePtr;
+    class Identifier;
+    class PropertySlot;
+    class PutPropertySlot;
+
+#if USE(JIT_STUB_ARGUMENT_VA_LIST)
+    #define STUB_ARGS void* args, ...
+    #define ARGS (reinterpret_cast<void**>(vl_args) - 1)
+#else // JIT_STUB_ARGUMENT_REGISTER or JIT_STUB_ARGUMENT_STACK
+    #define STUB_ARGS void** args
+    #define ARGS (args)
+#endif
+
+#if USE(JIT_STUB_ARGUMENT_REGISTER)
+    #if PLATFORM(X86_64)
+    #define JIT_STUB
+    #elif COMPILER(MSVC)
+    #define JIT_STUB __fastcall
+    #elif COMPILER(GCC)
+    #define JIT_STUB  __attribute__ ((fastcall))
+    #else
+    #error Need to support register calling convention in this compiler
+    #endif
+#else // JIT_STUB_ARGUMENT_VA_LIST or JIT_STUB_ARGUMENT_STACK
+    #if COMPILER(MSVC)
+    #define JIT_STUB __cdecl
+    #else
+    #define JIT_STUB
+    #endif
+#endif
+
+// The Mac compilers are fine with this, 
+#if PLATFORM(MAC)
+    struct VoidPtrPair {
+        void* first;
+        void* second;
+    };
+#define RETURN_PAIR(a,b) VoidPtrPair pair = { a, b }; return pair
+#else
+    typedef uint64_t VoidPtrPair;
+    union VoidPtrPairValue {
+        struct { void* first; void* second; } s;
+        VoidPtrPair i;
+    };
+#define RETURN_PAIR(a,b) VoidPtrPairValue pair = {{ a, b }}; return pair.i
+#endif
+
+    struct JITStubs {
+        static JSObject* JIT_STUB cti_op_construct_JSConstruct(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_convert_this(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_array(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_error(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_func(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_func_exp(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_object(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_new_regexp(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_push_activation(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_push_new_scope(STUB_ARGS);
+        static JSObject* JIT_STUB cti_op_push_scope(STUB_ARGS);
+        static JSPropertyNameIterator* JIT_STUB cti_op_get_pnames(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_add(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitand(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitnot(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitor(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_bitxor(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_call_NotJSFunction(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_call_eval(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_construct_NotJSConstruct(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_del_by_id(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_del_by_val(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_div(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_eq(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_array_fail(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_generic(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_fail(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_list(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_proto_list_full(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_second(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_self_fail(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_id_string_fail(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_get_by_val_byte_array(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_in(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_instanceof(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_boolean(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_function(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_number(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_object(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_string(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_is_undefined(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_less(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_lesseq(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_lshift(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_mod(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_mul(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_negate(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_neq(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_next_pname(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_not(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_nstricteq(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_pre_dec(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_pre_inc(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_base(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_global(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_resolve_skip(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_rshift(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_stricteq(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_sub(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_throw(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_to_jsnumber(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_typeof(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_op_urshift(STUB_ARGS);
+        static JSValueEncodedAsPointer* JIT_STUB cti_vm_throw(STUB_ARGS);
+        static VoidPtrPair JIT_STUB cti_op_call_arityCheck(STUB_ARGS);
+        static VoidPtrPair JIT_STUB cti_op_post_dec(STUB_ARGS);
+        static VoidPtrPair JIT_STUB cti_op_post_inc(STUB_ARGS);
+        static VoidPtrPair JIT_STUB cti_op_resolve_func(STUB_ARGS);
+        static VoidPtrPair JIT_STUB cti_op_resolve_with_base(STUB_ARGS);
+        static int JIT_STUB cti_op_jless(STUB_ARGS);
+        static int JIT_STUB cti_op_jtrue(STUB_ARGS);
+        static int JIT_STUB cti_op_loop_if_less(STUB_ARGS);
+        static int JIT_STUB cti_op_loop_if_lesseq(STUB_ARGS);
+        static int JIT_STUB cti_op_loop_if_true(STUB_ARGS);
+        static int JIT_STUB cti_timeout_check(STUB_ARGS);
+        static void JIT_STUB cti_op_create_arguments(STUB_ARGS);
+        static void JIT_STUB cti_op_create_arguments_no_params(STUB_ARGS);
+        static void JIT_STUB cti_op_debug(STUB_ARGS);
+        static void JIT_STUB cti_op_end(STUB_ARGS);
+        static void JIT_STUB cti_op_jmp_scopes(STUB_ARGS);
+        static void JIT_STUB cti_op_pop_scope(STUB_ARGS);
+        static void JIT_STUB cti_op_profile_did_call(STUB_ARGS);
+        static void JIT_STUB cti_op_profile_will_call(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_id(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_id_fail(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_id_generic(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_id_second(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_index(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_val(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_val_array(STUB_ARGS);
+        static void JIT_STUB cti_op_put_by_val_byte_array(STUB_ARGS);
+        static void JIT_STUB cti_op_put_getter(STUB_ARGS);
+        static void JIT_STUB cti_op_put_setter(STUB_ARGS);
+        static void JIT_STUB cti_op_ret_scopeChain(STUB_ARGS);
+        static void JIT_STUB cti_op_tear_off_activation(STUB_ARGS);
+        static void JIT_STUB cti_op_tear_off_arguments(STUB_ARGS);
+        static void JIT_STUB cti_register_file_check(STUB_ARGS);
+        static void* JIT_STUB cti_op_call_JSFunction(STUB_ARGS);
+        static void* JIT_STUB cti_op_switch_char(STUB_ARGS);
+        static void* JIT_STUB cti_op_switch_imm(STUB_ARGS);
+        static void* JIT_STUB cti_op_switch_string(STUB_ARGS);
+        static void* JIT_STUB cti_vm_dontLazyLinkCall(STUB_ARGS);
+        static void* JIT_STUB cti_vm_lazyLinkCall(STUB_ARGS);
+
+        static void tryCacheGetByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const Identifier& propertyName, const PropertySlot&);
+        static void tryCachePutByID(CallFrame*, CodeBlock*, void* returnAddress, JSValuePtr baseValue, const PutPropertySlot&);
+    };
+
 } // namespace JSC
 
+#endif // ENABLE(JIT)
+
 #endif // JITStubs_h
index 6a43737..47ddb20 100644 (file)
@@ -38,8 +38,9 @@ namespace JSC {
     class JSGlobalObject;
 
     class JSFunction : public InternalFunction {
-        friend class JIT;
         friend class Interpreter;
+        friend class JIT;
+        friend class JITStubs;
 
         typedef InternalFunction Base;
 
index 10b584d..91be6a8 100644 (file)
@@ -65,9 +65,11 @@ extern const HashTable regExpConstructorTable;
 extern const HashTable stringTable;
 
 JSGlobalData::JSGlobalData(bool isShared)
-    : initializingLazyNumericCompareFunction(false)
+    : isSharedInstance(isShared)
+    , clientData(0)
     , interpreter(new Interpreter)
     , exception(noValue())
+    , initializingLazyNumericCompareFunction(false)
     , arrayTable(new HashTable(JSC::arrayTable))
     , dateTable(new HashTable(JSC::dateTable))
     , mathTable(new HashTable(JSC::mathTable))
@@ -87,14 +89,12 @@ JSGlobalData::JSGlobalData(bool isShared)
     , identifierTable(createIdentifierTable())
     , propertyNames(new CommonIdentifiers(this))
     , emptyList(new ArgList)
-    , newParserObjects(0)
-    , parserObjectExtraRefCounts(0)
     , lexer(new Lexer(this))
     , parser(new Parser)
+    , newParserObjects(0)
+    , parserObjectExtraRefCounts(0)
     , head(0)
     , dynamicGlobalObject(0)
-    , isSharedInstance(isShared)
-    , clientData(0)
     , scopeNodeBeingReparsed(0)
     , heap(this)
 {
index 4223191..5716b33 100644 (file)
 #ifndef JSGlobalData_h
 #define JSGlobalData_h
 
-#include <wtf/Forward.h>
-#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
 #include "Collector.h"
 #include "ExecutableAllocator.h"
-#include "SmallStrings.h"
 #include "JSValue.h"
+#include "SmallStrings.h"
+#include "TimeoutChecker.h"
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/RefCounted.h>
 
 struct OpaqueJSClass;
 struct OpaqueJSClassContextData;
@@ -60,6 +61,10 @@ namespace JSC {
 
     class JSGlobalData : public RefCounted<JSGlobalData> {
     public:
+        struct ClientData {
+            virtual ~ClientData() = 0;
+        };
+
         static bool sharedInstanceExists();
         static JSGlobalData& sharedInstance();
 
@@ -72,17 +77,21 @@ namespace JSC {
         void makeUsableFromMultipleThreads() { heap.makeUsableFromMultipleThreads(); }
 #endif
 
-        const Vector<Instruction>& numericCompareFunction(ExecState*);
-        Vector<Instruction> lazyNumericCompareFunction;
-        bool initializingLazyNumericCompareFunction;
+        bool isSharedInstance;
+        ClientData* clientData;
 
         Interpreter* interpreter;
+        TimeoutChecker timeoutChecker;
 
         JSValuePtr exception;
 #if ENABLE(JIT)
         void* exceptionLocation;
 #endif
 
+        const Vector<Instruction>& numericCompareFunction(ExecState*);
+        Vector<Instruction> lazyNumericCompareFunction;
+        bool initializingLazyNumericCompareFunction;
+
         const HashTable* arrayTable;
         const HashTable* dateTable;
         const HashTable* mathTable;
@@ -104,28 +113,18 @@ namespace JSC {
         IdentifierTable* identifierTable;
         CommonIdentifiers* propertyNames;
         const ArgList* emptyList; // Lists are supposed to be allocated on the stack to have their elements properly marked, which is not the case here - but this list has nothing to mark.
-
         SmallStrings smallStrings;
         
         HashMap<OpaqueJSClass*, OpaqueJSClassContextData*> opaqueJSClassData;
 
-        HashSet<ParserRefCounted*>* newParserObjects;
-        HashCountedSet<ParserRefCounted*>* parserObjectExtraRefCounts;
-
         Lexer* lexer;
         Parser* parser;
+        HashSet<ParserRefCounted*>* newParserObjects;
+        HashCountedSet<ParserRefCounted*>* parserObjectExtraRefCounts;
 
         JSGlobalObject* head;
         JSGlobalObject* dynamicGlobalObject;
 
-        bool isSharedInstance;
-
-        struct ClientData {
-            virtual ~ClientData() = 0;
-        };
-
-        ClientData* clientData;
-
         HashSet<JSObject*> arrayVisitedElements;
 
         ScopeNode* scopeNodeBeingReparsed;
@@ -134,6 +133,7 @@ namespace JSC {
 #if ENABLE(ASSEMBLER)
         PassRefPtr<ExecutablePool> poolForSize(size_t n) { return m_executableAllocator.poolForSize(n); }
 #endif
+
     private:
         JSGlobalData(bool isShared = false);
 #if ENABLE(ASSEMBLER)
@@ -142,7 +142,6 @@ namespace JSC {
 
         static JSGlobalData*& sharedInstanceInternal();
     };
+} // namespace JSC
 
-}
-
-#endif
+#endif // JSGlobalData_h
index eb2b349..3b71f87 100644 (file)
@@ -344,21 +344,6 @@ void JSGlobalObject::resetPrototype(JSValuePtr prototype)
     lastInPrototypeChain(this)->setPrototype(d()->objectPrototype);
 }
 
-void JSGlobalObject::setTimeoutTime(unsigned timeoutTime)
-{
-    globalData()->interpreter->setTimeoutTime(timeoutTime);
-}
-
-void JSGlobalObject::startTimeoutCheck()
-{
-    globalData()->interpreter->startTimeoutCheck();
-}
-
-void JSGlobalObject::stopTimeoutCheck()
-{
-    globalData()->interpreter->stopTimeoutCheck();
-}
-
 void JSGlobalObject::mark()
 {
     JSVariableObject::mark();
index 4a10f64..da8b7bf 100644 (file)
@@ -214,10 +214,6 @@ namespace JSC {
         void setProfileGroup(unsigned value) { d()->profileGroup = value; }
         unsigned profileGroup() const { return d()->profileGroup; }
 
-        void setTimeoutTime(unsigned timeoutTime);
-        void startTimeoutCheck();
-        void stopTimeoutCheck();
-
         Debugger* debugger() const { return d()->debugger; }
         void setDebugger(Debugger* debugger) { d()->debugger = debugger; }
         
diff --git a/JavaScriptCore/runtime/TimeoutChecker.cpp b/JavaScriptCore/runtime/TimeoutChecker.cpp
new file mode 100644 (file)
index 0000000..30ba6e9
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TimeoutChecker.h"
+
+#include "CallFrame.h"
+#include "JSGlobalObject.h"
+
+#if PLATFORM(DARWIN)
+#include <mach/mach.h>
+#endif
+
+#if HAVE(SYS_TIME_H)
+#include <sys/time.h>
+#endif
+
+#if PLATFORM(WIN_OS)
+#include <windows.h>
+#endif
+
+#if PLATFORM(QT)
+#include <QDateTime>
+#endif
+
+using namespace std;
+
+namespace JSC {
+
+// Number of ticks before the first timeout check is done.
+static const int ticksUntilFirstCheck = 1024;
+
+// Number of milliseconds between each timeout check.
+static const int intervalBetweenChecks = 1000;
+
+// Returns the time the current thread has spent executing, in milliseconds.
+static inline unsigned getCPUTime()
+{
+#if PLATFORM(DARWIN)
+    mach_msg_type_number_t infoCount = THREAD_BASIC_INFO_COUNT;
+    thread_basic_info_data_t info;
+
+    // Get thread information
+    mach_port_t threadPort = mach_thread_self();
+    thread_info(threadPort, THREAD_BASIC_INFO, reinterpret_cast<thread_info_t>(&info), &infoCount);
+    mach_port_deallocate(mach_task_self(), threadPort);
+    
+    unsigned time = info.user_time.seconds * 1000 + info.user_time.microseconds / 1000;
+    time += info.system_time.seconds * 1000 + info.system_time.microseconds / 1000;
+    
+    return time;
+#elif HAVE(SYS_TIME_H)
+    // FIXME: This should probably use getrusage with the RUSAGE_THREAD flag.
+    struct timeval tv;
+    gettimeofday(&tv, 0);
+    return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+#elif PLATFORM(QT)
+    QDateTime t = QDateTime::currentDateTime();
+    return t.toTime_t() * 1000 + t.time().msec();
+#elif PLATFORM(WIN_OS)
+    union {
+        FILETIME fileTime;
+        unsigned long long fileTimeAsLong;
+    } userTime, kernelTime;
+    
+    // GetThreadTimes won't accept NULL arguments so we pass these even though
+    // they're not used.
+    FILETIME creationTime, exitTime;
+    
+    GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime.fileTime, &userTime.fileTime);
+    
+    return userTime.fileTimeAsLong / 10000 + kernelTime.fileTimeAsLong / 10000;
+#else
+#error Platform does not have getCurrentTime function
+#endif
+}
+
+TimeoutChecker::TimeoutChecker()
+    : m_timeoutInterval(0)
+    , m_startCount(0)
+{
+    reset();
+}
+
+void TimeoutChecker::reset()
+{
+    m_ticksUntilNextCheck = ticksUntilFirstCheck;
+    m_timeAtLastCheck = 0;
+    m_timeExecuting = 0;
+}
+
+bool TimeoutChecker::didTimeOut(ExecState* exec)
+{
+    unsigned currentTime = getCPUTime();
+    
+    if (!m_timeAtLastCheck) {
+        // Suspicious amount of looping in a script -- start timing it
+        m_timeAtLastCheck = currentTime;
+        return false;
+    }
+    
+    unsigned timeDiff = currentTime - m_timeAtLastCheck;
+    
+    if (timeDiff == 0)
+        timeDiff = 1;
+    
+    m_timeExecuting += timeDiff;
+    m_timeAtLastCheck = currentTime;
+    
+    // Adjust the tick threshold so we get the next checkTimeout call in the
+    // interval specified in intervalBetweenChecks.
+    m_ticksUntilNextCheck = static_cast<unsigned>((static_cast<float>(intervalBetweenChecks) / timeDiff) * m_ticksUntilNextCheck);
+    // If the new threshold is 0 reset it to the default threshold. This can happen if the timeDiff is higher than the
+    // preferred script check time interval.
+    if (m_ticksUntilNextCheck == 0)
+        m_ticksUntilNextCheck = ticksUntilFirstCheck;
+    
+    if (m_timeoutInterval && m_timeExecuting > m_timeoutInterval) {
+        if (exec->dynamicGlobalObject()->shouldInterruptScript())
+            return true;
+        
+        reset();
+    }
+    
+    return false;
+}
+
+} // namespace JSC
diff --git a/JavaScriptCore/runtime/TimeoutChecker.h b/JavaScriptCore/runtime/TimeoutChecker.h
new file mode 100644 (file)
index 0000000..7bfa6d0
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TimeoutChecker_h
+#define TimeoutChecker_h
+
+#include <wtf/Assertions.h>
+
+namespace JSC {
+
+    class ExecState;
+
+    class TimeoutChecker {
+    public:
+        TimeoutChecker();
+
+        void setTimeoutInterval(unsigned timeoutInterval) { m_timeoutInterval = timeoutInterval; }
+        
+        unsigned ticksUntilNextCheck() { return m_ticksUntilNextCheck; }
+        
+        void start()
+        {
+            if (!m_startCount)
+                reset();
+            ++m_startCount;
+        }
+
+        void stop()
+        {
+            ASSERT(m_startCount);
+            --m_startCount;
+        }
+
+        void reset();
+
+        bool didTimeOut(ExecState*);
+
+    private:
+        unsigned m_timeoutInterval;
+        unsigned m_timeAtLastCheck;
+        unsigned m_timeExecuting;
+        unsigned m_startCount;
+        unsigned m_ticksUntilNextCheck;
+    };
+
+} // namespace JSC
+
+#endif // TimeoutChecker_h
index dacff45..ed05940 100644 (file)
@@ -1,3 +1,49 @@
+2009-02-20  Geoffrey Garen  <ggaren@apple.com>
+
+        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):
+
 2009-02-21  Hironori Bono  <hbono@chromium.org>
 
         Reviewed by Alexey Proskuryakov.
index 54c0af5..7260b22 100644 (file)
@@ -73,9 +73,9 @@ void JSCustomPositionCallback::handleEvent(Geoposition* geoposition, bool& raise
     ArgList args;
     args.append(toJS(exec, geoposition));
     
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     call(exec, function, callType, callData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
     
     if (exec->hadException()) {
         reportCurrentException(exec);
index 2dfb1d9..fac6095 100644 (file)
@@ -73,9 +73,9 @@ void JSCustomPositionErrorCallback::handleEvent(PositionError* positionError)
     ArgList args;
     args.append(toJS(exec, positionError));
     
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     call(exec, function, callType, callData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
     
     if (exec->hadException())
         reportCurrentException(exec);
index f61306c..1fe6940 100644 (file)
@@ -78,9 +78,9 @@ void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLR
     args.append(toJS(exec, transaction));
     args.append(toJS(exec, resultSet));
         
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     call(exec, function, callType, callData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
 
     if (exec->hadException()) {
         reportCurrentException(exec);
index 0d27de7..1240efc 100644 (file)
@@ -81,12 +81,12 @@ bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction,
     args.append(toJS(exec, error));
         
     JSValuePtr result;
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     if (handleEventCallType != CallTypeNone)
         result = call(exec, handleEventFunction, handleEventCallType, handleEventCallData, m_callback, args);
     else
         result = call(exec, m_callback, callbackCallType, callbackCallData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
         
     if (exec->hadException()) {
         reportCurrentException(exec);
index d6187bc..8a24f5d 100644 (file)
@@ -120,12 +120,12 @@ void JSCustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bo
     ArgList args;
     args.append(toJS(exec, transaction));
 
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     if (handleEventCallType != CallTypeNone)
         call(exec, handleEventFunction, handleEventCallType, handleEventCallData, m_data->callback(), args);
     else
         call(exec, m_data->callback(), callbackCallType, callbackCallData, m_data->callback(), args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
         
     if (exec->hadException()) {
         reportCurrentException(exec);
index 5c8b8d4..036d715 100644 (file)
@@ -77,9 +77,9 @@ bool JSCustomSQLTransactionErrorCallback::handleEvent(SQLError* error)
     args.append(toJS(exec, error));
 
     JSValuePtr result;
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     result = call(exec, function, callType, callData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
         
     if (exec->hadException())
         reportCurrentException(exec);
index 60b3777..621e539 100644 (file)
@@ -76,9 +76,9 @@ void JSCustomVoidCallback::handleEvent()
         
     ArgList args;
     
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     call(exec, function, callType, callData, m_callback, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
         
     if (exec->hadException())
         reportCurrentException(exec);
index 6796af6..f6bd241 100644 (file)
@@ -99,9 +99,9 @@ String JSCustomXPathNSResolver::lookupNamespaceURI(const String& prefix)
     ArgList args;
     args.append(jsString(exec, prefix));
 
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     JSValuePtr retval = call(exec, function, callType, callData, m_customResolver, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
 
     String result;
     if (exec->hadException())
index 7477a78..d59c17d 100644 (file)
@@ -137,9 +137,6 @@ JSDOMWindowBase::JSDOMWindowBaseData::JSDOMWindowBaseData(PassRefPtr<DOMWindow>
 JSDOMWindowBase::JSDOMWindowBase(PassRefPtr<Structure> structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
     : JSDOMGlobalObject(structure, new JSDOMWindowBaseData(window, shell), shell)
 {
-    // Time in milliseconds before the script timeout handler kicks in.
-    setTimeoutTime(10000);
-
     GlobalPropertyInfo staticGlobals[] = {
         GlobalPropertyInfo(Identifier(globalExec(), "document"), jsNull(), DontDelete | ReadOnly),
         GlobalPropertyInfo(Identifier(globalExec(), "window"), d()->shell, DontDelete | ReadOnly)
@@ -741,7 +738,12 @@ JSDOMWindowShell* JSDOMWindowBase::shell() const
 
 JSGlobalData* JSDOMWindowBase::commonJSGlobalData()
 {
-    static JSGlobalData* globalData = JSGlobalData::createLeaked().releaseRef();
+    static JSGlobalData* globalData;
+    if (!globalData) {
+        globalData = JSGlobalData::createLeaked().releaseRef();
+        globalData->timeoutChecker.setTimeoutInterval(10000); // 10 seconds
+    }
+
     return globalData;
 }
 
index a91c8de..81e0c2d 100644 (file)
@@ -103,7 +103,7 @@ void JSAbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
 
         JSValuePtr retval;
         if (handleEventFunction) {
-            globalObject->startTimeoutCheck();
+            globalObject->globalData()->timeoutChecker.start();
             retval = call(exec, handleEventFunction, callType, callData, listener, args);
         } else {
             JSValuePtr thisValue;
@@ -111,10 +111,10 @@ void JSAbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
                 thisValue = globalObject->toThisObject(exec);
             else
                 thisValue = toJS(exec, event->currentTarget());
-            globalObject->startTimeoutCheck();
+            globalObject->globalData()->timeoutChecker.start();
             retval = call(exec, listener, callType, callData, thisValue, args);
         }
-        globalObject->stopTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.stop();
 
         globalObject->setCurrentEvent(savedEvent);
 
index b9c1223..3b8b6fa 100644 (file)
@@ -84,9 +84,9 @@ void ScheduledAction::executeFunctionInContext(JSGlobalObject* globalObject, JSV
     for (size_t i = 0; i < size; ++i)
         args.append(m_args[i]);
 
-    globalObject->startTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.start();
     call(exec, m_function, callType, callData, thisValue, args);
-    globalObject->stopTimeoutCheck();
+    globalObject->globalData()->timeoutChecker.stop();
 
     if (exec->hadException())
         reportCurrentException(exec);
index e492c72..4b5122e 100644 (file)
@@ -110,9 +110,9 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode)
     // so we start the keep alive timer here.
     m_frame->keepAlive();
 
-    m_windowShell->window()->startTimeoutCheck();
+    m_windowShell->window()->globalData()->timeoutChecker.start();
     Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), jsSourceCode, m_windowShell);
-    m_windowShell->window()->stopTimeoutCheck();
+    m_windowShell->window()->globalData()->timeoutChecker.stop();
 
     if (comp.complType() == Normal || comp.complType() == ReturnValue) {
         m_sourceURL = savedSourceURL;
index 01409d5..b51b94d 100644 (file)
@@ -85,9 +85,9 @@ ScriptValue WorkerScriptController::evaluate(const ScriptSourceCode& sourceCode)
     JSLock lock(false);
 
     ExecState* exec = m_workerContextWrapper->globalExec();
-    m_workerContextWrapper->startTimeoutCheck();
+    m_workerContextWrapper->globalData()->timeoutChecker.start();
     Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper);
-    m_workerContextWrapper->stopTimeoutCheck();
+    m_workerContextWrapper->globalData()->timeoutChecker.stop();
 
     m_workerContext->thread()->workerObjectProxy()->reportPendingActivity(m_workerContext->hasPendingActivity());
 
@@ -107,7 +107,7 @@ void WorkerScriptController::forbidExecution()
     // It is not critical for Interpreter::m_timeoutTime to be synchronized, we just rely on it reaching the worker thread's processor sooner or later.
     MutexLocker lock(m_sharedDataMutex);
     m_executionForbidden = true;
-    m_globalData->interpreter->setTimeoutTime(1); // 1 ms is the smallest timeout that can be set.
+    m_globalData->timeoutChecker.setTimeoutInterval(1); // 1ms is the smallest timeout that can be set.
 }
 
 } // namespace WebCore
index f08d61b..3cdae86 100644 (file)
@@ -298,9 +298,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
     if (![self _isSafeScript])
         return nil;
 
-    [self _rootObject]->globalObject()->startTimeoutCheck();
+    [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
     JSValuePtr result = call(exec, function, callType, callData, [self _imp], argList);
-    [self _rootObject]->globalObject()->stopTimeoutCheck();
+    [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
 
     if (exec->hadException()) {
         addExceptionToConsole(exec);
@@ -327,9 +327,9 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
     JSValuePtr result;
     JSLock lock(false);
     
-    [self _rootObject]->globalObject()->startTimeoutCheck();
+    [self _rootObject]->globalObject()->globalData()->timeoutChecker.start();
     Completion completion = JSC::evaluate([self _rootObject]->globalObject()->globalExec(), [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)));
-    [self _rootObject]->globalObject()->stopTimeoutCheck();
+    [self _rootObject]->globalObject()->globalData()->timeoutChecker.stop();
     ComplType type = completion.complType();
     
     if (type == Normal) {
index b82bb72..1173c72 100644 (file)
@@ -122,9 +122,9 @@ bool _NPN_InvokeDefault(NPP, NPObject* o, const NPVariant* args, uint32_t argCou
         ArgList argList;
         getListFromVariantArgs(exec, args, argCount, rootObject, argList);
         ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
-        globalObject->startTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.start();
         JSValuePtr resultV = call(exec, function, callType, callData, function, argList);
-        globalObject->stopTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.stop();
 
         // Convert and return the result of the function call.
         convertValueToNPVariant(exec, resultV, result);
@@ -172,9 +172,9 @@ bool _NPN_Invoke(NPP npp, NPObject* o, NPIdentifier methodName, const NPVariant*
         ArgList argList;
         getListFromVariantArgs(exec, args, argCount, rootObject, argList);
         ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
-        globalObject->startTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.start();
         JSValuePtr resultV = call(exec, function, callType, callData, obj->imp, argList);
-        globalObject->stopTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.stop();
 
         // Convert and return the result of the function call.
         convertValueToNPVariant(exec, resultV, result);
@@ -202,9 +202,9 @@ bool _NPN_Evaluate(NPP, NPObject* o, NPString* s, NPVariant* variant)
         JSLock lock(false);
         String scriptString = convertNPStringToUTF16(s);
         ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
-        globalObject->startTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.start();
         Completion completion = JSC::evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(scriptString));
-        globalObject->stopTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.stop();
         ComplType type = completion.complType();
         
         JSValuePtr result;
@@ -442,9 +442,9 @@ bool _NPN_Construct(NPP, NPObject* o, const NPVariant* args, uint32_t argCount,
         ArgList argList;
         getListFromVariantArgs(exec, args, argCount, rootObject, argList);
         ProtectedPtr<JSGlobalObject> globalObject = rootObject->globalObject();
-        globalObject->startTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.start();
         JSValuePtr resultV = construct(exec, constructor, constructType, constructData, argList);
-        globalObject->stopTimeoutCheck();
+        globalObject->globalData()->timeoutChecker.stop();
         
         // Convert and return the result.
         convertValueToNPVariant(exec, resultV, result);
index 301d672..3689840 100644 (file)
@@ -302,9 +302,9 @@ jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
     // Call the function object.
     ArgList argList;
     getListFromJArray(exec, args, argList);
-    rootObject->globalObject()->startTimeoutCheck();
+    rootObject->globalObject()->globalData()->timeoutChecker.start();
     JSValuePtr result = JSC::call(exec, function, callType, callData, _imp, argList);
-    rootObject->globalObject()->stopTimeoutCheck();
+    rootObject->globalObject()->globalData()->timeoutChecker.stop();
 
     return convertValueToJObject(result);
 }
@@ -321,9 +321,9 @@ jobject JavaJSObject::eval(jstring script) const
     if (!rootObject)
         return 0;
 
-    rootObject->globalObject()->startTimeoutCheck();
+    rootObject->globalObject()->globalData()->timeoutChecker.start();
     Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script)));
-    rootObject->globalObject()->stopTimeoutCheck();
+    rootObject->globalObject()->globalData()->timeoutChecker.stop();
     ComplType type = completion.complType();
     
     if (type == Normal) {