Ignore:
Timestamp:
Aug 28, 2013, 5:28:42 PM (12 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=119548
Refactoring Exception throws.

Patch by Chris Curtis <[email protected]> on 2013-08-28
Reviewed by Geoffrey Garen.

Gardening of exception throws. The act of throwing an exception was being handled in
different ways depending on whether the code was running in the LLint, Baseline JIT,
or the DFG Jit. This made development in the vm exception and error objects difficult.

  • runtime/VM.cpp:

(JSC::appendSourceToError):
This function moved from the interpreter into the VM. It views the developers code
(if there is a codeBlock) to extract what was trying to be evaluated when the error
occurred.

(JSC::VM::throwException):
This function takes in the error object and sets the following:

1: The VM's exception stack
2: The VM's exception
3: Appends extra information on the error message(via appendSourceToError)
4: The error object's line number
5: The error object's column number
6: The error object's sourceURL
7: The error object's stack trace (unless it already exists because the developer

created the error object).

(JSC::VM::getExceptionInfo):
(JSC::VM::setExceptionInfo):
(JSC::VM::clearException):
(JSC::clearExceptionStack):

  • runtime/VM.h:

(JSC::VM::exceptionOffset):
(JSC::VM::exception):
(JSC::VM::addressOfException):
(JSC::VM::exceptionStack):
VM exception and exceptionStack are now private data members.

  • interpreter/Interpreter.h:

(JSC::ClearExceptionScope::ClearExceptionScope):
Created this structure to temporarily clear the exception within the VM. This
needed to see if addition errors occur when setting the debugger as we are
unwinding the stack.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::unwind):
Removed the code that would try to add error information if it did not exist.
All of this functionality has moved into the VM and all error information is set
at the time the error occurs.

The rest of these functions reference the new calling convention to throw an error.

  • API/APICallbackFunction.h:

(JSC::APICallbackFunction::call):

  • API/JSCallbackConstructor.cpp:

(JSC::constructJSCallback):

  • API/JSCallbackObjectFunctions.h:

(JSC::::getOwnPropertySlot):
(JSC::::defaultValue):
(JSC::::put):
(JSC::::putByIndex):
(JSC::::deleteProperty):
(JSC::::construct):
(JSC::::customHasInstance):
(JSC::::call):
(JSC::::getStaticValue):
(JSC::::staticFunctionGetter):
(JSC::::callbackGetter):

  • debugger/Debugger.cpp:

(JSC::evaluateInGlobalCallFrame):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::evaluate):

  • dfg/DFGAssemblyHelpers.h:

(JSC::DFG::AssemblyHelpers::emitExceptionCheck):

  • dfg/DFGOperations.cpp:

(JSC::DFG::operationPutByValInternal):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::callCheck):

  • heap/Heap.cpp:

(JSC::Heap::markRoots):

  • interpreter/CallFrame.h:

(JSC::ExecState::clearException):
(JSC::ExecState::exception):
(JSC::ExecState::hadException):

  • interpreter/Interpreter.cpp:

(JSC::eval):
(JSC::loadVarargs):
(JSC::stackTraceAsString):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):

  • interpreter/Interpreter.h:

(JSC::ClearExceptionScope::ClearExceptionScope):

  • jit/JITCode.cpp:

(JSC::JITCode::execute):

  • jit/JITExceptions.cpp:

(JSC::genericThrow):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_catch):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTINativeCall):
(JSC::JIT::emit_op_catch):

  • jit/JITStubs.cpp:

(JSC::returnToThrowTrampoline):
(JSC::throwExceptionFromOpCall):
(JSC::DEFINE_STUB_FUNCTION):
(JSC::jitCompileFor):
(JSC::lazyLinkFor):
(JSC::putByVal):
(JSC::cti_vm_handle_exception):

  • jit/SlowPathCall.h:

(JSC::JITSlowPathCall::call):

  • jit/ThunkGenerators.cpp:

(JSC::nativeForGenerator):

  • jsc.cpp:

(functionRun):
(functionLoad):
(functionCheckSyntax):

  • llint/LLIntExceptions.cpp:

(JSC::LLInt::doThrow):
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.cpp:

(JSC::CLoop::execute):

  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • runtime/ArrayConstructor.cpp:

(JSC::constructArrayWithSizeQuirk):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::opIn):

  • runtime/CommonSlowPathsExceptions.cpp:

(JSC::CommonSlowPaths::interpreterThrowInCaller):

  • runtime/Completion.cpp:

(JSC::evaluate):

  • runtime/Error.cpp:

(JSC::addErrorInfo):
(JSC::throwTypeError):
(JSC::throwSyntaxError):

  • runtime/Error.h:

(JSC::throwVMError):

  • runtime/ExceptionHelpers.cpp:

(JSC::throwOutOfMemoryError):
(JSC::throwStackOverflowError):
(JSC::throwTerminatedExecutionException):

  • runtime/Executable.cpp:

(JSC::EvalExecutable::create):
(JSC::FunctionExecutable::produceCodeBlockFor):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/JSArray.cpp:

(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::put):
(JSC::JSArray::push):

  • runtime/JSCJSValue.cpp:

(JSC::JSValue::toObjectSlowCase):
(JSC::JSValue::synthesizePrototype):
(JSC::JSValue::putToPrimitive):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::defineOwnProperty):

  • runtime/JSGenericTypedArrayViewInlines.h:

(JSC::::create):
(JSC::::createUninitialized):
(JSC::::validateRange):
(JSC::::setWithSpecificType):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::encode):
(JSC::decode):
(JSC::globalFuncProtoSetter):

  • runtime/JSNameScope.cpp:

(JSC::JSNameScope::put):

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue):
(JSC::Walker::walk):

  • runtime/JSObject.cpp:

(JSC::JSObject::put):
(JSC::JSObject::defaultValue):
(JSC::JSObject::hasInstance):
(JSC::JSObject::defaultHasInstance):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::throwTypeError):

  • runtime/ObjectConstructor.cpp:

(JSC::toPropertyDescriptor):

  • runtime/RegExpConstructor.cpp:

(JSC::constructRegExp):

  • runtime/StringObject.cpp:

(JSC::StringObject::defineOwnProperty):

  • runtime/StringRecursionChecker.cpp:

(JSC::StringRecursionChecker::throwStackOverflowError):

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=119548
Refactoring Exception throws.

Patch by Chris Curtis <[email protected]> on 2013-08-28
Reviewed by Geoffrey Garen.

Gets column information from the error object for reporting exceptions.

  • bindings/js/JSDOMBinding.cpp:

(WebCore::reportException):

  • bindings/js/ScriptCallStackFactory.cpp:

(WebCore::createScriptCallStackFromException):

Moved setting an exception into the vm, These functions changed to use the new functionality.

  • bindings/js/JSAudioBufferSourceNodeCustom.cpp:

(WebCore::JSAudioBufferSourceNode::setBuffer):

  • bindings/js/JSBiquadFilterNodeCustom.cpp:

(WebCore::JSBiquadFilterNode::setType):

  • bindings/js/JSCryptoCustom.cpp:

(WebCore::JSCrypto::getRandomValues):

  • bindings/js/JSDOMBinding.cpp:

(WebCore::setDOMException):

  • bindings/js/JSInjectedScriptHostCustom.cpp:

(WebCore::JSInjectedScriptHost::setFunctionVariableValue):

  • bindings/js/JSJavaScriptCallFrameCustom.cpp:

(WebCore::JSJavaScriptCallFrame::evaluate):
(WebCore::JSJavaScriptCallFrame::setVariableValue):

  • bindings/js/JSNodeFilterCondition.cpp:

(WebCore::JSNodeFilterCondition::acceptNode):

  • bindings/js/JSOscillatorNodeCustom.cpp:

(WebCore::JSOscillatorNode::setType):

  • bindings/js/JSPannerNodeCustom.cpp:

(WebCore::JSPannerNode::setPanningModel):
(WebCore::JSPannerNode::setDistanceModel):

  • bindings/js/JSSVGLengthCustom.cpp:

(WebCore::JSSVGLength::convertToSpecifiedUnits):

  • bindings/js/JSWebGLRenderingContextCustom.cpp:

(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContext::getAttachedShaders):
(WebCore::JSWebGLRenderingContext::getExtension):
(WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContext::getParameter):
(WebCore::JSWebGLRenderingContext::getProgramParameter):
(WebCore::JSWebGLRenderingContext::getShaderParameter):
(WebCore::JSWebGLRenderingContext::getUniform):
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::JSXMLHttpRequest::open):

  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneBase::throwStackOverflow):
(WebCore::CloneDeserializer::throwValidationError):
(WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):

  • bindings/js/WorkerScriptController.cpp:

(WebCore::WorkerScriptController::evaluate):
(WebCore::WorkerScriptController::setException):

  • bridge/c/c_instance.cpp:

(JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
(JSC::Bindings::CInstance::invokeMethod):
(JSC::Bindings::CInstance::invokeDefaultMethod):
(JSC::Bindings::CInstance::invokeConstruct):
(JSC::Bindings::CInstance::toJSPrimitive):

  • bridge/objc/objc_instance.mm:

(ObjcInstance::invokeMethod):

  • bridge/objc/objc_runtime.mm:

(JSC::Bindings::ObjcArray::setValueAt):
(JSC::Bindings::ObjcArray::valueAt):

  • bridge/objc/objc_utility.mm:

(JSC::Bindings::throwError):

  • bridge/qt/qt_instance.cpp:

(JSC::Bindings::QtField::valueFromInstance):
(JSC::Bindings::QtField::setValueToInstance):

  • bridge/runtime_array.cpp:

(JSC::RuntimeArray::put):
(JSC::RuntimeArray::putByIndex):

  • bridge/runtime_object.cpp:

(JSC::Bindings::RuntimeObject::throwInvalidAccessError):

Source/WebKit/mac: https://bugs.webkit.org/show_bug.cgi?id=119548
Refactoring Exception throws.

Patch by Chris Curtis <[email protected]> on 2013-08-28
Reviewed by Geoffrey Garen.

Moved setting an exception into the vm, These functions changed to use the new functionality.

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState):

  • Plugins/Hosted/ProxyInstance.mm:

(WebKit::ProxyInstance::invokeMethod):

Source/WebKit2: https://bugs.webkit.org/show_bug.cgi?id=119548
Refactoring Exception throws.

Patch by Chris Curtis <[email protected]> on 2013-08-28
Reviewed by Geoffrey Garen.

Moved setting an exception into the vm, These functions changed to use the new functionality.

  • WebProcess/Plugins/Netscape/JSNPObject.cpp:

(WebKit::JSNPObject::callMethod):
(WebKit::JSNPObject::callObject):
(WebKit::JSNPObject::callConstructor):
(WebKit::JSNPObject::throwInvalidAccessError):

  • WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:

(WebKit::NPRuntimeObjectMap::moveGlobalExceptionToExecState):

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=119548
Refactoring Exception throws.

Patch by Chris Curtis <[email protected]> on 2013-08-28
Reviewed by Geoffrey Garen.

Column/line information was added into these results.

  • fast/events/window-onerror4-expected.txt:
  • fast/js/global-recursion-on-full-stack-expected.txt:

fixed a variable name in a case when shouldThrowType failed.

  • fast/js/mozilla/resources/js-test-pre.js:

(shouldThrowType):

Sorted the properties to allow the results always show in the same order.

  • fast/js/script-tests/exception-properties.js:
  • fast/js/exception-properties-expected.txt:

This test needed to be modified to have the line numbers match on the output across
wk and wk2. This test is inherently flaky because is relies on size of the available
native stack. To account for the flakiness an additional call was made to force the
results to match.
This patch now records and outputs the line number where the errors were occurring.
This was causing the test results to no longer match because of the line numbers.
By changing how to account for the flakiness, the results match again.

  • fast/xmlhttprequest/xmlhttprequest-recursive-sync-event-expected.txt:
  • fast/xmlhttprequest/xmlhttprequest-recursive-sync-event.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r154429 r154797  
    4545#include "Debugger.h"
    4646#include "DeferGC.h"
     47#include "ErrorInstance.h"
    4748#include "ExceptionHelpers.h"
    4849#include "GetterSetter.h"
     
    325326static NEVER_INLINE void returnToThrowTrampoline(VM* vm, ReturnAddressPtr exceptionLocation, ReturnAddressPtr& returnAddressSlot)
    326327{
    327     RELEASE_ASSERT(vm->exception);
     328    RELEASE_ASSERT(vm->exception());
    328329    vm->exceptionLocation = exceptionLocation;
    329330    returnAddressSlot = ReturnAddressPtr(FunctionPtr(ctiVMThrowTrampoline));
     
    342343#define CHECK_FOR_EXCEPTION() \
    343344    do { \
    344         if (UNLIKELY(stackFrame.vm->exception)) \
     345        if (UNLIKELY(stackFrame.vm->exception())) \
    345346            VM_THROW_EXCEPTION(); \
    346347    } while (0)
    347348#define CHECK_FOR_EXCEPTION_AT_END() \
    348349    do { \
    349         if (UNLIKELY(stackFrame.vm->exception)) \
     350        if (UNLIKELY(stackFrame.vm->exception())) \
    350351            VM_THROW_EXCEPTION_AT_END(); \
    351352    } while (0)
    352353#define CHECK_FOR_EXCEPTION_VOID() \
    353354    do { \
    354         if (UNLIKELY(stackFrame.vm->exception)) { \
     355        if (UNLIKELY(stackFrame.vm->exception())) { \
    355356            VM_THROW_EXCEPTION_AT_END(); \
    356357            return; \
     
    398399};
    399400
    400 class ErrorWithExceptionFunctor : public ErrorFunctor {
    401     public:
    402     ErrorWithExceptionFunctor(JSValue exception)
    403         : m_exception(exception)
    404     {
    405     }
    406     JSValue operator()(ExecState*)
    407     {
    408     return m_exception;
    409     }
    410 
    411 private:
    412     JSValue m_exception;
    413 };
    414 
    415401// Helper function for JIT stubs that may throw an exception in the middle of
    416402// processing a function call. This function rolls back the stack to
    417403// our caller, so exception processing can proceed from a valid state.
    418 template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot, ErrorFunctor& createError )
     404template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot, ErrorFunctor* createError = 0)
    419405{
    420406    CallFrame* callFrame = newCallFrame->callerFrame()->removeHostCallFrameFlag();
    421407    jitStackFrame.callFrame = callFrame;
    422408    callFrame->vm().topCallFrame = callFrame;
    423     callFrame->vm().exception = createError(callFrame);
    424     ASSERT(callFrame->vm().exception);
     409    if (createError)
     410        callFrame->vm().throwException(callFrame, (*createError)(callFrame));
     411    ASSERT(callFrame->vm().exception());
    425412    returnToThrowTrampoline(&callFrame->vm(), ReturnAddressPtr(newCallFrame->returnPC()), returnAddressSlot);
    426413    return T();
    427 }
    428 
    429 template<typename T> static T throwExceptionFromOpCall(JITStackFrame& jitStackFrame, CallFrame* newCallFrame, ReturnAddressPtr& returnAddressSlot)
    430 {
    431     CallFrame* callFrame = newCallFrame->callerFrame();
    432     ASSERT(callFrame->vm().exception);
    433     ErrorWithExceptionFunctor functor = ErrorWithExceptionFunctor(callFrame->vm().exception);
    434     return throwExceptionFromOpCall<T>(jitStackFrame, newCallFrame, returnAddressSlot, functor);
    435414}
    436415
     
    446425    VM* vm = stackFrame.vm;
    447426    if (UNLIKELY(vm->watchdog.didFire(callFrame))) {
    448         vm->exception = createTerminatedExecutionException(vm);
     427        vm->throwException(callFrame, createTerminatedExecutionException(vm));
    449428        VM_THROW_EXCEPTION_AT_END();
    450429        return;
     
    459438    if (UNLIKELY(!stackFrame.stack->grow(&callFrame->registers()[callFrame->codeBlock()->m_numCalleeRegisters]))) {
    460439        ErrorWithExecFunctor functor = ErrorWithExecFunctor(createStackOverflowError);
    461         return throwExceptionFromOpCall<void*>(stackFrame, callFrame, STUB_RETURN_ADDRESS, functor);
     440        return throwExceptionFromOpCall<void*>(stackFrame, callFrame, STUB_RETURN_ADDRESS, &functor);
    462441    }
    463442
     
    895874    }
    896875
    897     stackFrame.vm->exception = createInvalidParameterError(callFrame, "instanceof", baseVal);
     876    stackFrame.vm->throwException(callFrame, createInvalidParameterError(callFrame, "instanceof", baseVal));
    898877    VM_THROW_EXCEPTION_AT_END();
    899878    return JSValue::encode(JSValue());
     
    11531132    JSValue result = jsBoolean(couldDelete);
    11541133    if (!couldDelete && callFrame->codeBlock()->isStrictMode())
    1155         stackFrame.vm->exception = createTypeError(stackFrame.callFrame, "Unable to delete property.");
     1134        stackFrame.vm->throwException(stackFrame.callFrame, createTypeError(stackFrame.callFrame, "Unable to delete property."));
    11561135
    11571136    CHECK_FOR_EXCEPTION_AT_END();
     
    11931172    if (!error)
    11941173        return function;
    1195     callFrame->vm().exception = error;
     1174    callFrame->vm().throwException(callFrame, error);
    11961175    return 0;
    11971176}
     
    12401219    if (missingArgCount < 0) {
    12411220        ErrorWithExecFunctor functor = ErrorWithExecFunctor(createStackOverflowError);
    1242         return throwExceptionFromOpCall<int>(stackFrame, callFrame, STUB_RETURN_ADDRESS, functor);
     1221        return throwExceptionFromOpCall<int>(stackFrame, callFrame, STUB_RETURN_ADDRESS, &functor);
    12431222    }
    12441223    return missingArgCount;
     
    12541233    if (missingArgCount < 0) {
    12551234        ErrorWithExecFunctor functor = ErrorWithExecFunctor(createStackOverflowError);
    1256         return throwExceptionFromOpCall<int>(stackFrame, callFrame, STUB_RETURN_ADDRESS, functor);
     1235        return throwExceptionFromOpCall<int>(stackFrame, callFrame, STUB_RETURN_ADDRESS, &functor);
    12571236    }
    12581237    return missingArgCount;
     
    12901269        FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable);
    12911270        if (JSObject* error = functionExecutable->compileFor(callFrame, callee->scope(), kind)) {
    1292             callFrame->vm().exception = error;
     1271            callFrame->vm().throwException(callFrame, error);
    12931272            return 0;
    12941273        }
     
    13681347        JSObject* error = functionExecutable->compileFor(callFrame, scopeChain, CodeForCall);
    13691348        if (error) {
    1370             callFrame->vm().exception = error;
     1349            callFrame->vm().throwException(callFrame, error);
    13711350            return 0;
    13721351        }
     
    14221401        ASSERT(callType == CallTypeNone);
    14231402        ErrorWithExecAndCalleeFunctor functor = ErrorWithExecAndCalleeFunctor(createNotAFunctionError, callee);
    1424         return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS, functor);
     1403        return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS, &functor);
    14251404    }
    14261405
     
    14311410    }
    14321411
    1433     if (stackFrame.vm->exception)
     1412    if (stackFrame.vm->exception())
    14341413        return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS);
    14351414
     
    15181497        ASSERT(constructType == ConstructTypeNone);
    15191498        ErrorWithExecAndCalleeFunctor functor = ErrorWithExecAndCalleeFunctor(createNotAConstructorError, callee);
    1520         return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS, functor);
     1499        return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS, &functor);
    15211500    }
    15221501
     
    15271506    }
    15281507
    1529     if (stackFrame.vm->exception)
     1508    if (stackFrame.vm->exception())
    15301509        return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS);
    15311510
     
    16671646    } else {
    16681647        Identifier property(callFrame, subscript.toString(callFrame)->value(callFrame));
    1669         if (!callFrame->vm().exception) { // Don't put to an object if toString threw an exception.
     1648        if (!callFrame->vm().exception()) { // Don't put to an object if toString threw an exception.
    16701649            PutPropertySlot slot(callFrame->codeBlock()->isStrictMode());
    16711650            baseValue.put(callFrame, property, value, slot);
     
    19531932    RegExp* regExp = stackFrame.args[0].regExp();
    19541933    if (!regExp->isValid()) {
    1955         stackFrame.vm->exception = createSyntaxError(callFrame, "Invalid flags supplied to RegExp constructor.");
     1934        stackFrame.vm->throwException(callFrame, createSyntaxError(callFrame, "Invalid flags supplied to RegExp constructor."));
    19561935        VM_THROW_EXCEPTION();
    19571936    }
     
    19781957
    19791958    JSValue result = eval(callFrame);
    1980     if (stackFrame.vm->exception)
     1959    if (stackFrame.vm->exception())
    19811960        return throwExceptionFromOpCall<EncodedJSValue>(stackFrame, callFrame, STUB_RETURN_ADDRESS);
    19821961
     
    19871966{
    19881967    STUB_INIT_STACK_FRAME(stackFrame);
     1968    stackFrame.vm->throwException(stackFrame.callFrame, stackFrame.args[0].jsValue());
    19891969    ExceptionHandler handler = jitThrow(stackFrame.vm, stackFrame.callFrame, stackFrame.args[0].jsValue(), STUB_RETURN_ADDRESS);
    19901970    STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
     
    21422122    String message = errorDescriptionForValue(callFrame, stackFrame.args[0].jsValue())->value(callFrame);
    21432123    if (stackFrame.args[1].asInt32)
    2144         stackFrame.vm->exception = createReferenceError(callFrame, message);
     2124        stackFrame.vm->throwException(callFrame, createReferenceError(callFrame, message));
    21452125    else
    2146         stackFrame.vm->exception = createTypeError(callFrame, message);
     2126        stackFrame.vm->throwException(callFrame, createTypeError(callFrame, message));
    21472127    VM_THROW_EXCEPTION_AT_END();
    21482128}
     
    21662146    STUB_INIT_STACK_FRAME(stackFrame);
    21672147    VM* vm = stackFrame.vm;
    2168     ExceptionHandler handler = jitThrow(vm, stackFrame.callFrame, vm->exception, vm->exceptionLocation);
     2148    ExceptionHandler handler = jitThrow(vm, stackFrame.callFrame, vm->exception(), vm->exceptionLocation);
    21692149    STUB_SET_RETURN_ADDRESS(handler.catchRoutine);
    21702150    return handler.callFrame;
     
    21822162    VM* vm = callFrame->codeBlock()->vm();
    21832163    vm->topCallFrame = callFrame;
    2184     return encode(jitThrowNew(vm, callFrame, vm->exception));
     2164    return encode(jitThrowNew(vm, callFrame, vm->exception()));
    21852165}
    21862166#else
     
    21952175    VM* vm = callFrame->codeBlock()->vm();
    21962176    vm->topCallFrame = callFrame;
    2197     return jitThrowNew(vm, callFrame, vm->exception);
     2177    return jitThrowNew(vm, callFrame, vm->exception());
    21982178}
    21992179#endif
     
    22302210    if (!scope->getPropertySlot(exec, ident, slot)) {
    22312211        if (modeAndType.mode() == ThrowIfNotFound) {
    2232             throwError(exec, createUndefinedVariableError(exec, ident));
     2212            exec->vm().throwException(exec, createUndefinedVariableError(exec, ident));
    22332213            VM_THROW_EXCEPTION();
    22342214        }
     
    22622242
    22632243    if (modeAndType.mode() == ThrowIfNotFound && !scope->hasProperty(exec, ident)) {
    2264         throwError(exec, createUndefinedVariableError(exec, ident));
     2244        exec->vm().throwException(exec, createUndefinedVariableError(exec, ident));
    22652245        VM_THROW_EXCEPTION_AT_END();
    22662246        return;
     
    22702250    scope->methodTable()->put(scope, exec, ident, value, slot);
    22712251   
    2272     if (exec->vm().exception) {
     2252    if (exec->vm().exception()) {
    22732253        VM_THROW_EXCEPTION_AT_END();
    22742254        return;
Note: See TracChangeset for help on using the changeset viewer.