<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[205569] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/205569">205569</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-09-07 15:10:50 -0700 (Wed, 07 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
https://bugs.webkit.org/show_bug.cgi?id=161498

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch refactors the ThrowScope class, and introduces a base ExceptionScope
that ThrowScope extends.  A CatchScope which extends the ExceptionScope is also
introduced.

ENABLE(THROW_SCOPE_VERIFICATION) is now renamed to ENABLE(EXCEPTION_SCOPE_VERIFICATION)
which is a more suitable name now.

Note: exception scope verification is still disabled by default.  There are still
many places that need to be fixed up or re-expressed in a way that is friendly
to the verification.  I'll address those in subsequent patches.

After this patch, the code will statically enforce that:
1. all calls to throwException() go through a ThrowScope.
2. all calls to clearException() go through a CatchScope.
3. all exception checks go through an ExceptionScope in the form of a ThrowScope
   or CatchScope.

A Summary of how to use ExceptionScopes
=======================================
1. If a function can throw a JS exception, it should declare a ThrowScope at the
   top of the function (as early as possible).

2. If a function can clear JS exceptions, it should declare a CatchScope at the
   top of the function (as early as possible).

Declaring a ThrowScope in a function means that the function may throw an exception
that its caller will have to handle.  Declaring a CatchScope in a function means
that the function intends to clear pending exceptions before returning to its
caller. 

For more details, see the notes below.
        
Everything you may want to know about ExceptionScopes
=====================================================
ExceptionScope verification works to simulate exception throws and detect cases
where exception checks are missing.  The notes below will cover:

    1. The VM::m_needExceptionCheck bit
    2. ThrowScopes and CatchScopes
    3. Verification of needed exception checks
    3. Checking Exceptions
    4. Simulating throws
    5. Using ThrowScope::release()
    6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()
    7. Checking exceptions by checking callee results
    8. Debugging verification errors

1. The VM::m_needExceptionCheck bit

   The VM has a m_needExceptionCheck bit that indicates when an exception may be
   thrown.  You can think of the m_needExceptionCheck bit being set as a simulated
   throw.

2. ThrowScopes and CatchScopes

   Only ThrowScopes may throwException.  Only CatchScopes may catchException.

   Every throw site must declare a ThrowScope instance using DECLARE_THROW_SCOPE
   at the top of its function (as early as possible) e.g.
 
        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            ...
            throwException(exec, scope, ...);
        }

   Note: by convention, every throw helper function must take a ThrowScope argument
   instead of instantiating its own ThrowScope.  This allows the throw to be
   attributed to the client code rather than the throw helper itself.

   Every catch site (i.e. a site that calls clearException()) must declare a
   CatchScope instance using DECLARE_CATCH_SCOPE at the top of its function.

   If a function can both throw or clear exceptions, then the ThrowScope should
   be declared first so that it can simulate a throw to the function's caller.

   Note: ThrowScope and CatchScope both extend ExceptionScope so that ThrowScopes
   can be aware if there's an enclosing CatchScope between it and the point where
   C++ code returns to JS code.  This is needed to determine if the ThrowScope
   should simulate a re-throw or not.  See (4) below for more details on returning
   to JS code.

3. Verification of needed exception checks

   a. On construction, each ThrowScope and CatchScope will verify that
      VM::m_needExceptionCheck is not set.
 
      This ensures that the caller of the current function has checked for exceptions
      where needed before doing more work which lead to calling the current function.

   b. On destruction, each ThrowScope and CatchScope will verify that
      VM::m_needExceptionCheck is not set. This verification will be skipped if
      the ThrowScope has been released (see (5) below).

      This ensures that the function that owns this exception scope is not missing
      any exception checks before returning.

   c. When throwing an exception, the ThrowScope will verify that VM::m_needExceptionCheck
      is not already set, unless it's been ask to rethrow the same Exception object.

4. Simulating throws

   Throws are simulated by setting the m_needExceptionCheck bit.

   The bit will only be set in the ThrowScope destructor except when the ThrowScope
   detects the caller is a LLInt or JIT function.  LLInt or JIT functions will always
   check for exceptions after a host C++ function returns to it.  However, they will
   not clear the m_needExceptionCheck bit.

   Hence, if the ThrowScope destructor detects the caller is a LLInt or JIT function,
   it will just skip the setting of the bit.

   Note: it is not needed nor correct to set the m_needExceptionCheck bit in the
   throwException methods.  This is because, in practice, we always return
   immediately after throwing an exception.  It doesn't make sense to set the bit in
   the throw just to have to clear it immediately after before we do verification in
   the ThrowScope destructor.

5. Using ThrowScope::release()

   Calling release() means that the scope is released from its obligation to
   verify the VM::m_needExceptionCheck bit on destruction.

   release() should only be used at the bottom of a function if:

   a. This function is going to let its caller check and handle the exception, e.g.

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            auto result = goo(); // may throw.

            ... // Code that will are not affected by a pending exceptions.

            scope.release(); // tell the ThrowScope that the caller will handle the exception.
            return result;
        }

   b. This function is going to do a tail call that may throw.

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            ...
            scope.release(); // tell the ThrowScope that the caller will handle the exception.
            return goo(); // may throw.
        }

      release() should not be used in code paths that branch. For example:

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            auto result = goo1(); // may throw.
            scope.release(); // WRONG !!! Don't do this.
            if (result)
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

    The above will result in a verification error in goo2()'s ThrowScope.  The
    proper way to fix this verification is to do either (6) or (7) below.

 6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()

    ThrowScope/CatchScope::exception() returns the thrown Exception object if
    there is one pending.  Else, it returns nullptr.

    It also clears the m_needExceptionCheck bit thereby indicating that we've
    satisfied the needed exception check.  For example,

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            auto result = goo1(); // may throw.
            if (scope.exception())
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

    But sometimes, for optimization reasons, we may choose to test the result of
    the callee function instead doing a load of the VM exception value.  See (7)
    below.

 7. Checking exceptions by checking callee results

    This approach should only be applied when it makes a difference to performance.
    If we need to do this, we should add an ASSERT() that invokes the scope's
    exception() method to verify the result.  Since exception scope verification
    is only done on DEBUG builds, this ASSERT will satisfy the verification
    requirements without impacting performance.  For example,

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            bool failed = goo1(); // may throw.
            ASSERT(!!scope.exception() == failed)
            if (failed)
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

 8. Debugging verification errors

    a. When verification fails, you will see a message followed by an assertion
       failure.  For example:

    ERROR: Unchecked JS exception:
        This scope can throw a JS exception: setUpCall @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1245
            (ExceptionScope::m_recursionDepth was ...)
        But the exception was unchecked as of this scope: varargsSetup @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1398
            (ExceptionScope::m_recursionDepth was ...)
        [ backtrace here ]

       The message tells you that failure was detected at in varargsSetup() at
       LLIntSlowPaths.cpp line 1398, and that the missing exception check should
       have happened somewhere between the call to setUpCall() at LLIntSlowPaths.cpp
       line 1245 and it.

       If that is insufficient information, you can ...

    b. Dump simulated throws

       Re-run the test case with JSC_dumpSimulatedThrows=true.  You will also see
       back traces at each simulated throw.

    c. Narrowing down the source of a simulated throw

       Another technique for narrowing down the source of simulated throws is by
       further dividing a function to smaller regions by separating each region
       with additional local throw scopes.  For example,

        ... // Region 1
        { auto scope = DECLARE_THROW_SCOPE(vm); }
        ... // Region 2
        { auto scope = DECLARE_THROW_SCOPE(vm); }
        ... // Region 3

* API/APIUtils.h:
(handleExceptionIfNeeded):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptFunctionCall::call):
* bindings/ScriptValue.cpp:
(Deprecated::ScriptValue::toString):
* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript):
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
* interpreter/CallFrame.h:
(JSC::ExecState::clearException): Deleted.
(JSC::ExecState::exception): Deleted.
(JSC::ExecState::hadException): Deleted.
(JSC::ExecState::lastException): Deleted.
(JSC::ExecState::clearLastException): Deleted.
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::sizeOfVarargs):
(JSC::notifyDebuggerOfUnwinding):
(JSC::Interpreter::unwind):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::debug):
* interpreter/Interpreter.h:
(JSC::SuspendExceptionScope::SuspendExceptionScope):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOperations.cpp:
(JSC::getByVal):
* jsc.cpp:
(WTF::ImpureGetter::getOwnPropertySlot):
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
(functionCreateElement):
(functionRun):
(functionRunString):
(functionLoad):
(functionLoadString):
(functionReadFile):
(functionCheckSyntax):
(functionSetRandomSeed):
(functionLoadModule):
(functionCreateBuiltin):
(functionCheckModuleSyntax):
(functionGenerateHeapSnapshot):
(functionSamplingProfilerStackTraces):
(dumpException):
(checkUncaughtException):
(runWithScripts):
(runInteractive):
* llint/LLIntExceptions.cpp:
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::addSequenceProperties):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::toJS):
* profiler/ProfilerOSRExitSite.cpp:
(JSC::Profiler::OSRExitSite::toJS):
* profiler/ProfilerOriginStack.cpp:
(JSC::Profiler::OriginStack::toJS):
* runtime/ArrayPrototype.cpp:
(JSC::speciesConstructArray):
(JSC::shift):
(JSC::unshift):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::slowJoin):
(JSC::fastJoin):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
(JSC::moveElements):
(JSC::concatAppendOne):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/CallData.cpp:
(JSC::call):
* runtime/CatchScope.cpp: Added.
(JSC::CatchScope::CatchScope):
(JSC::CatchScope::~CatchScope):
* runtime/CatchScope.h: Added.
(JSC::CatchScope::clearException):
(JSC::CatchScope::CatchScope):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/CommonSlowPathsExceptions.cpp:
(JSC::CommonSlowPaths::interpreterThrowInCaller):
* runtime/Completion.cpp:
(JSC::evaluate):
(JSC::rejectPromise):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
* runtime/ConsoleObject.cpp:
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
(JSC::dateParse):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToPrimitiveSymbol):
(JSC::dateProtoFuncToJSON):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/ExceptionEventLocation.cpp: Added.
(WTF::printInternal):
* runtime/ExceptionEventLocation.h: Copied from Source/JavaScriptCore/runtime/ThrowScopeLocation.h.
(JSC::ExceptionEventLocation::ExceptionEventLocation):
(JSC::ThrowScopeLocation::ThrowScopeLocation): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/ExceptionScope.cpp: Added.
(JSC::ExceptionScope::ExceptionScope):
(JSC::ExceptionScope::~ExceptionScope):
* runtime/ExceptionScope.h: Added.
(JSC::ExceptionScope::vm):
(JSC::ExceptionScope::recursionDepth):
(JSC::ExceptionScope::exception):
(JSC::ExceptionScope::ExceptionScope):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncBind):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments&lt;Type&gt;::copyToArguments):
* runtime/GetterSetter.cpp:
(JSC::callGetter):
* runtime/InspectorInstrumentationObject.cpp:
(JSC::inspectorInstrumentationObjectLog):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::createCollator):
(JSC::IntlCollator::resolvedOptions):
* runtime/IntlCollatorConstructor.cpp:
(JSC::constructIntlCollator):
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorFuncCompare):
(JSC::IntlCollatorPrototypeGetterCompare):
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::resolvedOptions):
(JSC::IntlDateTimeFormat::format):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::constructIntlDateTimeFormat):
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatFuncFormatDateTime):
(JSC::IntlDateTimeFormatPrototypeGetterFormat):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::createNumberFormat):
(JSC::IntlNumberFormat::resolvedOptions):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::constructIntlNumberFormat):
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatFuncFormatNumber):
(JSC::IntlNumberFormatPrototypeGetterFormat):
* runtime/IntlObject.cpp:
(JSC::intlBooleanOption):
(JSC::intlStringOption):
(JSC::intlNumberOption):
(JSC::canonicalizeLocaleList):
(JSC::supportedLocales):
* runtime/IntlObjectInlines.h:
(JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):
* runtime/IteratorOperations.cpp:
(JSC::iteratorNext):
(JSC::iteratorStep):
(JSC::iteratorClose):
(JSC::iteratorForIterable):
* runtime/IteratorOperations.h:
(JSC::forEachInIterable):
* runtime/JSArray.cpp:
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::copyToArguments):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSArrayInlines.h:
(JSC::getLength):
(JSC::toLength):
* runtime/JSBoundFunction.cpp:
(JSC::getBoundFunctionStructure):
(JSC::JSBoundFunction::create):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::putToPrimitiveByIndex):
(JSC::JSValue::toStringSlowCase):
* runtime/JSCJSValueInlines.h:
(JSC::toPreferredPrimitiveType):
(JSC::JSValue::getPropertySlot):
(JSC::JSValue::equalSlowCaseInline):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::setFunctionName):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndex):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncIncludes):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncJoin):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSGlobalObject.h:
(JSC::constructEmptyArray):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* runtime/JSJob.cpp:
(JSC::JSJobMicrotask::run):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::getOwnPropertySlot):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::fetch):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::stringify):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
(JSC::JSONProtoFuncParse):
* runtime/JSObject.cpp:
(JSC::ordinarySetSlow):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::ordinaryToPrimitive):
(JSC::JSObject::defaultHasInstance):
(JSC::JSObject::getPropertyNames):
(JSC::JSObject::toNumber):
(JSC::JSObject::toString):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::getGenericPropertyNames):
(JSC::JSObject::getMethod):
* runtime/JSObjectInlines.h:
(JSC::createListFromArrayLike):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::create):
* runtime/JSScope.cpp:
(JSC::isUnscopable):
(JSC::JSScope::resolve):
* runtime/JSString.cpp:
(JSC::JSString::equalSlowCase):
* runtime/JSStringJoiner.cpp:
(JSC::JSStringJoiner::join):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser&lt;CharType&gt;::parse):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/MathObject.cpp:
(JSC::mathProtoFuncClz32):
(JSC::mathProtoFuncHypot):
(JSC::mathProtoFuncIMul):
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::constructWithNumberConstructor):
* runtime/ObjectConstructor.cpp:
(JSC::constructObject):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorSetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptors):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::objectConstructorKeys):
(JSC::ownEnumerablePropertyKeys):
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::defineProperties):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
(JSC::objectConstructorIsExtensible):
(JSC::ownPropertyKeys):
* runtime/ObjectConstructor.h:
(JSC::constructObjectFromPropertyDescriptor):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Options.h:
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::slowGetterSetter):
* runtime/ProxyConstructor.cpp:
(JSC::makeRevocableProxy):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::toStringName):
(JSC::performProxyGet):
(JSC::ProxyObject::performGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::putByIndexCommon):
(JSC::performProxyCall):
(JSC::performProxyConstruct):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectConstruct):
(JSC::reflectObjectDefineProperty):
(JSC::reflectObjectGet):
(JSC::reflectObjectGetOwnPropertyDescriptor):
(JSC::reflectObjectIsExtensible):
(JSC::reflectObjectPreventExtensions):
(JSC::reflectObjectSet):
(JSC::reflectObjectSetPrototypeOf):
* runtime/RegExpConstructor.cpp:
(JSC::toFlags):
(JSC::regExpCreate):
(JSC::constructRegExp):
* runtime/RegExpConstructor.h:
(JSC::isRegExp):
* runtime/RegExpObject.cpp:
(JSC::collectMatches):
(JSC::RegExpObject::matchGlobal):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::flagsString):
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterFlags):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSplitFast):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::stringFromCodePoint):
(JSC::constructWithStringConstructor):
* runtime/StringObject.cpp:
(JSC::StringObject::defineOwnProperty):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
(JSC::replaceUsingStringSearch):
(JSC::replace):
(JSC::stringProtoFuncReplaceUsingRegExp):
(JSC::stringProtoFuncReplaceUsingStringSearch):
(JSC::stringProtoFuncCodePointAt):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncLocaleCompare):
(JSC::toLocaleCase):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringIncludesImpl):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::stringProtoFuncNormalize):
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorFor):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::ThrowScope):
(JSC::ThrowScope::~ThrowScope):
(JSC::ThrowScope::throwException):
(JSC::ThrowScope::simulateThrow):
(JSC::ThrowScope::printIfNeedCheck): Deleted.
(JSC::ThrowScope::verifyExceptionCheckNeedIsSatisfied): Deleted.
* runtime/ThrowScope.h:
(JSC::ThrowScope::release):
(JSC::ThrowScope::ThrowScope):
(JSC::ThrowScope::throwException):
(JSC::ThrowScope::vm): Deleted.
(JSC::ThrowScope::exception): Deleted.
* runtime/ThrowScopeLocation.h: Removed.
* runtime/VM.cpp:
(JSC::VM::verifyExceptionCheckNeedIsSatisfied):
* runtime/VM.h:
(JSC::VM::exception):
(JSC::VM::clearException):
(JSC::VM::setException): Deleted.
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):

Source/WebCore:

No new test because there is no behavior change in general except for 1 bug fix.
That bug is already caught by existing tests with the introduction of the CatchScope.

Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
a failed attempt to get the handleEvent callback is not handled.

* ForwardingHeaders/runtime/CatchScope.h: Added.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get):
* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createAesCbcParams):
(WebCore::createAesKeyGenParams):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):
(WebCore::createRsaSsaParams):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getJSArrayFromJSON):
(WebCore::getStringFromJSON):
(WebCore::getBooleanFromJSON):
(WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::JSCryptoKeySerializationJWK::keyData):
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElement):
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
(WebCore::whenDefinedPromise):
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToUSVString):
(WebCore::reportException):
(WebCore::reportCurrentException):
(WebCore::setDOMException):
(WebCore::hasIteratorMethod):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
(WebCore::throwNotSupportedError):
(WebCore::throwInvalidStateError):
(WebCore::throwSecurityError):
* bindings/js/JSDOMBinding.h:
(WebCore::toJSSequence):
(WebCore::toJS):
(WebCore::jsFrozenArray):
(WebCore::NativeValueTraits&lt;String&gt;::nativeValue):
(WebCore::NativeValueTraits&lt;unsigned&gt;::nativeValue):
(WebCore::NativeValueTraits&lt;float&gt;::nativeValue):
(WebCore::NativeValueTraits&lt;double&gt;::nativeValue):
(WebCore::toNativeArray):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::makeThisTypeErrorForBuiltins):
(WebCore::makeGetterTypeErrorForBuiltins):
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
* bindings/js/JSDOMPromise.cpp:
(WebCore::rejectPromiseWithExceptionIfAny):
* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowMicrotaskCallback::call):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::readAccelerationArgument):
(WebCore::readRotationRateArgument):
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::tryGetProperty):
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::tryGetPropertyAndResult):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::createPositionOptions):
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::get3DContextAttributes):
(WebCore::JSHTMLCanvasElement::getContext):
(WebCore::JSHTMLCanvasElement::probablySupportsContext):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
(WebCore::JSMainThreadExecState::~JSMainThreadExecState):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::convertToSpecifiedUnits):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::getOwnPropertyNames):
(WebCore::JSStorage::putDelegate):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getExtension):
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContextBase::getParameter):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::toVector):
(WebCore::dataFunctionf):
(WebCore::dataFunctionMatrix):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::createAlgorithmFromJSValue):
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::JSWebKitSubtleCrypto::encrypt):
(WebCore::JSWebKitSubtleCrypto::decrypt):
(WebCore::JSWebKitSubtleCrypto::sign):
(WebCore::JSWebKitSubtleCrypto::verify):
(WebCore::JSWebKitSubtleCrypto::digest):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::importKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::exportKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::wrapKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
(WebCore::JSWorkerGlobalScope::setTimeout):
(WebCore::JSWorkerGlobalScope::setInterval):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bindings/js/ScriptGlobalObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneBase::shouldTerminate):
(WebCore::CloneDeserializer::deserialize):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::setJSTestGlobalObjectRegularAttribute):
(WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
(WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
(WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
(WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
(WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
(WebCore::setJSTestInterfaceImplementsStr2):
(WebCore::setJSTestInterfaceImplementsStr3):
(WebCore::setJSTestInterfaceImplementsNode):
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalStr3):
(WebCore::setJSTestInterfaceSupplementalNode):
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::setJSTestNodeName):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
(WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary&lt;TestObj::Dictionary&gt;):
(WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldNotTolerateNull&gt;):
(WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;):
(WebCore::convertDictionary&lt;AlternateDictionaryName&gt;):
(WebCore::setJSTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::setJSTestObjEnumAttr):
(WebCore::setJSTestObjByteAttr):
(WebCore::setJSTestObjOctetAttr):
(WebCore::setJSTestObjShortAttr):
(WebCore::setJSTestObjClampedShortAttr):
(WebCore::setJSTestObjEnforceRangeShortAttr):
(WebCore::setJSTestObjUnsignedShortAttr):
(WebCore::setJSTestObjLongAttr):
(WebCore::setJSTestObjLongLongAttr):
(WebCore::setJSTestObjUnsignedLongLongAttr):
(WebCore::setJSTestObjStringAttr):
(WebCore::setJSTestObjUsvstringAttr):
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjTestNullableObjAttr):
(WebCore::setJSTestObjLenientTestObjAttr):
(WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
(WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
(WebCore::setJSTestObjImplementationEnumAttr):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedStringAttr):
(WebCore::setJSTestObjReflectedUSVStringAttr):
(WebCore::setJSTestObjReflectedIntegralAttr):
(WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedURLAttr):
(WebCore::setJSTestObjReflectedUSVURLAttr):
(WebCore::setJSTestObjReflectedCustomIntegralAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::setJSTestObjReflectedCustomURLAttr):
(WebCore::setJSTestObjEnabledAtRuntimeAttribute):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjAttrWithGetterException):
(WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithSetterException):
(WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
(WebCore::setJSTestObjStringAttrWithGetterException):
(WebCore::setJSTestObjStringAttrWithSetterException):
(WebCore::setJSTestObjCustomAttr):
(WebCore::setJSTestObjOnfoo):
(WebCore::setJSTestObjOnwebkitfoo):
(WebCore::setJSTestObjWithScriptStateAttribute):
(WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::setJSTestObjConditionalAttr1):
(WebCore::setJSTestObjConditionalAttr2):
(WebCore::setJSTestObjConditionalAttr3):
(WebCore::setJSTestObjConditionalAttr4Constructor):
(WebCore::setJSTestObjConditionalAttr5Constructor):
(WebCore::setJSTestObjConditionalAttr6Constructor):
(WebCore::setJSTestObjAnyAttribute):
(WebCore::setJSTestObjMutablePoint):
(WebCore::setJSTestObjImmutablePoint):
(WebCore::setJSTestObjStrawberry):
(WebCore::setJSTestObjId):
(WebCore::setJSTestObjReplaceableAttribute):
(WebCore::setJSTestObjNullableLongSettableAttribute):
(WebCore::setJSTestObjNullableStringSettableAttribute):
(WebCore::setJSTestObjNullableUSVStringSettableAttribute):
(WebCore::setJSTestObjNullableStringValue):
(WebCore::setJSTestObjAttributeWithReservedEnumType):
(WebCore::setJSTestObjPutForwardsAttribute):
(WebCore::setJSTestObjPutForwardsNullableAttribute):
(WebCore::setJSTestObjStringifierAttribute):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
(WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
(WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
(WebCore::jsTestObjPrototypeFunctionPrivateMethod):
(WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
(WebCore::jsTestObjPrototypeFunctionAddEventListener):
(WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
(WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
(WebCore::jsTestObjPrototypeFunctionGetElementById):
(WebCore::jsTestObjPrototypeFunctionConvert3):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionAny):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
(WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
(WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
(WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
(WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors4):
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
(WebCore::constructJSTestOverloadedConstructorsWithSequence2):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
(WebCore::setJSTestTypedefsUnsignedLongLongAttr):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
(WebCore::setJSTestTypedefsAttrWithGetterException):
(WebCore::setJSTestTypedefsAttrWithSetterException):
(WebCore::setJSTestTypedefsStringAttrWithGetterException):
(WebCore::setJSTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsPrototypeFunctionFunc):
(WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
(WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
(WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
(WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
* bridge/NP_jsobject.cpp:
(_NPN_InvokeDefault):
(_NPN_Invoke):
(_NPN_Evaluate):
(_NPN_GetProperty):
(_NPN_SetProperty):
(_NPN_RemoveProperty):
(_NPN_HasProperty):
(_NPN_HasMethod):
(_NPN_Enumerate):
(_NPN_Construct):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
* bridge/objc/WebScriptObject.mm:
(WebCore::addExceptionToConsole):
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject valueForKey:]):
(-[WebScriptObject removeWebScriptKey:]):
(-[WebScriptObject hasWebScriptKey:]):
(-[WebScriptObject webScriptValueAtIndex:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::getTypeFlags):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadEncodedRules):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::evaluate):
(WebKit::NetscapePluginInstanceProxy::invoke):
(WebKit::NetscapePluginInstanceProxy::invokeDefault):
(WebKit::NetscapePluginInstanceProxy::construct):
(WebKit::NetscapePluginInstanceProxy::getProperty):
(WebKit::NetscapePluginInstanceProxy::setProperty):
(WebKit::NetscapePluginInstanceProxy::removeProperty):
(WebKit::NetscapePluginInstanceProxy::hasProperty):
(WebKit::NetscapePluginInstanceProxy::hasMethod):
(WebKit::NetscapePluginInstanceProxy::enumerate):
* WebView/WebView.mm:
(aeDescFromJSValue):

Source/WebKit/win:

* Plugins/PluginPackage.cpp:
(WebCore::NPN_Evaluate):
(WebCore::NPN_Invoke):

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::hasMethod):
(WebKit::NPJSObject::hasProperty):
(WebKit::NPJSObject::getProperty):
(WebKit::NPJSObject::setProperty):
(WebKit::NPJSObject::removeProperty):
(WebKit::NPJSObject::construct):
(WebKit::NPJSObject::invoke):

Source/WTF:

* wtf/Platform.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreAPIAPIUtilsh">trunk/Source/JavaScriptCore/API/APIUtils.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebindingsScriptFunctionCallcpp">trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebindingsScriptValuecpp">trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSRExitCompilercpp">trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOperationscpp">trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp">trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptCallStackFactorycpp">trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCachedCallh">trunk/Source/JavaScriptCore/interpreter/CachedCall.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameh">trunk/Source/JavaScriptCore/interpreter/CallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpreterh">trunk/Source/JavaScriptCore/interpreter/Interpreter.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterShadowChickencpp">trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITCodecpp">trunk/Source/JavaScriptCore/jit/JITCode.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITExceptionscpp">trunk/Source/JavaScriptCore/jit/JITExceptions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntExceptionscpp">trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerBytecodeSequencecpp">trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerCompilationcpp">trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerDatabasecpp">trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerOSRExitSitecpp">trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerOriginStackcpp">trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeArrayPrototypecpp">trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeBooleanConstructorcpp">trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCallDatacpp">trunk/Source/JavaScriptCore/runtime/CallData.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsh">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsExceptionscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPathsExceptions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCompletioncpp">trunk/Source/JavaScriptCore/runtime/Completion.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeConsoleObjectcpp">trunk/Source/JavaScriptCore/runtime/ConsoleObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDateConstructorcpp">trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeDatePrototypecpp">trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorConstructorcpp">trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorInstancecpp">trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorPrototypecpp">trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionHelpersh">trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeFunctionConstructorcpp">trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeFunctionPrototypecpp">trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGenericArgumentsInlinesh">trunk/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGetterSettercpp">trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInspectorInstrumentationObjectcpp">trunk/Source/JavaScriptCore/runtime/InspectorInstrumentationObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeInternalFunctioncpp">trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlCollatorcpp">trunk/Source/JavaScriptCore/runtime/IntlCollator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlCollatorConstructorcpp">trunk/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlCollatorPrototypecpp">trunk/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatcpp">trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatConstructorcpp">trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatPrototypecpp">trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlNumberFormatcpp">trunk/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlNumberFormatConstructorcpp">trunk/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlNumberFormatPrototypecpp">trunk/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlObjectcpp">trunk/Source/JavaScriptCore/runtime/IntlObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIntlObjectInlinesh">trunk/Source/JavaScriptCore/runtime/IntlObjectInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIteratorOperationscpp">trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeIteratorOperationsh">trunk/Source/JavaScriptCore/runtime/IteratorOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArraycpp">trunk/Source/JavaScriptCore/runtime/JSArray.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferConstructorcpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSArrayInlinesh">trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSBoundFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValuecpp">trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh">trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp">trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSFunctioncpp">trunk/Source/JavaScriptCore/runtime/JSFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewConstructorInlinesh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh">trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSJobcpp">trunk/Source/JavaScriptCore/runtime/JSJob.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleEnvironmentcpp">trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleLoadercpp">trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp">trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSModuleRecordcpp">trunk/Source/JavaScriptCore/runtime/JSModuleRecord.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSONObjectcpp">trunk/Source/JavaScriptCore/runtime/JSONObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectInlinesh">trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPromiseConstructorcpp">trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPropertyNameEnumeratorh">trunk/Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSPropertyNameIteratorcpp">trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopecpp">trunk/Source/JavaScriptCore/runtime/JSScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringcpp">trunk/Source/JavaScriptCore/runtime/JSString.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSStringJoinercpp">trunk/Source/JavaScriptCore/runtime/JSStringJoiner.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeLiteralParsercpp">trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMapConstructorcpp">trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMathObjectcpp">trunk/Source/JavaScriptCore/runtime/MathObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeModuleLoaderPrototypecpp">trunk/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNativeErrorConstructorcpp">trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeNumberConstructorcpp">trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectConstructorcpp">trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectConstructorh">trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectPrototypecpp">trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOperationscpp">trunk/Source/JavaScriptCore/runtime/Operations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionsh">trunk/Source/JavaScriptCore/runtime/Options.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePropertyDescriptorcpp">trunk/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProxyConstructorcpp">trunk/Source/JavaScriptCore/runtime/ProxyConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeProxyObjectcpp">trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeReflectObjectcpp">trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpConstructorcpp">trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpConstructorh">trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpObjectcpp">trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp">trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSetConstructorcpp">trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringConstructorcpp">trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringObjectcpp">trunk/Source/JavaScriptCore/runtime/StringObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStringPrototypecpp">trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolConstructorcpp">trunk/Source/JavaScriptCore/runtime/SymbolConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTemplateRegistrycpp">trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeThrowScopecpp">trunk/Source/JavaScriptCore/runtime/ThrowScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeThrowScopeh">trunk/Source/JavaScriptCore/runtime/ThrowScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakMapConstructorcpp">trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeWeakSetConstructorcpp">trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoretoolsJSDollarVMPrototypecpp">trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp">trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamSDPProcessorcpp">trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsjsArrayValuecpp">trunk/Source/WebCore/bindings/js/ArrayValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsDictionarycpp">trunk/Source/WebCore/bindings/js/Dictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSApplePaySessionCustomcpp">trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSAudioTrackCustomcpp">trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCSSStyleDeclarationCustomcpp">trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp">trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp">trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp">trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomElementInterfacecpp">trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomElementRegistryCustomcpp">trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingcpp">trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMGlobalObjectcpp">trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMGlobalObjectTaskcpp">trunk/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMIteratorh">trunk/Source/WebCore/bindings/js/JSDOMIterator.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMPromisecpp">trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMPromiseh">trunk/Source/WebCore/bindings/js/JSDOMPromise.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMStringMapCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBasecpp">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDataCueCustomcpp">trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDeviceMotionEventCustomcpp">trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionarycpp">trunk/Source/WebCore/bindings/js/JSDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionaryh">trunk/Source/WebCore/bindings/js/JSDictionary.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDocumentCustomcpp">trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSEventListenercpp">trunk/Source/WebCore/bindings/js/JSEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSGeolocationCustomcpp">trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLAllCollectionCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLCanvasElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHistoryCustomcpp">trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSIDBDatabaseCustomcpp">trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSLazyEventListenercpp">trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMainThreadExecStateh">trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessageEventCustomcpp">trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessagePortCustomcpp">trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessagePortCustomh">trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp">trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp">trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNodeOrStringcpp">trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSQLTransactionCustomcpp">trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSVGLengthCustomcpp">trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSStorageCustomcpp">trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSTextTrackCustomcpp">trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSVideoTrackCustomcpp">trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp">trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebKitSubtleCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerCustomcpp">trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerGlobalScopeCustomcpp">trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsReadableStreamDefaultControllercpp">trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsReadableStreamDefaultControllerh">trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScheduledActioncpp">trunk/Source/WebCore/bindings/js/ScheduledAction.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptGlobalObjectcpp">trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptControllercpp">trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgeNP_jsobjectcpp">trunk/Source/WebCore/bridge/NP_jsobject.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgecc_instancecpp">trunk/Source/WebCore/bridge/c/c_instance.cpp</a></li>
<li><a href="#trunkSourceWebCorebridgeobjcWebScriptObjectmm">trunk/Source/WebCore/bridge/objc/WebScriptObject.mm</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionParsercpp">trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacPluginsHostedNetscapePluginInstanceProxymm">trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinPluginsPluginPackagecpp">trunk/Source/WebKit/win/Plugins/PluginPackage.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsNetscapeNPJSObjectcpp">trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreruntimeCatchScopecpp">trunk/Source/JavaScriptCore/runtime/CatchScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCatchScopeh">trunk/Source/JavaScriptCore/runtime/CatchScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionEventLocationcpp">trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionEventLocationh">trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionScopecpp">trunk/Source/JavaScriptCore/runtime/ExceptionScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExceptionScopeh">trunk/Source/JavaScriptCore/runtime/ExceptionScope.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersruntimeCatchScopeh">trunk/Source/WebCore/ForwardingHeaders/runtime/CatchScope.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreruntimeThrowScopeLocationh">trunk/Source/JavaScriptCore/runtime/ThrowScopeLocation.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreAPIAPIUtilsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/API/APIUtils.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/APIUtils.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/API/APIUtils.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -38,11 +38,13 @@
</span><span class="cx"> 
</span><span class="cx"> inline ExceptionStatus handleExceptionIfNeeded(JSC::ExecState* exec, JSValueRef* returnedExceptionRef)
</span><span class="cx"> {
</span><del>-    if (exec-&gt;hadException()) {
-        JSC::Exception* exception = exec-&gt;exception();
</del><ins>+    JSC::VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    if (UNLIKELY(scope.exception())) {
+        JSC::Exception* exception = scope.exception();
</ins><span class="cx">         if (returnedExceptionRef)
</span><span class="cx">             *returnedExceptionRef = toRef(exec, exception-&gt;value());
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx"> #if ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">         exec-&gt;vmEntryGlobalObject()-&gt;inspectorController().reportAPIException(exec, exception);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -631,6 +631,7 @@
</span><span class="cx">     runtime/BooleanObject.cpp
</span><span class="cx">     runtime/BooleanPrototype.cpp
</span><span class="cx">     runtime/CallData.cpp
</span><ins>+    runtime/CatchScope.cpp
</ins><span class="cx">     runtime/ClonedArguments.cpp
</span><span class="cx">     runtime/CodeCache.cpp
</span><span class="cx">     runtime/CodeSpecializationKind.cpp
</span><span class="lines">@@ -660,8 +661,11 @@
</span><span class="cx">     runtime/ErrorInstance.cpp
</span><span class="cx">     runtime/ErrorPrototype.cpp
</span><span class="cx">     runtime/Exception.cpp
</span><ins>+    runtime/ExceptionEvent.cpp
+    runtime/ExceptionEventLocation.cpp
</ins><span class="cx">     runtime/ExceptionFuzz.cpp
</span><span class="cx">     runtime/ExceptionHelpers.cpp
</span><ins>+    runtime/ExceptionScope.cpp
</ins><span class="cx">     runtime/Executable.cpp
</span><span class="cx">     runtime/FunctionConstructor.cpp
</span><span class="cx">     runtime/FunctionExecutableDump.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,751 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        This patch refactors the ThrowScope class, and introduces a base ExceptionScope
+        that ThrowScope extends.  A CatchScope which extends the ExceptionScope is also
+        introduced.
+
+        ENABLE(THROW_SCOPE_VERIFICATION) is now renamed to ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+        which is a more suitable name now.
+
+        Note: exception scope verification is still disabled by default.  There are still
+        many places that need to be fixed up or re-expressed in a way that is friendly
+        to the verification.  I'll address those in subsequent patches.
+
+        After this patch, the code will statically enforce that:
+        1. all calls to throwException() go through a ThrowScope.
+        2. all calls to clearException() go through a CatchScope.
+        3. all exception checks go through an ExceptionScope in the form of a ThrowScope
+           or CatchScope.
+
+        A Summary of how to use ExceptionScopes
+        =======================================
+        1. If a function can throw a JS exception, it should declare a ThrowScope at the
+           top of the function (as early as possible).
+
+        2. If a function can clear JS exceptions, it should declare a CatchScope at the
+           top of the function (as early as possible).
+
+        Declaring a ThrowScope in a function means that the function may throw an exception
+        that its caller will have to handle.  Declaring a CatchScope in a function means
+        that the function intends to clear pending exceptions before returning to its
+        caller. 
+
+        For more details, see the notes below.
+        
+        Everything you may want to know about ExceptionScopes
+        =====================================================
+        ExceptionScope verification works to simulate exception throws and detect cases
+        where exception checks are missing.  The notes below will cover:
+
+            1. The VM::m_needExceptionCheck bit
+            2. ThrowScopes and CatchScopes
+            3. Verification of needed exception checks
+            3. Checking Exceptions
+            4. Simulating throws
+            5. Using ThrowScope::release()
+            6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()
+            7. Checking exceptions by checking callee results
+            8. Debugging verification errors
+
+        1. The VM::m_needExceptionCheck bit
+
+           The VM has a m_needExceptionCheck bit that indicates when an exception may be
+           thrown.  You can think of the m_needExceptionCheck bit being set as a simulated
+           throw.
+
+        2. ThrowScopes and CatchScopes
+
+           Only ThrowScopes may throwException.  Only CatchScopes may catchException.
+
+           Every throw site must declare a ThrowScope instance using DECLARE_THROW_SCOPE
+           at the top of its function (as early as possible) e.g.

+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+                    ...
+                    throwException(exec, scope, ...);
+                }
+
+           Note: by convention, every throw helper function must take a ThrowScope argument
+           instead of instantiating its own ThrowScope.  This allows the throw to be
+           attributed to the client code rather than the throw helper itself.
+
+           Every catch site (i.e. a site that calls clearException()) must declare a
+           CatchScope instance using DECLARE_CATCH_SCOPE at the top of its function.
+
+           If a function can both throw or clear exceptions, then the ThrowScope should
+           be declared first so that it can simulate a throw to the function's caller.
+
+           Note: ThrowScope and CatchScope both extend ExceptionScope so that ThrowScopes
+           can be aware if there's an enclosing CatchScope between it and the point where
+           C++ code returns to JS code.  This is needed to determine if the ThrowScope
+           should simulate a re-throw or not.  See (4) below for more details on returning
+           to JS code.
+
+        3. Verification of needed exception checks
+
+           a. On construction, each ThrowScope and CatchScope will verify that
+              VM::m_needExceptionCheck is not set.

+              This ensures that the caller of the current function has checked for exceptions
+              where needed before doing more work which lead to calling the current function.
+
+           b. On destruction, each ThrowScope and CatchScope will verify that
+              VM::m_needExceptionCheck is not set. This verification will be skipped if
+              the ThrowScope has been released (see (5) below).
+
+              This ensures that the function that owns this exception scope is not missing
+              any exception checks before returning.
+
+           c. When throwing an exception, the ThrowScope will verify that VM::m_needExceptionCheck
+              is not already set, unless it's been ask to rethrow the same Exception object.
+
+        4. Simulating throws
+
+           Throws are simulated by setting the m_needExceptionCheck bit.
+
+           The bit will only be set in the ThrowScope destructor except when the ThrowScope
+           detects the caller is a LLInt or JIT function.  LLInt or JIT functions will always
+           check for exceptions after a host C++ function returns to it.  However, they will
+           not clear the m_needExceptionCheck bit.
+
+           Hence, if the ThrowScope destructor detects the caller is a LLInt or JIT function,
+           it will just skip the setting of the bit.
+
+           Note: it is not needed nor correct to set the m_needExceptionCheck bit in the
+           throwException methods.  This is because, in practice, we always return
+           immediately after throwing an exception.  It doesn't make sense to set the bit in
+           the throw just to have to clear it immediately after before we do verification in
+           the ThrowScope destructor.
+
+        5. Using ThrowScope::release()
+
+           Calling release() means that the scope is released from its obligation to
+           verify the VM::m_needExceptionCheck bit on destruction.
+
+           release() should only be used at the bottom of a function if:
+
+           a. This function is going to let its caller check and handle the exception, e.g.
+
+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+                    auto result = goo(); // may throw.
+
+                    ... // Code that will are not affected by a pending exceptions.
+
+                    scope.release(); // tell the ThrowScope that the caller will handle the exception.
+                    return result;
+                }
+
+           b. This function is going to do a tail call that may throw.
+
+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+                    ...
+                    scope.release(); // tell the ThrowScope that the caller will handle the exception.
+                    return goo(); // may throw.
+                }
+
+              release() should not be used in code paths that branch. For example:
+
+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+
+                    auto result = goo1(); // may throw.
+                    scope.release(); // WRONG !!! Don't do this.
+                    if (result)
+                        return;
+
+                    result = goo2(); // may throw.
+                    ...
+                    return result;
+                }
+
+            The above will result in a verification error in goo2()'s ThrowScope.  The
+            proper way to fix this verification is to do either (6) or (7) below.
+
+         6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()
+
+            ThrowScope/CatchScope::exception() returns the thrown Exception object if
+            there is one pending.  Else, it returns nullptr.
+
+            It also clears the m_needExceptionCheck bit thereby indicating that we've
+            satisfied the needed exception check.  For example,
+
+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+
+                    auto result = goo1(); // may throw.
+                    if (scope.exception())
+                        return;
+
+                    result = goo2(); // may throw.
+                    ...
+                    return result;
+                }
+
+            But sometimes, for optimization reasons, we may choose to test the result of
+            the callee function instead doing a load of the VM exception value.  See (7)
+            below.
+
+         7. Checking exceptions by checking callee results
+
+            This approach should only be applied when it makes a difference to performance.
+            If we need to do this, we should add an ASSERT() that invokes the scope's
+            exception() method to verify the result.  Since exception scope verification
+            is only done on DEBUG builds, this ASSERT will satisfy the verification
+            requirements without impacting performance.  For example,
+
+                void foo(...)
+                {
+                    auto scope = DECLARE_THROW_SCOPE(vm);
+
+                    bool failed = goo1(); // may throw.
+                    ASSERT(!!scope.exception() == failed)
+                    if (failed)
+                        return;
+
+                    result = goo2(); // may throw.
+                    ...
+                    return result;
+                }
+
+         8. Debugging verification errors
+
+            a. When verification fails, you will see a message followed by an assertion
+               failure.  For example:
+
+            ERROR: Unchecked JS exception:
+                This scope can throw a JS exception: setUpCall @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1245
+                    (ExceptionScope::m_recursionDepth was ...)
+                But the exception was unchecked as of this scope: varargsSetup @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1398
+                    (ExceptionScope::m_recursionDepth was ...)
+                [ backtrace here ]
+
+               The message tells you that failure was detected at in varargsSetup() at
+               LLIntSlowPaths.cpp line 1398, and that the missing exception check should
+               have happened somewhere between the call to setUpCall() at LLIntSlowPaths.cpp
+               line 1245 and it.
+
+               If that is insufficient information, you can ...
+
+            b. Dump simulated throws
+
+               Re-run the test case with JSC_dumpSimulatedThrows=true.  You will also see
+               back traces at each simulated throw.
+
+            c. Narrowing down the source of a simulated throw
+
+               Another technique for narrowing down the source of simulated throws is by
+               further dividing a function to smaller regions by separating each region
+               with additional local throw scopes.  For example,
+
+                ... // Region 1
+                { auto scope = DECLARE_THROW_SCOPE(vm); }
+                ... // Region 2
+                { auto scope = DECLARE_THROW_SCOPE(vm); }
+                ... // Region 3
+
+        * API/APIUtils.h:
+        (handleExceptionIfNeeded):
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bindings/ScriptFunctionCall.cpp:
+        (Deprecated::ScriptFunctionCall::call):
+        * bindings/ScriptValue.cpp:
+        (Deprecated::ScriptValue::toString):
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::pauseIfNeeded):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::evaluateWithScopeExtension):
+        * dfg/DFGOSRExitCompiler.cpp:
+        * dfg/DFGOperations.cpp:
+        (JSC::DFG::operationPutByValInternal):
+        * inspector/InjectedScriptManager.cpp:
+        (Inspector::InjectedScriptManager::createInjectedScript):
+        * inspector/JSGlobalObjectInspectorController.cpp:
+        (Inspector::JSGlobalObjectInspectorController::reportAPIException):
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
+        (Inspector::JSInjectedScriptHost::getInternalProperties):
+        (Inspector::JSInjectedScriptHost::weakMapEntries):
+        (Inspector::JSInjectedScriptHost::weakSetEntries):
+        (Inspector::JSInjectedScriptHost::iteratorEntries):
+        * inspector/JSJavaScriptCallFrame.cpp:
+        (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
+        * inspector/ScriptCallStackFactory.cpp:
+        (Inspector::extractSourceInformationFromException):
+        * interpreter/CachedCall.h:
+        (JSC::CachedCall::CachedCall):
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::clearException): Deleted.
+        (JSC::ExecState::exception): Deleted.
+        (JSC::ExecState::hadException): Deleted.
+        (JSC::ExecState::lastException): Deleted.
+        (JSC::ExecState::clearLastException): Deleted.
+        * interpreter/Interpreter.cpp:
+        (JSC::eval):
+        (JSC::sizeOfVarargs):
+        (JSC::notifyDebuggerOfUnwinding):
+        (JSC::Interpreter::unwind):
+        (JSC::Interpreter::execute):
+        (JSC::Interpreter::executeCall):
+        (JSC::Interpreter::executeConstruct):
+        (JSC::Interpreter::prepareForRepeatCall):
+        (JSC::Interpreter::debug):
+        * interpreter/Interpreter.h:
+        (JSC::SuspendExceptionScope::SuspendExceptionScope):
+        * interpreter/ShadowChicken.cpp:
+        (JSC::ShadowChicken::functionsOnStack):
+        * jit/JITCode.cpp:
+        (JSC::JITCode::execute):
+        * jit/JITExceptions.cpp:
+        (JSC::genericUnwind):
+        * jit/JITOperations.cpp:
+        (JSC::getByVal):
+        * jsc.cpp:
+        (WTF::ImpureGetter::getOwnPropertySlot):
+        (GlobalObject::moduleLoaderResolve):
+        (GlobalObject::moduleLoaderFetch):
+        (functionCreateElement):
+        (functionRun):
+        (functionRunString):
+        (functionLoad):
+        (functionLoadString):
+        (functionReadFile):
+        (functionCheckSyntax):
+        (functionSetRandomSeed):
+        (functionLoadModule):
+        (functionCreateBuiltin):
+        (functionCheckModuleSyntax):
+        (functionGenerateHeapSnapshot):
+        (functionSamplingProfilerStackTraces):
+        (dumpException):
+        (checkUncaughtException):
+        (runWithScripts):
+        (runInteractive):
+        * llint/LLIntExceptions.cpp:
+        (JSC::LLInt::returnToThrow):
+        (JSC::LLInt::callToThrow):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * profiler/ProfilerBytecodeSequence.cpp:
+        (JSC::Profiler::BytecodeSequence::addSequenceProperties):
+        * profiler/ProfilerCompilation.cpp:
+        (JSC::Profiler::Compilation::toJS):
+        * profiler/ProfilerDatabase.cpp:
+        (JSC::Profiler::Database::toJS):
+        * profiler/ProfilerOSRExitSite.cpp:
+        (JSC::Profiler::OSRExitSite::toJS):
+        * profiler/ProfilerOriginStack.cpp:
+        (JSC::Profiler::OriginStack::toJS):
+        * runtime/ArrayPrototype.cpp:
+        (JSC::speciesConstructArray):
+        (JSC::shift):
+        (JSC::unshift):
+        (JSC::arrayProtoFuncToString):
+        (JSC::arrayProtoFuncToLocaleString):
+        (JSC::slowJoin):
+        (JSC::fastJoin):
+        (JSC::arrayProtoFuncJoin):
+        (JSC::arrayProtoFuncPop):
+        (JSC::arrayProtoFuncPush):
+        (JSC::arrayProtoFuncReverse):
+        (JSC::arrayProtoFuncShift):
+        (JSC::arrayProtoFuncSlice):
+        (JSC::arrayProtoFuncSplice):
+        (JSC::arrayProtoFuncUnShift):
+        (JSC::arrayProtoFuncIndexOf):
+        (JSC::arrayProtoFuncLastIndexOf):
+        (JSC::moveElements):
+        (JSC::concatAppendOne):
+        (JSC::arrayProtoPrivateFuncConcatMemcpy):
+        * runtime/BooleanConstructor.cpp:
+        (JSC::constructWithBooleanConstructor):
+        * runtime/CallData.cpp:
+        (JSC::call):
+        * runtime/CatchScope.cpp: Added.
+        (JSC::CatchScope::CatchScope):
+        (JSC::CatchScope::~CatchScope):
+        * runtime/CatchScope.h: Added.
+        (JSC::CatchScope::clearException):
+        (JSC::CatchScope::CatchScope):
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::SLOW_PATH_DECL):
+        * runtime/CommonSlowPaths.h:
+        (JSC::CommonSlowPaths::opIn):
+        * runtime/CommonSlowPathsExceptions.cpp:
+        (JSC::CommonSlowPaths::interpreterThrowInCaller):
+        * runtime/Completion.cpp:
+        (JSC::evaluate):
+        (JSC::rejectPromise):
+        (JSC::loadAndEvaluateModule):
+        (JSC::loadModule):
+        * runtime/ConsoleObject.cpp:
+        (JSC::consoleProtoFuncAssert):
+        (JSC::consoleProtoFuncProfile):
+        (JSC::consoleProtoFuncProfileEnd):
+        (JSC::consoleProtoFuncTakeHeapSnapshot):
+        (JSC::consoleProtoFuncTime):
+        (JSC::consoleProtoFuncTimeEnd):
+        * runtime/DateConstructor.cpp:
+        (JSC::constructDate):
+        (JSC::dateParse):
+        * runtime/DatePrototype.cpp:
+        (JSC::dateProtoFuncToPrimitiveSymbol):
+        (JSC::dateProtoFuncToJSON):
+        * runtime/ErrorConstructor.cpp:
+        (JSC::Interpreter::constructWithErrorConstructor):
+        * runtime/ErrorInstance.cpp:
+        (JSC::ErrorInstance::sanitizedToString):
+        * runtime/ErrorPrototype.cpp:
+        (JSC::errorProtoFuncToString):
+        * runtime/ExceptionEventLocation.cpp: Added.
+        (WTF::printInternal):
+        * runtime/ExceptionEventLocation.h: Copied from Source/JavaScriptCore/runtime/ThrowScopeLocation.h.
+        (JSC::ExceptionEventLocation::ExceptionEventLocation):
+        (JSC::ThrowScopeLocation::ThrowScopeLocation): Deleted.
+        * runtime/ExceptionHelpers.h:
+        * runtime/ExceptionScope.cpp: Added.
+        (JSC::ExceptionScope::ExceptionScope):
+        (JSC::ExceptionScope::~ExceptionScope):
+        * runtime/ExceptionScope.h: Added.
+        (JSC::ExceptionScope::vm):
+        (JSC::ExceptionScope::recursionDepth):
+        (JSC::ExceptionScope::exception):
+        (JSC::ExceptionScope::ExceptionScope):
+        * runtime/FunctionConstructor.cpp:
+        (JSC::constructFunctionSkippingEvalEnabledCheck):
+        * runtime/FunctionPrototype.cpp:
+        (JSC::functionProtoFuncBind):
+        * runtime/GenericArgumentsInlines.h:
+        (JSC::GenericArguments&lt;Type&gt;::copyToArguments):
+        * runtime/GetterSetter.cpp:
+        (JSC::callGetter):
+        * runtime/InspectorInstrumentationObject.cpp:
+        (JSC::inspectorInstrumentationObjectLog):
+        * runtime/InternalFunction.cpp:
+        (JSC::InternalFunction::createSubclassStructure):
+        * runtime/IntlCollator.cpp:
+        (JSC::IntlCollator::initializeCollator):
+        (JSC::IntlCollator::createCollator):
+        (JSC::IntlCollator::resolvedOptions):
+        * runtime/IntlCollatorConstructor.cpp:
+        (JSC::constructIntlCollator):
+        (JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
+        * runtime/IntlCollatorPrototype.cpp:
+        (JSC::IntlCollatorFuncCompare):
+        (JSC::IntlCollatorPrototypeGetterCompare):
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::toDateTimeOptionsAnyDate):
+        (JSC::IntlDateTimeFormat::initializeDateTimeFormat):
+        (JSC::IntlDateTimeFormat::resolvedOptions):
+        (JSC::IntlDateTimeFormat::format):
+        * runtime/IntlDateTimeFormatConstructor.cpp:
+        (JSC::constructIntlDateTimeFormat):
+        (JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
+        * runtime/IntlDateTimeFormatPrototype.cpp:
+        (JSC::IntlDateTimeFormatFuncFormatDateTime):
+        (JSC::IntlDateTimeFormatPrototypeGetterFormat):
+        * runtime/IntlNumberFormat.cpp:
+        (JSC::IntlNumberFormat::initializeNumberFormat):
+        (JSC::IntlNumberFormat::createNumberFormat):
+        (JSC::IntlNumberFormat::resolvedOptions):
+        * runtime/IntlNumberFormatConstructor.cpp:
+        (JSC::constructIntlNumberFormat):
+        (JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
+        * runtime/IntlNumberFormatPrototype.cpp:
+        (JSC::IntlNumberFormatFuncFormatNumber):
+        (JSC::IntlNumberFormatPrototypeGetterFormat):
+        * runtime/IntlObject.cpp:
+        (JSC::intlBooleanOption):
+        (JSC::intlStringOption):
+        (JSC::intlNumberOption):
+        (JSC::canonicalizeLocaleList):
+        (JSC::supportedLocales):
+        * runtime/IntlObjectInlines.h:
+        (JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):
+        * runtime/IteratorOperations.cpp:
+        (JSC::iteratorNext):
+        (JSC::iteratorStep):
+        (JSC::iteratorClose):
+        (JSC::iteratorForIterable):
+        * runtime/IteratorOperations.h:
+        (JSC::forEachInIterable):
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::pop):
+        (JSC::JSArray::push):
+        (JSC::JSArray::copyToArguments):
+        * runtime/JSArrayBufferConstructor.cpp:
+        (JSC::constructArrayBuffer):
+        * runtime/JSArrayBufferPrototype.cpp:
+        (JSC::arrayBufferProtoFuncSlice):
+        * runtime/JSArrayInlines.h:
+        (JSC::getLength):
+        (JSC::toLength):
+        * runtime/JSBoundFunction.cpp:
+        (JSC::getBoundFunctionStructure):
+        (JSC::JSBoundFunction::create):
+        * runtime/JSCJSValue.cpp:
+        (JSC::JSValue::putToPrimitive):
+        (JSC::JSValue::putToPrimitiveByIndex):
+        (JSC::JSValue::toStringSlowCase):
+        * runtime/JSCJSValueInlines.h:
+        (JSC::toPreferredPrimitiveType):
+        (JSC::JSValue::getPropertySlot):
+        (JSC::JSValue::equalSlowCaseInline):
+        * runtime/JSDataViewPrototype.cpp:
+        (JSC::getData):
+        (JSC::setData):
+        * runtime/JSFunction.cpp:
+        (JSC::JSFunction::setFunctionName):
+        * runtime/JSGenericTypedArrayView.h:
+        (JSC::JSGenericTypedArrayView::setIndex):
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::constructGenericTypedArrayViewFromIterator):
+        (JSC::constructGenericTypedArrayViewWithArguments):
+        (JSC::constructGenericTypedArrayView):
+        * runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
+        (JSC::speciesConstruct):
+        (JSC::genericTypedArrayViewProtoFuncCopyWithin):
+        (JSC::genericTypedArrayViewProtoFuncIncludes):
+        (JSC::genericTypedArrayViewProtoFuncIndexOf):
+        (JSC::genericTypedArrayViewProtoFuncJoin):
+        (JSC::genericTypedArrayViewProtoFuncLastIndexOf):
+        (JSC::genericTypedArrayViewProtoFuncSlice):
+        (JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
+        * runtime/JSGlobalObject.h:
+        (JSC::constructEmptyArray):
+        (JSC::constructArray):
+        (JSC::constructArrayNegativeIndexed):
+        * runtime/JSGlobalObjectFunctions.cpp:
+        (JSC::globalFuncEval):
+        * runtime/JSJob.cpp:
+        (JSC::JSJobMicrotask::run):
+        * runtime/JSModuleEnvironment.cpp:
+        (JSC::JSModuleEnvironment::getOwnPropertySlot):
+        * runtime/JSModuleLoader.cpp:
+        (JSC::JSModuleLoader::fetch):
+        * runtime/JSModuleNamespaceObject.cpp:
+        (JSC::JSModuleNamespaceObject::finishCreation):
+        (JSC::JSModuleNamespaceObject::getOwnPropertySlot):
+        * runtime/JSModuleRecord.cpp:
+        (JSC::JSModuleRecord::instantiateDeclarations):
+        * runtime/JSONObject.cpp:
+        (JSC::Stringifier::Stringifier):
+        (JSC::Stringifier::stringify):
+        (JSC::Stringifier::toJSON):
+        (JSC::Stringifier::appendStringifiedValue):
+        (JSC::Stringifier::Holder::appendNextProperty):
+        (JSC::Walker::walk):
+        (JSC::JSONProtoFuncParse):
+        * runtime/JSObject.cpp:
+        (JSC::ordinarySetSlow):
+        (JSC::JSObject::setPrototypeWithCycleCheck):
+        (JSC::callToPrimitiveFunction):
+        (JSC::JSObject::ordinaryToPrimitive):
+        (JSC::JSObject::defaultHasInstance):
+        (JSC::JSObject::getPropertyNames):
+        (JSC::JSObject::toNumber):
+        (JSC::JSObject::toString):
+        (JSC::JSObject::defineOwnNonIndexProperty):
+        (JSC::JSObject::getGenericPropertyNames):
+        (JSC::JSObject::getMethod):
+        * runtime/JSObjectInlines.h:
+        (JSC::createListFromArrayLike):
+        (JSC::JSObject::getPropertySlot):
+        (JSC::JSObject::getNonIndexPropertySlot):
+        * runtime/JSPromiseConstructor.cpp:
+        (JSC::constructPromise):
+        * runtime/JSPropertyNameEnumerator.h:
+        (JSC::propertyNameEnumerator):
+        * runtime/JSPropertyNameIterator.cpp:
+        (JSC::JSPropertyNameIterator::create):
+        * runtime/JSScope.cpp:
+        (JSC::isUnscopable):
+        (JSC::JSScope::resolve):
+        * runtime/JSString.cpp:
+        (JSC::JSString::equalSlowCase):
+        * runtime/JSStringJoiner.cpp:
+        (JSC::JSStringJoiner::join):
+        * runtime/LiteralParser.cpp:
+        (JSC::LiteralParser&lt;CharType&gt;::parse):
+        * runtime/MapConstructor.cpp:
+        (JSC::constructMap):
+        * runtime/MathObject.cpp:
+        (JSC::mathProtoFuncClz32):
+        (JSC::mathProtoFuncHypot):
+        (JSC::mathProtoFuncIMul):
+        * runtime/ModuleLoaderPrototype.cpp:
+        (JSC::moduleLoaderPrototypeParseModule):
+        (JSC::moduleLoaderPrototypeRequestedModules):
+        (JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
+        * runtime/NativeErrorConstructor.cpp:
+        (JSC::Interpreter::constructWithNativeErrorConstructor):
+        * runtime/NumberConstructor.cpp:
+        (JSC::constructWithNumberConstructor):
+        * runtime/ObjectConstructor.cpp:
+        (JSC::constructObject):
+        (JSC::objectConstructorGetPrototypeOf):
+        (JSC::objectConstructorSetPrototypeOf):
+        (JSC::objectConstructorGetOwnPropertyDescriptor):
+        (JSC::objectConstructorGetOwnPropertyDescriptors):
+        (JSC::objectConstructorGetOwnPropertyNames):
+        (JSC::objectConstructorGetOwnPropertySymbols):
+        (JSC::objectConstructorKeys):
+        (JSC::ownEnumerablePropertyKeys):
+        (JSC::toPropertyDescriptor):
+        (JSC::objectConstructorDefineProperty):
+        (JSC::defineProperties):
+        (JSC::objectConstructorSeal):
+        (JSC::objectConstructorFreeze):
+        (JSC::objectConstructorIsSealed):
+        (JSC::objectConstructorIsFrozen):
+        (JSC::objectConstructorIsExtensible):
+        (JSC::ownPropertyKeys):
+        * runtime/ObjectConstructor.h:
+        (JSC::constructObjectFromPropertyDescriptor):
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncHasOwnProperty):
+        (JSC::objectProtoFuncIsPrototypeOf):
+        (JSC::objectProtoFuncDefineGetter):
+        (JSC::objectProtoFuncDefineSetter):
+        (JSC::objectProtoFuncLookupGetter):
+        (JSC::objectProtoFuncLookupSetter):
+        (JSC::objectProtoFuncPropertyIsEnumerable):
+        (JSC::objectProtoFuncToLocaleString):
+        (JSC::objectProtoFuncToString):
+        * runtime/Operations.cpp:
+        (JSC::jsAddSlowCase):
+        * runtime/Options.h:
+        * runtime/PropertyDescriptor.cpp:
+        (JSC::PropertyDescriptor::slowGetterSetter):
+        * runtime/ProxyConstructor.cpp:
+        (JSC::makeRevocableProxy):
+        * runtime/ProxyObject.cpp:
+        (JSC::ProxyObject::toStringName):
+        (JSC::performProxyGet):
+        (JSC::ProxyObject::performGet):
+        (JSC::ProxyObject::performInternalMethodGetOwnProperty):
+        (JSC::ProxyObject::performHasProperty):
+        (JSC::ProxyObject::performPut):
+        (JSC::ProxyObject::putByIndexCommon):
+        (JSC::performProxyCall):
+        (JSC::performProxyConstruct):
+        (JSC::ProxyObject::performDelete):
+        (JSC::ProxyObject::performPreventExtensions):
+        (JSC::ProxyObject::performIsExtensible):
+        (JSC::ProxyObject::performDefineOwnProperty):
+        (JSC::ProxyObject::performGetOwnPropertyNames):
+        (JSC::ProxyObject::performSetPrototype):
+        (JSC::ProxyObject::performGetPrototype):
+        * runtime/ReflectObject.cpp:
+        (JSC::reflectObjectConstruct):
+        (JSC::reflectObjectDefineProperty):
+        (JSC::reflectObjectGet):
+        (JSC::reflectObjectGetOwnPropertyDescriptor):
+        (JSC::reflectObjectIsExtensible):
+        (JSC::reflectObjectPreventExtensions):
+        (JSC::reflectObjectSet):
+        (JSC::reflectObjectSetPrototypeOf):
+        * runtime/RegExpConstructor.cpp:
+        (JSC::toFlags):
+        (JSC::regExpCreate):
+        (JSC::constructRegExp):
+        * runtime/RegExpConstructor.h:
+        (JSC::isRegExp):
+        * runtime/RegExpObject.cpp:
+        (JSC::collectMatches):
+        (JSC::RegExpObject::matchGlobal):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::regExpProtoFuncCompile):
+        (JSC::flagsString):
+        (JSC::regExpProtoFuncToString):
+        (JSC::regExpProtoGetterFlags):
+        (JSC::regExpProtoFuncSearchFast):
+        (JSC::regExpProtoFuncSplitFast):
+        * runtime/SetConstructor.cpp:
+        (JSC::constructSet):
+        * runtime/StringConstructor.cpp:
+        (JSC::stringFromCodePoint):
+        (JSC::constructWithStringConstructor):
+        * runtime/StringObject.cpp:
+        (JSC::StringObject::defineOwnProperty):
+        * runtime/StringPrototype.cpp:
+        (JSC::replaceUsingRegExpSearch):
+        (JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
+        (JSC::replaceUsingStringSearch):
+        (JSC::replace):
+        (JSC::stringProtoFuncReplaceUsingRegExp):
+        (JSC::stringProtoFuncReplaceUsingStringSearch):
+        (JSC::stringProtoFuncCodePointAt):
+        (JSC::stringProtoFuncSlice):
+        (JSC::stringProtoFuncSplitFast):
+        (JSC::stringProtoFuncSubstr):
+        (JSC::stringProtoFuncSubstring):
+        (JSC::stringProtoFuncLocaleCompare):
+        (JSC::toLocaleCase):
+        (JSC::stringProtoFuncBig):
+        (JSC::stringProtoFuncSmall):
+        (JSC::stringProtoFuncBlink):
+        (JSC::stringProtoFuncBold):
+        (JSC::stringProtoFuncFixed):
+        (JSC::stringProtoFuncItalics):
+        (JSC::stringProtoFuncStrike):
+        (JSC::stringProtoFuncSub):
+        (JSC::stringProtoFuncSup):
+        (JSC::stringProtoFuncFontcolor):
+        (JSC::stringProtoFuncFontsize):
+        (JSC::stringProtoFuncAnchor):
+        (JSC::stringProtoFuncLink):
+        (JSC::trimString):
+        (JSC::stringProtoFuncStartsWith):
+        (JSC::stringProtoFuncEndsWith):
+        (JSC::stringIncludesImpl):
+        (JSC::stringProtoFuncIncludes):
+        (JSC::builtinStringIncludesInternal):
+        (JSC::stringProtoFuncNormalize):
+        * runtime/SymbolConstructor.cpp:
+        (JSC::symbolConstructorFor):
+        * runtime/TemplateRegistry.cpp:
+        (JSC::TemplateRegistry::getTemplateObject):
+        * runtime/ThrowScope.cpp:
+        (JSC::ThrowScope::ThrowScope):
+        (JSC::ThrowScope::~ThrowScope):
+        (JSC::ThrowScope::throwException):
+        (JSC::ThrowScope::simulateThrow):
+        (JSC::ThrowScope::printIfNeedCheck): Deleted.
+        (JSC::ThrowScope::verifyExceptionCheckNeedIsSatisfied): Deleted.
+        * runtime/ThrowScope.h:
+        (JSC::ThrowScope::release):
+        (JSC::ThrowScope::ThrowScope):
+        (JSC::ThrowScope::throwException):
+        (JSC::ThrowScope::vm): Deleted.
+        (JSC::ThrowScope::exception): Deleted.
+        * runtime/ThrowScopeLocation.h: Removed.
+        * runtime/VM.cpp:
+        (JSC::VM::verifyExceptionCheckNeedIsSatisfied):
+        * runtime/VM.h:
+        (JSC::VM::exception):
+        (JSC::VM::clearException):
+        (JSC::VM::setException): Deleted.
+        * runtime/WeakMapConstructor.cpp:
+        (JSC::constructWeakMap):
+        * runtime/WeakSetConstructor.cpp:
+        (JSC::constructWeakSet):
+        * tools/JSDollarVMPrototype.cpp:
+        (JSC::functionPrint):
+
</ins><span class="cx"> 2016-09-07  Andy VanWagoner  &lt;thetalecrafter@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [INTL] some valid language tags cause errors in Intl constructors
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -2148,12 +2148,17 @@
</span><span class="cx">                 FE5068671AE25E280009DAB7 /* DeferredSourceDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */; };
</span><span class="cx">                 FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */; };
</span><span class="cx">                 FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                FE6029D91D6E1E4F0030204D /* ThrowScopeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6029D81D6E1E330030204D /* ThrowScopeLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                FE6029D91D6E1E4F0030204D /* ExceptionEventLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6029D81D6E1E330030204D /* ExceptionEventLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FE6491371D78F01D00A694D4 /* ExceptionScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6491361D78F01300A694D4 /* ExceptionScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FE6491391D78F3AF00A694D4 /* ExceptionScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6491381D78F3A300A694D4 /* ExceptionScope.cpp */; };
</ins><span class="cx">                 FE68C6371B90DE040042BCB3 /* MacroAssemblerPrinter.h in Headers */ = {isa = PBXBuildFile; fileRef = FE68C6361B90DDD90042BCB3 /* MacroAssemblerPrinter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE68C6381B90DE0B0042BCB3 /* MacroAssemblerPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE68C6351B90DDD90042BCB3 /* MacroAssemblerPrinter.cpp */; };
</span><span class="cx">                 FE7BA60F1A1A7CEC00F1F7B4 /* HeapVerifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE7BA60D1A1A7CEC00F1F7B4 /* HeapVerifier.cpp */; };
</span><span class="cx">                 FE7BA6101A1A7CEC00F1F7B4 /* HeapVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE7BA60E1A1A7CEC00F1F7B4 /* HeapVerifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE7C41961B97FC4B00F4D598 /* PingPongStackOverflowTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDA50D41B97F442009A3B4F /* PingPongStackOverflowTest.cpp */; };
</span><ins>+                FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */ = {isa = PBXBuildFile; fileRef = FE80C1961D775B27008510C0 /* CatchScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FE80C1991D775FBE008510C0 /* CatchScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE80C1981D775FB4008510C0 /* CatchScope.cpp */; };
+                FE80C19B1D776A98008510C0 /* ExceptionEventLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE80C19A1D7768FD008510C0 /* ExceptionEventLocation.cpp */; };
</ins><span class="cx">                 FE99B2491C24C3D300C82159 /* JITNegGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99B2481C24B6D300C82159 /* JITNegGenerator.h */; };
</span><span class="cx">                 FE99B24A1C24C3D700C82159 /* JITNegGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */; };
</span><span class="cx">                 FEA08620182B7A0400F6D851 /* Breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA0861E182B7A0400F6D851 /* Breakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -4475,11 +4480,16 @@
</span><span class="cx">                 FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeferredSourceDump.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE5932A5183C5A2600A1ECCC /* VMEntryScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMEntryScope.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE5932A6183C5A2600A1ECCC /* VMEntryScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMEntryScope.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                FE6029D81D6E1E330030204D /* ThrowScopeLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThrowScopeLocation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                FE6029D81D6E1E330030204D /* ExceptionEventLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionEventLocation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE6491361D78F01300A694D4 /* ExceptionScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionScope.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE6491381D78F3A300A694D4 /* ExceptionScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionScope.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE68C6351B90DDD90042BCB3 /* MacroAssemblerPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerPrinter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE68C6361B90DDD90042BCB3 /* MacroAssemblerPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerPrinter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE7BA60D1A1A7CEC00F1F7B4 /* HeapVerifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapVerifier.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE7BA60E1A1A7CEC00F1F7B4 /* HeapVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapVerifier.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE80C1961D775B27008510C0 /* CatchScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CatchScope.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE80C1981D775FB4008510C0 /* CatchScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CatchScope.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE80C19A1D7768FD008510C0 /* ExceptionEventLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionEventLocation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE90BB3A1B7CF64E006B3F03 /* VMInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE98B5B61BB9AE110073E7A6 /* JITSubGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITSubGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE99B2471C24B6D300C82159 /* JITNegGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITNegGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5737,6 +5747,8 @@
</span><span class="cx">                                 0FB7F38C15ED8E3800F167B2 /* ButterflyInlines.h */,
</span><span class="cx">                                 BCA62DFE0E2826230004F30D /* CallData.cpp */,
</span><span class="cx">                                 145C507F0D9DF63B0088F6B9 /* CallData.h */,
</span><ins>+                                FE80C1981D775FB4008510C0 /* CatchScope.cpp */,
+                                FE80C1961D775B27008510C0 /* CatchScope.h */,
</ins><span class="cx">                                 BC6AAAE40E1F426500AD87D8 /* ClassInfo.h */,
</span><span class="cx">                                 0FE0501C1AA9095600D33B33 /* ClonedArguments.cpp */,
</span><span class="cx">                                 0FE0501D1AA9095600D33B33 /* ClonedArguments.h */,
</span><span class="lines">@@ -5801,10 +5813,14 @@
</span><span class="cx">                                 BC02E9070E1839DB000F9297 /* ErrorPrototype.h */,
</span><span class="cx">                                 FE1C0FFE1B194FD100B53FCA /* Exception.cpp */,
</span><span class="cx">                                 FE1C0FFC1B193E9800B53FCA /* Exception.h */,
</span><ins>+                                FE80C19A1D7768FD008510C0 /* ExceptionEventLocation.cpp */,
+                                FE6029D81D6E1E330030204D /* ExceptionEventLocation.h */,
</ins><span class="cx">                                 0F12DE0D1979D5FD0006FF4E /* ExceptionFuzz.cpp */,
</span><span class="cx">                                 0F12DE0E1979D5FD0006FF4E /* ExceptionFuzz.h */,
</span><span class="cx">                                 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */,
</span><span class="cx">                                 A72701B30DADE94900E548D7 /* ExceptionHelpers.h */,
</span><ins>+                                FE6491381D78F3A300A694D4 /* ExceptionScope.cpp */,
+                                FE6491361D78F01300A694D4 /* ExceptionScope.h */,
</ins><span class="cx">                                 86CA032D1038E8440028A609 /* Executable.cpp */,
</span><span class="cx">                                 86CAFEE21035DDE60028A609 /* Executable.h */,
</span><span class="cx">                                 A7A8AF2917ADB5F3005AB174 /* Float32Array.h */,
</span><span class="lines">@@ -6204,7 +6220,6 @@
</span><span class="cx">                                 0FA2C17A17D7CF84009D015F /* TestRunnerUtils.h */,
</span><span class="cx">                                 FE2E6A7A1D6EA5FE0060F896 /* ThrowScope.cpp */,
</span><span class="cx">                                 FE3422111D6B818C0032BE88 /* ThrowScope.h */,
</span><del>-                                FE6029D81D6E1E330030204D /* ThrowScopeLocation.h */,
</del><span class="cx">                                 0F55989717C86C5600A1E543 /* ToNativeFromValue.h */,
</span><span class="cx">                                 0F2B66D817B6B5AB00A7AE3F /* TypedArrayAdaptors.h */,
</span><span class="cx">                                 0F2B66D917B6B5AB00A7AE3F /* TypedArrayController.cpp */,
</span><span class="lines">@@ -7759,7 +7774,7 @@
</span><span class="cx">                                 FE3A06C01C11041A00390FDD /* JITRightShiftGenerator.h in Headers */,
</span><span class="cx">                                 708EBE241CE8F35800453146 /* IntlObjectInlines.h in Headers */,
</span><span class="cx">                                 0F070A481D543A90006E7232 /* CellContainerInlines.h in Headers */,
</span><del>-                                FE6029D91D6E1E4F0030204D /* ThrowScopeLocation.h in Headers */,
</del><ins>+                                FE6029D91D6E1E4F0030204D /* ExceptionEventLocation.h in Headers */,
</ins><span class="cx">                                 0FE0501B1AA9091100D33B33 /* GenericOffset.h in Headers */,
</span><span class="cx">                                 0F2B66E017B6B5AB00A7AE3F /* GenericTypedArrayView.h in Headers */,
</span><span class="cx">                                 0F2B66E117B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h in Headers */,
</span><span class="lines">@@ -8280,6 +8295,7 @@
</span><span class="cx">                                 145722861437E140005FDE26 /* StrongInlines.h in Headers */,
</span><span class="cx">                                 BCDE3AB80E6C82F5001453A7 /* Structure.h in Headers */,
</span><span class="cx">                                 7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */,
</span><ins>+                                FE6491371D78F01D00A694D4 /* ExceptionScope.h in Headers */,
</ins><span class="cx">                                 2AAAA31218BD49D100394CC8 /* StructureIDBlob.h in Headers */,
</span><span class="cx">                                 436E54531C468E7400B5AF73 /* B3LegalizeMemoryOffsets.h in Headers */,
</span><span class="cx">                                 2AF7382D18BBBF92008A5A37 /* StructureIDTable.h in Headers */,
</span><span class="lines">@@ -8373,6 +8389,7 @@
</span><span class="cx">                                 709FB86C1AE335C60039D069 /* WeakSetPrototype.h in Headers */,
</span><span class="cx">                                 BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */,
</span><span class="cx">                                 A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */,
</span><ins>+                                FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */,
</ins><span class="cx">                                 2A4EC90C1860D6C20094F782 /* WriteBarrierBuffer.h in Headers */,
</span><span class="cx">                                 C2B6D75318A33793004A9301 /* WriteBarrierInlines.h in Headers */,
</span><span class="cx">                                 0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */,
</span><span class="lines">@@ -8905,6 +8922,7 @@
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><span class="cx">                                 0FFA549716B8835000B3A982 /* A64DOpcode.cpp in Sources */,
</span><ins>+                                FE6491391D78F3AF00A694D4 /* ExceptionScope.cpp in Sources */,
</ins><span class="cx">                                 0F55F0F414D1063900AC7649 /* AbstractPC.cpp in Sources */,
</span><span class="cx">                                 0FEC856D1BDACDC70080FF74 /* AirAllocateStack.cpp in Sources */,
</span><span class="cx">                                 43422A661C16267500E2EB98 /* B3ReduceDoubleToFloat.cpp in Sources */,
</span><span class="lines">@@ -9387,6 +9405,7 @@
</span><span class="cx">                                 0F2B66E617B6B5AB00A7AE3F /* JSArrayBufferPrototype.cpp in Sources */,
</span><span class="cx">                                 0F2B66E817B6B5AB00A7AE3F /* JSArrayBufferView.cpp in Sources */,
</span><span class="cx">                                 A5311C371C77CECA00E6B1B6 /* HeapSnapshotBuilder.cpp in Sources */,
</span><ins>+                                FE80C1991D775FBE008510C0 /* CatchScope.cpp in Sources */,
</ins><span class="cx">                                 1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */,
</span><span class="cx">                                 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
</span><span class="cx">                                 1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */,
</span><span class="lines">@@ -9499,6 +9518,7 @@
</span><span class="cx">                                 0F4680A414BA7F8D00BFE272 /* LLIntSlowPaths.cpp in Sources */,
</span><span class="cx">                                 0F0B839C14BCF46300885B4F /* LLIntThunks.cpp in Sources */,
</span><span class="cx">                                 14469DDE107EC7E700650446 /* Lookup.cpp in Sources */,
</span><ins>+                                FE80C19B1D776A98008510C0 /* ExceptionEventLocation.cpp in Sources */,
</ins><span class="cx">                                 0F4680CC14BBB17A00BFE272 /* LowLevelInterpreter.cpp in Sources */,
</span><span class="cx">                                 A5AB49DC1BEC8082007020FB /* PerGlobalObjectWrapperWorld.cpp in Sources */,
</span><span class="cx">                                 14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebindingsScriptFunctionCallcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/bindings/ScriptFunctionCall.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -105,10 +105,12 @@
</span><span class="cx"> {
</span><span class="cx">     JSObject* thisObject = m_thisObject.jsObject();
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(m_exec);
</del><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue function = thisObject-&gt;get(m_exec, Identifier::fromString(m_exec, m_name));
</span><del>-    if (m_exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         hadException = true;
</span><span class="cx">         return { };
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebindingsScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/bindings/ScriptValue.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -121,10 +121,13 @@
</span><span class="cx"> 
</span><span class="cx"> String ScriptValue::toString(ExecState* scriptState) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = scriptState-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     String result = m_value.get().toString(scriptState)-&gt;value(scriptState);
</span><span class="cx">     // Handle the case where an exception is thrown as part of invoking toString on the object.
</span><del>-    if (scriptState-&gt;hadException())
-        scriptState-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception()))
+        scope.clearException();
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -623,6 +623,9 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::pauseIfNeeded(CallFrame* callFrame)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = callFrame-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (m_isPaused)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -662,7 +665,7 @@
</span><span class="cx">     {
</span><span class="cx">         PauseReasonDeclaration reason(*this, didHitBreakpoint ? PausedForBreakpoint : m_reasonForPause);
</span><span class="cx">         handlePause(vmEntryGlobalObject, m_reasonForPause);
</span><del>-        RELEASE_ASSERT(!callFrame-&gt;hadException());
</del><ins>+        RELEASE_ASSERT(!scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_pausingBreakpointID = noBreakpointID;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -217,7 +217,9 @@
</span><span class="cx">     if (!callFrame)
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(callFrame);
</del><ins>+    VM&amp; vm = callFrame-&gt;vm();
+    JSLockHolder lock(vm);
+    auto catchScope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     CodeBlock* codeBlock = nullptr;
</span><span class="cx">     if (isTailDeleted())
</span><span class="lines">@@ -228,7 +230,6 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     
</span><span class="cx">     DebuggerEvalEnabler evalEnabler(callFrame);
</span><del>-    VM&amp; vm = callFrame-&gt;vm();
</del><span class="cx"> 
</span><span class="cx">     EvalContextType evalContextType;
</span><span class="cx">     
</span><span class="lines">@@ -243,9 +244,9 @@
</span><span class="cx">     JSScope::collectVariablesUnderTDZ(scope()-&gt;jsScope(), variablesUnderTDZ);
</span><span class="cx"> 
</span><span class="cx">     EvalExecutable* eval = EvalExecutable::create(callFrame, makeSource(script), codeBlock-&gt;isStrictMode(), codeBlock-&gt;unlinkedCodeBlock()-&gt;derivedContextType(), codeBlock-&gt;unlinkedCodeBlock()-&gt;isArrowFunction(), evalContextType, &amp;variablesUnderTDZ);
</span><del>-    if (vm.exception()) {
-        exception = vm.exception();
-        vm.clearException();
</del><ins>+    if (UNLIKELY(catchScope.exception())) {
+        exception = catchScope.exception();
+        catchScope.clearException();
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -257,9 +258,9 @@
</span><span class="cx"> 
</span><span class="cx">     JSValue thisValue = this-&gt;thisValue();
</span><span class="cx">     JSValue result = vm.interpreter-&gt;execute(eval, callFrame, thisValue, scope()-&gt;jsScope());
</span><del>-    if (vm.exception()) {
-        exception = vm.exception();
-        vm.clearException();
</del><ins>+    if (UNLIKELY(catchScope.exception())) {
+        exception = catchScope.exception();
+        catchScope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (scopeExtensionObject)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSRExitCompilercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -112,14 +112,15 @@
</span><span class="cx"> 
</span><span class="cx"> void compileOSRExit(ExecState* exec)
</span><span class="cx"> {
</span><del>-    if (exec-&gt;vm().callFrameForCatch)
-        RELEASE_ASSERT(exec-&gt;vm().callFrameForCatch == exec);
</del><ins>+    VM* vm = &amp;exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(*vm);
+
+    if (vm-&gt;callFrameForCatch)
+        RELEASE_ASSERT(vm-&gt;callFrameForCatch == exec);
</ins><span class="cx">     
</span><span class="cx">     CodeBlock* codeBlock = exec-&gt;codeBlock();
</span><span class="cx">     ASSERT(codeBlock);
</span><span class="cx">     ASSERT(codeBlock-&gt;jitType() == JITCode::DFGJIT);
</span><del>-
-    VM* vm = &amp;exec-&gt;vm();
</del><span class="cx">     
</span><span class="cx">     // It's sort of preferable that we don't GC while in here. Anyways, doing so wouldn't
</span><span class="cx">     // really be profitable.
</span><span class="lines">@@ -131,7 +132,7 @@
</span><span class="cx">     if (vm-&gt;callFrameForCatch)
</span><span class="cx">         ASSERT(exit.m_kind == GenericUnwind);
</span><span class="cx">     if (exit.isExceptionHandler())
</span><del>-        ASSERT(!!vm-&gt;exception());
</del><ins>+        ASSERT_UNUSED(scope, !!scope.exception());
</ins><span class="cx">         
</span><span class="cx">     
</span><span class="cx">     prepareCodeOriginForOSRExit(exec, exit.m_codeOrigin);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> ALWAYS_INLINE static void JIT_OPERATION operationPutByValInternal(ExecState* exec, EncodedJSValue encodedBase, EncodedJSValue encodedProperty, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><span class="cx"> 
</span><span class="cx">     JSValue baseValue = JSValue::decode(encodedBase);
</span><span class="lines">@@ -121,7 +122,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Don't put to an object if toString throws an exception.
</span><span class="cx">     auto propertyName = property.toPropertyKey(exec);
</span><del>-    if (vm-&gt;exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     PutPropertySlot slot(baseValue, strict);
</span><span class="lines">@@ -181,11 +182,12 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (constructor-&gt;type() == JSFunctionType)
</span><span class="cx">         return constructEmptyObject(exec, jsCast&lt;JSFunction*&gt;(constructor)-&gt;rareData(exec, inlineCapacity)-&gt;objectAllocationProfile()-&gt;structure());
</span><span class="cx"> 
</span><span class="cx">     JSValue proto = constructor-&gt;get(exec, exec-&gt;propertyNames().prototype);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (proto.isObject())
</span><span class="cx">         return constructEmptyObject(exec, asObject(proto));
</span><span class="lines">@@ -209,12 +211,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     int32_t a = op1.toInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     int32_t b = op2.toInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a &amp; b));
</span><span class="lines">@@ -224,12 +227,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     int32_t a = op1.toInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     int32_t b = op2.toInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a | b));
</span><span class="lines">@@ -239,12 +243,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     int32_t a = op1.toInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     int32_t b = op2.toInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a ^ b));
</span><span class="lines">@@ -254,12 +259,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     int32_t a = op1.toInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     uint32_t b = op2.toUInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a &lt;&lt; (b &amp; 0x1f)));
</span><span class="lines">@@ -269,12 +275,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     int32_t a = op1.toInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     uint32_t b = op2.toUInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a &gt;&gt; (b &amp; 0x1f)));
</span><span class="lines">@@ -284,12 +291,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     uint32_t a = op1.toUInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     uint32_t b = op2.toUInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(static_cast&lt;int32_t&gt;(a &gt;&gt; (b &amp; 0x1f))));
</span><span class="lines">@@ -315,12 +323,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     double b = op2.toNumber(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a / b));
</span><span class="lines">@@ -330,10 +339,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return fabs(a);
</span><span class="cx"> }
</span><span class="lines">@@ -342,10 +352,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     uint32_t value = op1.toUInt32(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     return clz32(value);
</span><span class="cx"> }
</span><span class="lines">@@ -354,10 +365,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return cos(a);
</span><span class="cx"> }
</span><span class="lines">@@ -366,10 +378,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return static_cast&lt;float&gt;(a);
</span><span class="cx"> }
</span><span class="lines">@@ -378,10 +391,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return log(a);
</span><span class="cx"> }
</span><span class="lines">@@ -390,10 +404,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return sin(a);
</span><span class="cx"> }
</span><span class="lines">@@ -402,10 +417,11 @@
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm-&gt;exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return sqrt(a);
</span><span class="cx"> }
</span><span class="lines">@@ -431,7 +447,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue baseValue = JSValue::decode(encodedBase);
</span><span class="cx">     JSValue property = JSValue::decode(encodedProperty);
</span><span class="cx"> 
</span><span class="lines">@@ -457,10 +474,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     baseValue.requireObjectCoercible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto propertyName = property.toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(baseValue.get(exec, propertyName));
</span><span class="cx"> }
</span><span class="lines">@@ -469,7 +486,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue property = JSValue::decode(encodedProperty);
</span><span class="cx"> 
</span><span class="cx">     if (property.isUInt32())
</span><span class="lines">@@ -490,7 +508,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = property.toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(JSValue(base).get(exec, propertyName));
</span><span class="cx"> }
</span><span class="lines">@@ -859,6 +877,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue baseValue = JSValue::decode(encodedBase);
</span><span class="cx">     JSValue thisVal = JSValue::decode(encodedThis);
</span><span class="lines">@@ -884,11 +903,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     baseValue.requireObjectCoercible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     auto property = subscript.toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(baseValue.get(exec, property, slot));
</span><span class="cx"> }
</span><span class="lines">@@ -913,9 +932,10 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     Identifier property = JSValue::decode(encodedSubscript).toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     putWithThis&lt;true&gt;(exec, encodedBase, encodedThis, encodedValue, property);
</span><span class="cx"> }
</span><span class="lines">@@ -924,9 +944,10 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     Identifier property = JSValue::decode(encodedSubscript).toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     putWithThis&lt;false&gt;(exec, encodedBase, encodedThis, encodedValue, property);
</span><span class="cx"> }
</span><span class="lines">@@ -1441,9 +1462,9 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSString* str1 = JSValue::decode(a).toString(exec);
</span><del>-    ASSERT(!vm.exception()); // Impossible, since we must have been given primitives.
</del><ins>+    ASSERT(!scope.exception()); // Impossible, since we must have been given primitives.
</ins><span class="cx">     JSString* str2 = JSValue::decode(b).toString(exec);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     if (sumOverflows&lt;int32_t&gt;(str1-&gt;length(), str2-&gt;length())) {
</span><span class="cx">         throwOutOfMemoryError(exec, scope);
</span><span class="lines">@@ -1460,11 +1481,11 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSString* str1 = JSValue::decode(a).toString(exec);
</span><del>-    ASSERT(!vm.exception()); // Impossible, since we must have been given primitives.
</del><ins>+    ASSERT(!scope.exception()); // Impossible, since we must have been given primitives.
</ins><span class="cx">     JSString* str2 = JSValue::decode(b).toString(exec);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSString* str3 = JSValue::decode(c).toString(exec);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     if (sumOverflows&lt;int32_t&gt;(str1-&gt;length(), str2-&gt;length(), str3-&gt;length())) {
</span><span class="cx">         throwOutOfMemoryError(exec, scope);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptManager.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -134,7 +134,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSC::JSObject* InjectedScriptManager::createInjectedScript(const String&amp; source, ExecState* scriptState, int id)
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(scriptState);
</del><ins>+    VM&amp; vm = scriptState-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     SourceCode sourceCode = makeSource(source);
</span><span class="cx">     JSGlobalObject* globalObject = scriptState-&gt;lexicalGlobalObject();
</span><span class="lines">@@ -157,7 +159,7 @@
</span><span class="cx">     args.append(jsNumber(id));
</span><span class="cx"> 
</span><span class="cx">     JSValue result = JSC::call(scriptState, functionValue, callType, callData, globalThisValue, args);
</span><del>-    scriptState-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return result.getObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -221,7 +221,9 @@
</span><span class="cx">     if (isTerminatedExecutionException(exception))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ErrorHandlingScope errorScope(exec-&gt;vm());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ErrorHandlingScope errorScope(vm);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ScriptCallStack&gt; callStack = createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture);
</span><span class="cx">     if (includesNativeCallStackWhenReportingExceptions())
</span><span class="lines">@@ -230,7 +232,7 @@
</span><span class="cx">     // FIXME: &lt;http://webkit.org/b/115087&gt; Web Inspector: Should not evaluate JavaScript handling exceptions
</span><span class="cx">     // If this is a custom exception object, call toString on it to try and get a nice string representation for the exception.
</span><span class="cx">     String errorMessage = exception-&gt;value().toString(exec)-&gt;value(exec);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     if (JSGlobalObjectConsoleClient::logToSystemConsole()) {
</span><span class="cx">         if (callStack-&gt;size()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">         return throwTypeError(exec, scope, ASCIILiteral(&quot;InjectedScriptHost.evaluateWithScopeExtension first argument must be a string.&quot;));
</span><span class="cx"> 
</span><span class="cx">     String program = scriptValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span><span class="lines">@@ -259,12 +259,13 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue value = exec-&gt;uncheckedArgument(0);
</span><span class="cx"> 
</span><span class="cx">     if (JSPromise* promise = jsDynamicCast&lt;JSPromise*&gt;(value)) {
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         switch (promise-&gt;status(exec-&gt;vm())) {
</span><span class="cx">         case JSPromise::Status::Pending:
</span><span class="lines">@@ -286,7 +287,7 @@
</span><span class="cx">     if (JSBoundFunction* boundFunction = jsDynamicCast&lt;JSBoundFunction*&gt;(value)) {
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;targetFunction&quot;, boundFunction-&gt;targetFunction()));
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;boundThis&quot;, boundFunction-&gt;boundThis()));
</span><span class="lines">@@ -298,7 +299,7 @@
</span><span class="cx">     if (ProxyObject* proxy = jsDynamicCast&lt;ProxyObject*&gt;(value)) {
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral(&quot;target&quot;), proxy-&gt;target()));
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral(&quot;handler&quot;), proxy-&gt;handler()));
</span><span class="lines">@@ -312,7 +313,7 @@
</span><span class="cx"> 
</span><span class="cx">             unsigned index = 0;
</span><span class="cx">             JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx">             array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;array&quot;, iteratedValue));
</span><span class="cx">             array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;kind&quot;, kind));
</span><span class="lines">@@ -335,7 +336,7 @@
</span><span class="cx">         }
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;map&quot;, mapIterator-&gt;iteratedValue()));
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;kind&quot;, jsNontrivialString(exec, kind)));
</span><span class="lines">@@ -357,7 +358,7 @@
</span><span class="cx">         }
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;set&quot;, setIterator-&gt;iteratedValue()));
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;kind&quot;, jsNontrivialString(exec, kind)));
</span><span class="lines">@@ -367,7 +368,7 @@
</span><span class="cx">     if (JSStringIterator* stringIterator = jsDynamicCast&lt;JSStringIterator*&gt;(value)) {
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 1);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;string&quot;, stringIterator-&gt;iteratedValue(exec)));
</span><span class="cx">         return array;
</span><span class="lines">@@ -376,7 +377,7 @@
</span><span class="cx">     if (JSPropertyNameIterator* propertyNameIterator = jsDynamicCast&lt;JSPropertyNameIterator*&gt;(value)) {
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 1);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;object&quot;, propertyNameIterator-&gt;iteratedValue()));
</span><span class="cx">         return array;
</span><span class="lines">@@ -404,6 +405,7 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue value = exec-&gt;uncheckedArgument(0);
</span><span class="cx">     JSWeakMap* weakMap = jsDynamicCast&lt;JSWeakMap*&gt;(value);
</span><span class="cx">     if (!weakMap)
</span><span class="lines">@@ -418,7 +420,7 @@
</span><span class="cx">         numberToFetch = static_cast&lt;unsigned&gt;(fetchDouble);
</span><span class="cx"> 
</span><span class="cx">     JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (auto it = weakMap-&gt;weakMapData()-&gt;begin(); it != weakMap-&gt;weakMapData()-&gt;end(); ++it) {
</span><span class="cx">         JSObject* entry = constructEmptyObject(exec);
</span><span class="lines">@@ -451,6 +453,7 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue value = exec-&gt;uncheckedArgument(0);
</span><span class="cx">     JSWeakSet* weakSet = jsDynamicCast&lt;JSWeakSet*&gt;(value);
</span><span class="cx">     if (!weakSet)
</span><span class="lines">@@ -465,7 +468,7 @@
</span><span class="cx">         numberToFetch = static_cast&lt;unsigned&gt;(fetchDouble);
</span><span class="cx"> 
</span><span class="cx">     JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (auto it = weakSet-&gt;weakMapData()-&gt;begin(); it != weakSet-&gt;weakMapData()-&gt;end(); ++it) {
</span><span class="cx">         JSObject* entry = constructEmptyObject(exec);
</span><span class="lines">@@ -495,6 +498,7 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue iterator;
</span><span class="cx">     JSValue value = exec-&gt;uncheckedArgument(0);
</span><span class="cx">     if (JSMapIterator* mapIterator = jsDynamicCast&lt;JSMapIterator*&gt;(value))
</span><span class="lines">@@ -505,7 +509,7 @@
</span><span class="cx">         iterator = stringIterator-&gt;clone(exec);
</span><span class="cx">     else if (JSPropertyNameIterator* propertyNameIterator = jsDynamicCast&lt;JSPropertyNameIterator*&gt;(value)) {
</span><span class="cx">         iterator = propertyNameIterator-&gt;clone(exec);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue();
</span><span class="cx">     } else {
</span><span class="cx">         if (JSObject* iteratorObject = jsDynamicCast&lt;JSObject*&gt;(value)) {
</span><span class="lines">@@ -525,18 +529,18 @@
</span><span class="cx">         numberToFetch = static_cast&lt;unsigned&gt;(fetchDouble);
</span><span class="cx"> 
</span><span class="cx">     JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; numberToFetch; ++i) {
</span><span class="cx">         JSValue next = iteratorStep(exec, iterator);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             break;
</span><span class="cx">         if (next.isFalse())
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         JSValue nextValue = iteratorValue(exec, next);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         JSObject* entry = constructEmptyObject(exec);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">         return throwTypeError(exec, scope, ASCIILiteral(&quot;JSJavaScriptCallFrame.evaluateWithScopeExtension first argument must be a string.&quot;));
</span><span class="cx"> 
</span><span class="cx">     String script = scriptValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptCallStackFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -119,6 +119,9 @@
</span><span class="cx"> 
</span><span class="cx"> static void extractSourceInformationFromException(JSC::ExecState* exec, JSObject* exceptionObject, int* lineNumber, int* columnNumber, String* sourceURL)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     // FIXME: &lt;http://webkit.org/b/115087&gt; Web Inspector: Should not need to evaluate JavaScript handling exceptions
</span><span class="cx">     JSValue lineValue = exceptionObject-&gt;getDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;line&quot;));
</span><span class="cx">     *lineNumber = lineValue &amp;&amp; lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
</span><span class="lines">@@ -126,7 +129,7 @@
</span><span class="cx">     *columnNumber = columnValue &amp;&amp; columnValue.isNumber() ? int(columnValue.toNumber(exec)) : 0;
</span><span class="cx">     JSValue sourceURLValue = exceptionObject-&gt;getDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;sourceURL&quot;));
</span><span class="cx">     *sourceURL = sourceURLValue &amp;&amp; sourceURLValue.isString() ? sourceURLValue.toString(exec)-&gt;value(exec) : ASCIILiteral(&quot;undefined&quot;);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;ScriptCallStack&gt; createScriptCallStackFromException(JSC::ExecState* exec, JSC::Exception* exception, size_t maxStackSize)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCachedCallh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CachedCall.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CachedCall.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/interpreter/CachedCall.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                 m_closure = m_interpreter-&gt;prepareForRepeatCall(function-&gt;jsExecutable(), callFrame, &amp;m_protoCallFrame, function, argumentCount + 1, function-&gt;scope(), m_arguments.data());
</span><span class="cx">             } else
</span><span class="cx">                 throwStackOverflowError(callFrame, scope);
</span><del>-            m_valid = !callFrame-&gt;hadException();
</del><ins>+            m_valid = !scope.exception();
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         JSValue call()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -116,14 +116,6 @@
</span><span class="cx">         // pointer, so these are inefficient, and should be used sparingly in new code.
</span><span class="cx">         // But they're used in many places in legacy code, so they're not going away any time soon.
</span><span class="cx"> 
</span><del>-        void clearException() { vm().clearException(); }
-
-        Exception* exception() const { return vm().exception(); }
-        bool hadException() const { return !!vm().exception(); }
-
-        Exception* lastException() const { return vm().lastException(); }
-        void clearLastException() { vm().clearLastException(); }
-
</del><span class="cx">         AtomicStringTable* atomicStringTable() const { return vm().atomicStringTable(); }
</span><span class="cx">         const CommonIdentifiers&amp; propertyNames() const { return *vm().propertyNames; }
</span><span class="cx">         const MarkedArgumentBuffer&amp; emptyList() const { return *vm().emptyList; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     String programSource = asString(program)-&gt;value(callFrame);
</span><del>-    if (callFrame-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx">     
</span><span class="cx">     CallFrame* callerFrame = callFrame-&gt;callerFrame();
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // If the literal parser bailed, it should not have thrown exceptions.
</span><del>-        ASSERT(!vm.exception());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">         eval = callerCodeBlock-&gt;evalCodeCache().getSlow(callFrame, callerCodeBlock, callerCodeBlock-&gt;isStrictMode(), derivedContextType, evalContextType, isArrowFunctionContext, programSource, callerScopeChain);
</span><span class="cx"> 
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">     default:
</span><span class="cx">         RELEASE_ASSERT(arguments.isObject());
</span><span class="cx">         length = getLength(callFrame, jsCast&lt;JSObject*&gt;(cell));
</span><del>-        if (UNLIKELY(callFrame-&gt;hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return 0;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -586,13 +586,15 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE static void notifyDebuggerOfUnwinding(CallFrame* callFrame)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = callFrame-&gt;vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (Debugger* debugger = callFrame-&gt;vmEntryGlobalObject()-&gt;debugger()) {
</span><del>-        SuspendExceptionScope scope(&amp;callFrame-&gt;vm());
</del><ins>+        SuspendExceptionScope scope(&amp;vm);
</ins><span class="cx">         if (jsDynamicCast&lt;JSFunction*&gt;(callFrame-&gt;callee()))
</span><span class="cx">             debugger-&gt;returnEvent(callFrame);
</span><span class="cx">         else
</span><span class="cx">             debugger-&gt;didExecuteProgram(callFrame);
</span><del>-        ASSERT(!callFrame-&gt;hadException());
</del><ins>+        ASSERT_UNUSED(throwScope, !throwScope.exception());
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -680,6 +682,8 @@
</span><span class="cx"> 
</span><span class="cx"> NEVER_INLINE HandlerInfo* Interpreter::unwind(VM&amp; vm, CallFrame*&amp; callFrame, Exception* exception, UnwindStart unwindStart)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (unwindStart == UnwindFromCallerFrame) {
</span><span class="cx">         if (callFrame-&gt;callerFrameOrVMEntryFrame() == vm.topVMEntryFrame)
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -698,7 +702,7 @@
</span><span class="cx">     if (exceptionValue.isEmpty() || (exceptionValue.isCell() &amp;&amp; !exceptionValue.asCell()))
</span><span class="cx">         exceptionValue = jsNull();
</span><span class="cx"> 
</span><del>-    ASSERT(vm.exception() &amp;&amp; vm.exception()-&gt;stack().size());
</del><ins>+    ASSERT_UNUSED(scope, scope.exception() &amp;&amp; scope.exception()-&gt;stack().size());
</ins><span class="cx"> 
</span><span class="cx">     // Calculate an exception handler vPC, unwinding call frames as necessary.
</span><span class="cx">     HandlerInfo* handler = nullptr;
</span><span class="lines">@@ -897,7 +901,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Execute the code:
</span><span class="cx">     JSValue result = program-&gt;generatedJITCode()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><del>-
</del><ins>+    throwScope.release();
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -906,7 +910,7 @@
</span><span class="cx">     VM&amp; vm = callFrame-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    ASSERT(!callFrame-&gt;hadException());
</del><ins>+    ASSERT(!throwScope.exception());
</ins><span class="cx">     ASSERT(!vm.isCollectorBusy());
</span><span class="cx">     if (vm.isCollectorBusy())
</span><span class="cx">         return jsNull();
</span><span class="lines">@@ -969,7 +973,7 @@
</span><span class="cx">     VM&amp; vm = callFrame-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    ASSERT(!callFrame-&gt;hadException());
</del><ins>+    ASSERT(!throwScope.exception());
</ins><span class="cx">     ASSERT(!vm.isCollectorBusy());
</span><span class="cx">     // We throw in this case because we have to return something &quot;valid&quot; but we're
</span><span class="cx">     // already in an invalid state.
</span><span class="lines">@@ -1020,12 +1024,12 @@
</span><span class="cx">         else {
</span><span class="cx">             result = JSValue::decode(vmEntryToNative(reinterpret_cast&lt;void*&gt;(constructData.native.function), &amp;vm, &amp;protoCallFrame));
</span><span class="cx"> 
</span><del>-            if (!callFrame-&gt;hadException())
</del><ins>+            if (LIKELY(!throwScope.exception()))
</ins><span class="cx">                 RELEASE_ASSERT(result.isObject());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (callFrame-&gt;hadException())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     ASSERT(result.isObject());
</span><span class="cx">     return checkedReturn(asObject(result));
</span><span class="lines">@@ -1035,7 +1039,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = *scope-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!throwScope.exception());
</ins><span class="cx">     
</span><span class="cx">     if (vm.isCollectorBusy())
</span><span class="cx">         return CallFrameClosure();
</span><span class="lines">@@ -1084,7 +1088,7 @@
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(scope-&gt;vm() == &amp;callFrame-&gt;vm());
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!throwScope.exception());
</ins><span class="cx">     ASSERT(!vm.isCollectorBusy());
</span><span class="cx">     RELEASE_ASSERT(vm.currentThreadIsHoldingAPILock());
</span><span class="cx">     if (vm.isCollectorBusy())
</span><span class="lines">@@ -1190,7 +1194,7 @@
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     ASSERT(scope-&gt;vm() == &amp;callFrame-&gt;vm());
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!throwScope.exception());
</ins><span class="cx">     ASSERT(!vm.isCollectorBusy());
</span><span class="cx">     RELEASE_ASSERT(vm.currentThreadIsHoldingAPILock());
</span><span class="cx">     if (vm.isCollectorBusy())
</span><span class="lines">@@ -1231,12 +1235,14 @@
</span><span class="cx"> 
</span><span class="cx"> NEVER_INLINE void Interpreter::debug(CallFrame* callFrame, DebugHookID debugHookID)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = callFrame-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     Debugger* debugger = callFrame-&gt;vmEntryGlobalObject()-&gt;debugger();
</span><span class="cx">     if (!debugger)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(callFrame-&gt;codeBlock()-&gt;hasDebuggerRequests());
</span><del>-    ASSERT(!callFrame-&gt;hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     switch (debugHookID) {
</span><span class="cx">         case DidEnterCallFrame:
</span><span class="lines">@@ -1258,7 +1264,7 @@
</span><span class="cx">             debugger-&gt;didReachBreakpoint(callFrame);
</span><span class="cx">             break;
</span><span class="cx">     }
</span><del>-    ASSERT(!callFrame-&gt;hadException());
-}    
</del><ins>+    ASSERT(!scope.exception());
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #define Interpreter_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ArgList.h&quot;
</span><ins>+#include &quot;CatchScope.h&quot;
</ins><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx"> #include &quot;SourceProvider.h&quot;
</span><span class="cx"> #include &quot;StackAlignment.h&quot;
</span><span class="cx"> #include &quot;StackFrame.h&quot;
</span><ins>+#include &quot;ThrowScope.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -92,8 +94,9 @@
</span><span class="cx">         SuspendExceptionScope(VM* vm)
</span><span class="cx">             : m_vm(vm)
</span><span class="cx">         {
</span><del>-            oldException = vm-&gt;exception();
-            vm-&gt;clearException();
</del><ins>+            auto scope = DECLARE_CATCH_SCOPE(*vm);
+            oldException = scope.exception();
+            scope.clearException();
</ins><span class="cx">         }
</span><span class="cx">         ~SuspendExceptionScope()
</span><span class="cx">         {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterShadowChickencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -436,8 +436,9 @@
</span><span class="cx"> JSArray* ShadowChicken::functionsOnStack(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     iterate(
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITCodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITCode.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITCode.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/jit/JITCode.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JITCode::execute(VM* vm, ProtoCallFrame* protoCallFrame)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx">     void* entryAddress;
</span><span class="cx">     JSFunction* function = jsDynamicCast&lt;JSFunction*&gt;(protoCallFrame-&gt;callee());
</span><span class="cx"> 
</span><span class="lines">@@ -78,7 +79,7 @@
</span><span class="cx">     } else
</span><span class="cx">         entryAddress = addressForCall(MustCheckArity).executableAddress();
</span><span class="cx">     JSValue result = JSValue::decode(vmEntryToJavaScript(entryAddress, vm, protoCallFrame));
</span><del>-    return vm-&gt;exception() ? jsNull() : result;
</del><ins>+    return scope.exception() ? jsNull() : result;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> DFG::CommonData* JITCode::dfgCommon()
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITExceptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITExceptions.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITExceptions.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/jit/JITExceptions.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> 
</span><span class="cx"> void genericUnwind(VM* vm, ExecState* callFrame, UnwindStart unwindStart)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx">     if (Options::breakOnThrow()) {
</span><span class="cx">         CodeBlock* codeBlock = callFrame-&gt;codeBlock();
</span><span class="cx">         if (codeBlock)
</span><span class="lines">@@ -58,7 +59,7 @@
</span><span class="cx">     }
</span><span class="cx">     vm-&gt;shadowChicken().log(*vm, shadowChickenTopFrame, ShadowChicken::Packet::throwPacket());
</span><span class="cx">     
</span><del>-    Exception* exception = vm-&gt;exception();
</del><ins>+    Exception* exception = scope.exception();
</ins><span class="cx">     RELEASE_ASSERT(exception);
</span><span class="cx">     HandlerInfo* handler = vm-&gt;interpreter-&gt;unwind(*vm, callFrame, exception, unwindStart); // This may update callFrame.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx">     LOG_IC((ICEvent::OperationInOptimize, base-&gt;classInfo(), ident));
</span><span class="cx">     PropertySlot slot(base, PropertySlot::InternalMethodType::HasProperty);
</span><span class="cx">     bool result = asObject(base)-&gt;getPropertySlot(exec, ident, slot);
</span><del>-    if (vm-&gt;exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     
</span><span class="cx">     RELEASE_ASSERT(accessType == stubInfo-&gt;accessType);
</span><span class="lines">@@ -489,6 +489,7 @@
</span><span class="cx"> static void putByVal(CallFrame* callFrame, JSValue baseValue, JSValue subscript, JSValue value, ByValInfo* byValInfo)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = callFrame-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (LIKELY(subscript.isUInt32())) {
</span><span class="cx">         byValInfo-&gt;tookSlowPath = true;
</span><span class="cx">         uint32_t i = subscript.asUInt32();
</span><span class="lines">@@ -510,7 +511,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto property = subscript.toPropertyKey(callFrame);
</span><span class="cx">     // Don't put to an object if toString threw an exception.
</span><del>-    if (callFrame-&gt;vm().exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (byValInfo-&gt;stubInfo &amp;&amp; (!isStringOrSymbol(subscript) || byValInfo-&gt;cachedId != property))
</span><span class="lines">@@ -522,6 +523,8 @@
</span><span class="cx"> 
</span><span class="cx"> static void directPutByVal(CallFrame* callFrame, JSObject* baseObject, JSValue subscript, JSValue value, ByValInfo* byValInfo)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = callFrame-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     bool isStrictMode = callFrame-&gt;codeBlock()-&gt;isStrictMode();
</span><span class="cx">     if (LIKELY(subscript.isUInt32())) {
</span><span class="cx">         // Despite its name, JSValue::isUInt32 will return true only for positive boxed int32_t; all those values are valid array indices.
</span><span class="lines">@@ -553,7 +556,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Don't put to an object if toString threw an exception.
</span><span class="cx">     auto property = subscript.toPropertyKey(callFrame);
</span><del>-    if (callFrame-&gt;vm().exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (Optional&lt;uint32_t&gt; index = parseIndex(property)) {
</span><span class="lines">@@ -774,7 +777,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationCallEval(ExecState* exec, ExecState* execCallee)
</span><span class="cx"> {
</span><del>-    UNUSED_PARAM(exec);
</del><ins>+    VM* vm = &amp;exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(*vm);
</ins><span class="cx"> 
</span><span class="cx">     execCallee-&gt;setCodeBlock(0);
</span><span class="cx">     
</span><span class="lines">@@ -781,9 +785,8 @@
</span><span class="cx">     if (!isHostFunction(execCallee-&gt;calleeAsValue(), globalFuncEval))
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><del>-    VM* vm = &amp;execCallee-&gt;vm();
</del><span class="cx">     JSValue result = eval(execCallee);
</span><del>-    if (vm-&gt;exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return EncodedJSValue();
</span><span class="cx">     
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -807,7 +810,7 @@
</span><span class="cx">             NativeCallFrameTracer tracer(vm, execCallee);
</span><span class="cx">             execCallee-&gt;setCallee(asObject(callee));
</span><span class="cx">             vm-&gt;hostCallReturnValue = JSValue::decode(callData.native.function(execCallee));
</span><del>-            if (vm-&gt;exception()) {
</del><ins>+            if (UNLIKELY(scope.exception())) {
</ins><span class="cx">                 return encodeResult(
</span><span class="cx">                     vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
</span><span class="cx">                     reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</span><span class="lines">@@ -836,7 +839,7 @@
</span><span class="cx">         NativeCallFrameTracer tracer(vm, execCallee);
</span><span class="cx">         execCallee-&gt;setCallee(asObject(callee));
</span><span class="cx">         vm-&gt;hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
</span><del>-        if (vm-&gt;exception()) {
</del><ins>+        if (UNLIKELY(scope.exception())) {
</ins><span class="cx">             return encodeResult(
</span><span class="cx">                 vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
</span><span class="cx">                 reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</span><span class="lines">@@ -1462,8 +1465,10 @@
</span><span class="cx"> 
</span><span class="cx"> static void putAccessorByVal(ExecState* exec, JSObject* base, JSValue subscript, int32_t attribute, JSObject* accessor, AccessorType accessorType)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     auto propertyKey = subscript.toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (accessorType == AccessorType::Getter)
</span><span class="lines">@@ -1608,8 +1613,10 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValue getByVal(ExecState* exec, JSValue baseValue, JSValue subscript, ByValInfo* byValInfo, ReturnAddressPtr returnAddress)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (LIKELY(baseValue.isCell() &amp;&amp; subscript.isString())) {
</span><del>-        VM&amp; vm = exec-&gt;vm();
</del><span class="cx">         Structure&amp; structure = *baseValue.asCell()-&gt;structure(vm);
</span><span class="cx">         if (JSCell::canUseFastGetOwnProperty(structure)) {
</span><span class="cx">             if (RefPtr&lt;AtomicStringImpl&gt; existingAtomicString = asString(subscript)-&gt;toExistingAtomicString(exec)) {
</span><span class="lines">@@ -1651,10 +1658,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     baseValue.requireObjectCoercible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto property = subscript.toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(exec-&gt;bytecodeOffset());
</span><span class="lines">@@ -1845,6 +1852,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue baseValue = JSValue::decode(encodedBase);
</span><span class="cx">     JSValue subscript = JSValue::decode(encodedSubscript);
</span><span class="cx">     
</span><span class="lines">@@ -1862,10 +1870,10 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         baseValue.requireObjectCoercible(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         auto property = subscript.toPropertyKey(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         result = baseValue.get(exec, property);
</span><span class="cx">     }
</span><span class="lines">@@ -1914,10 +1922,10 @@
</span><span class="cx">     if (key.getUInt32(index))
</span><span class="cx">         couldDelete = baseObj-&gt;methodTable(vm)-&gt;deletePropertyByIndex(baseObj, exec, index);
</span><span class="cx">     else {
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         Identifier property = key.toPropertyKey(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         couldDelete = baseObj-&gt;methodTable(vm)-&gt;deleteProperty(baseObj, exec, property);
</span><span class="cx">     }
</span><span class="lines">@@ -2122,7 +2130,7 @@
</span><span class="cx">     PutPropertySlot slot(scope, codeBlock-&gt;isStrictMode(), PutPropertySlot::UnknownContext, isInitialization(getPutInfo.initializationMode()));
</span><span class="cx">     scope-&gt;methodTable()-&gt;put(scope, exec, ident, value, slot);
</span><span class="cx">     
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     CommonSlowPaths::tryCachePutToScopeGlobal(exec, codeBlock, pc, scope, getPutInfo, slot, ident);
</span><span class="lines">@@ -2371,11 +2379,12 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE static EncodedJSValue unprofiledMul(VM&amp; vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     double b = op2.toNumber(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a * b));
</span><span class="lines">@@ -2383,6 +2392,7 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE static EncodedJSValue profiledMul(VM&amp; vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, ArithProfile* arithProfile, bool shouldObserveLHSAndRHSTypes = true)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="lines">@@ -2390,10 +2400,10 @@
</span><span class="cx">         arithProfile-&gt;observeLHSAndRHS(op1, op2);
</span><span class="cx"> 
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     double b = op2.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     
</span><span class="cx">     JSValue result = jsNumber(a * b);
</span><span class="lines">@@ -2468,11 +2478,12 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE static EncodedJSValue unprofiledSub(VM&amp; vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     double b = op2.toNumber(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(a - b));
</span><span class="lines">@@ -2480,6 +2491,7 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE static EncodedJSValue profiledSub(VM&amp; vm, ExecState* exec, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2, ArithProfile* arithProfile, bool shouldObserveLHSAndRHSTypes = true)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue op1 = JSValue::decode(encodedOp1);
</span><span class="cx">     JSValue op2 = JSValue::decode(encodedOp2);
</span><span class="cx"> 
</span><span class="lines">@@ -2487,10 +2499,10 @@
</span><span class="cx">         arithProfile-&gt;observeLHSAndRHS(op1, op2);
</span><span class="cx"> 
</span><span class="cx">     double a = op1.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     double b = op2.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     
</span><span class="cx">     JSValue result = jsNumber(a - b);
</span><span class="lines">@@ -2580,13 +2592,14 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    RELEASE_ASSERT(!!vm.exception());
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+    RELEASE_ASSERT(!!scope.exception());
</ins><span class="cx"> 
</span><del>-    if (isTerminatedExecutionException(vm.exception())) {
</del><ins>+    if (isTerminatedExecutionException(scope.exception())) {
</ins><span class="cx">         genericUnwind(&amp;vm, exec);
</span><span class="cx">         return 1;
</span><del>-    } else
-        return 0;
</del><ins>+    }
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // extern &quot;C&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -301,12 +301,14 @@
</span><span class="cx"> 
</span><span class="cx">     static bool getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName name, PropertySlot&amp; slot)
</span><span class="cx">     {
</span><ins>+        VM&amp; vm = exec-&gt;vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         ImpureGetter* thisObject = jsCast&lt;ImpureGetter*&gt;(object);
</span><span class="cx">         
</span><span class="cx">         if (thisObject-&gt;m_delegate) {
</span><span class="cx">             if (thisObject-&gt;m_delegate-&gt;getPropertySlot(exec, name, slot))
</span><span class="cx">                 return true;
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1037,11 +1039,14 @@
</span><span class="cx"> 
</span><span class="cx"> JSInternalPromise* GlobalObject::moduleLoaderResolve(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue keyValue, JSValue referrerValue, JSValue)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx">     const Identifier key = keyValue.toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exception = exec-&gt;exception();
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        JSValue exception = scope.exception();
+        scope.clearException();
</ins><span class="cx">         return deferred-&gt;reject(exec, exception);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1054,9 +1059,9 @@
</span><span class="cx">             return deferred-&gt;reject(exec, createError(exec, ASCIILiteral(&quot;Could not resolve the current working directory.&quot;)));
</span><span class="cx">     } else {
</span><span class="cx">         const Identifier referrer = referrerValue.toPropertyKey(exec);
</span><del>-        if (exec-&gt;hadException()) {
-            JSValue exception = exec-&gt;exception();
-            exec-&gt;clearException();
</del><ins>+        if (UNLIKELY(scope.exception())) {
+            JSValue exception = scope.exception();
+            scope.clearException();
</ins><span class="cx">             return deferred-&gt;reject(exec, exception);
</span><span class="cx">         }
</span><span class="cx">         if (referrer.isSymbol()) {
</span><span class="lines">@@ -1142,11 +1147,13 @@
</span><span class="cx"> 
</span><span class="cx"> JSInternalPromise* GlobalObject::moduleLoaderFetch(JSGlobalObject* globalObject, ExecState* exec, JSModuleLoader*, JSValue key, JSValue)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx">     String moduleKey = key.toWTFString(exec);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exception = exec-&gt;exception();
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        JSValue exception = scope.exception();
+        scope.clearException();
</ins><span class="cx">         return deferred-&gt;reject(exec, exception);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1257,9 +1264,9 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionCreateElement(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    JSLockHolder lock(vm);
</ins><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     Root* root = jsDynamicCast&lt;Root*&gt;(exec-&gt;argument(0));
</span><span class="cx">     if (!root)
</span><span class="cx">         return JSValue::encode(throwException(exec, scope, createError(exec, ASCIILiteral(&quot;Cannot create Element without a Root.&quot;))));
</span><span class="lines">@@ -1447,7 +1454,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;char&gt; script;
</span><span class="cx">     if (!fetchScriptFromLocalFileSystem(fileName, script))
</span><span class="lines">@@ -1481,7 +1488,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String source = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     GlobalObject* globalObject = GlobalObject::create(vm, GlobalObject::createStructure(vm, jsNull()), Vector&lt;String&gt;());
</span><span class="lines">@@ -1509,7 +1516,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;char&gt; script;
</span><span class="cx">     if (!fetchScriptFromLocalFileSystem(fileName, script))
</span><span class="lines">@@ -1530,7 +1537,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String sourceCode = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><span class="cx"> 
</span><span class="lines">@@ -1547,7 +1554,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;char&gt; script;
</span><span class="cx">     if (!fillBufferWithContentsOfFile(fileName, script))
</span><span class="lines">@@ -1562,7 +1569,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;char&gt; script;
</span><span class="cx">     if (!fetchScriptFromLocalFileSystem(fileName, script))
</span><span class="lines">@@ -1622,8 +1629,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionSetRandomSeed(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     unsigned seed = exec-&gt;argument(0).toUInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     exec-&gt;lexicalGlobalObject()-&gt;weakRandom().setSeed(seed);
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -1876,7 +1886,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     Vector&lt;char&gt; script;
</span><span class="cx">     if (!fetchScriptFromLocalFileSystem(fileName, script))
</span><span class="lines">@@ -1883,7 +1893,7 @@
</span><span class="cx">         return JSValue::encode(throwException(exec, scope, createError(exec, ASCIILiteral(&quot;Could not open file.&quot;))));
</span><span class="cx"> 
</span><span class="cx">     JSInternalPromise* promise = loadAndEvaluateModule(exec, fileName);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue error;
</span><span class="lines">@@ -1901,14 +1911,16 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionCreateBuiltin(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (exec-&gt;argumentCount() &lt; 1 || !exec-&gt;argument(0).isString())
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     String functionText = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     const SourceCode&amp; source = makeSource(functionText);
</span><span class="cx">     JSFunction* func = JSFunction::createBuiltinFunction(vm, createBuiltinExecutable(vm, source, Identifier::fromString(&amp;vm, &quot;foo&quot;), ConstructorKind::None, ConstructAbility::CannotConstruct)-&gt;link(vm, source), exec-&gt;lexicalGlobalObject());
</span><span class="cx"> 
</span><span class="lines">@@ -1927,7 +1939,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String source = exec-&gt;argument(0).toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     StopWatch stopWatch;
</span><span class="lines">@@ -1953,7 +1965,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionGenerateHeapSnapshot(ExecState* exec)
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     HeapSnapshotBuilder snapshotBuilder(exec-&gt;vm().ensureHeapProfiler());
</span><span class="cx">     snapshotBuilder.buildSnapshot();
</span><span class="lines">@@ -1960,7 +1974,7 @@
</span><span class="cx"> 
</span><span class="cx">     String jsonString = snapshotBuilder.json();
</span><span class="cx">     EncodedJSValue result = JSValue::encode(JSONParse(exec, jsonString));
</span><del>-    RELEASE_ASSERT(!exec-&gt;hadException());
</del><ins>+    RELEASE_ASSERT(!scope.exception());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1998,7 +2012,7 @@
</span><span class="cx"> 
</span><span class="cx">     String jsonString = vm.samplingProfiler()-&gt;stackTracesAsJSON();
</span><span class="cx">     EncodedJSValue result = JSValue::encode(JSONParse(exec, jsonString));
</span><del>-    RELEASE_ASSERT(!exec-&gt;hadException());
</del><ins>+    RELEASE_ASSERT(!scope.exception());
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(SAMPLING_PROFILER)
</span><span class="lines">@@ -2101,6 +2115,16 @@
</span><span class="cx"> 
</span><span class="cx"> static void dumpException(GlobalObject* globalObject, JSValue exception)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
+#define CHECK_EXCEPTION() do { \
+        if (scope.exception()) { \
+            scope.clearException(); \
+            return; \
+        } \
+    } while (false)
+
</ins><span class="cx">     printf(&quot;Exception: %s\n&quot;, exception.toWTFString(globalObject-&gt;globalExec()).utf8().data());
</span><span class="cx"> 
</span><span class="cx">     Identifier nameID = Identifier::fromString(globalObject-&gt;globalExec(), &quot;name&quot;);
</span><span class="lines">@@ -2109,9 +2133,13 @@
</span><span class="cx">     Identifier stackID = Identifier::fromString(globalObject-&gt;globalExec(), &quot;stack&quot;);
</span><span class="cx">     
</span><span class="cx">     JSValue nameValue = exception.get(globalObject-&gt;globalExec(), nameID);
</span><ins>+    CHECK_EXCEPTION();
</ins><span class="cx">     JSValue fileNameValue = exception.get(globalObject-&gt;globalExec(), fileNameID);
</span><ins>+    CHECK_EXCEPTION();
</ins><span class="cx">     JSValue lineNumberValue = exception.get(globalObject-&gt;globalExec(), lineNumberID);
</span><ins>+    CHECK_EXCEPTION();
</ins><span class="cx">     JSValue stackValue = exception.get(globalObject-&gt;globalExec(), stackID);
</span><ins>+    CHECK_EXCEPTION();
</ins><span class="cx">     
</span><span class="cx">     if (nameValue.toWTFString(globalObject-&gt;globalExec()) == &quot;SyntaxError&quot;
</span><span class="cx">         &amp;&amp; (!fileNameValue.isUndefinedOrNull() || !lineNumberValue.isUndefinedOrNull())) {
</span><span class="lines">@@ -2123,11 +2151,14 @@
</span><span class="cx">     
</span><span class="cx">     if (!stackValue.isUndefinedOrNull())
</span><span class="cx">         printf(&quot;%s\n&quot;, stackValue.toWTFString(globalObject-&gt;globalExec()).utf8().data());
</span><ins>+
+#undef CHECK_EXCEPTION
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool checkUncaughtException(VM&amp; vm, GlobalObject* globalObject, JSValue exception, const String&amp; expectedExceptionName, bool alwaysDumpException)
</span><span class="cx"> {
</span><del>-    vm.clearException();
</del><ins>+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    scope.clearException();
</ins><span class="cx">     if (!exception) {
</span><span class="cx">         printf(&quot;Expected uncaught exception with name '%s' but none was thrown\n&quot;, expectedExceptionName.utf8().data());
</span><span class="cx">         return false;
</span><span class="lines">@@ -2135,13 +2166,13 @@
</span><span class="cx"> 
</span><span class="cx">     ExecState* exec = globalObject-&gt;globalExec();
</span><span class="cx">     JSValue exceptionClass = globalObject-&gt;get(exec, Identifier::fromString(exec, expectedExceptionName));
</span><del>-    if (!exceptionClass.isObject() || vm.exception()) {
</del><ins>+    if (!exceptionClass.isObject() || scope.exception()) {
</ins><span class="cx">         printf(&quot;Expected uncaught exception with name '%s' but given exception class is not defined\n&quot;, expectedExceptionName.utf8().data());
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isInstanceOfExpectedException = jsCast&lt;JSObject*&gt;(exceptionClass)-&gt;hasInstance(exec, exception);
</span><del>-    if (vm.exception()) {
</del><ins>+    if (scope.exception()) {
</ins><span class="cx">         printf(&quot;Expected uncaught exception with name '%s' but given exception class fails performing hasInstance\n&quot;, expectedExceptionName.utf8().data());
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="lines">@@ -2165,6 +2196,7 @@
</span><span class="cx">         JSC::Options::dumpGeneratedBytecodes() = true;
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = globalObject-&gt;vm();
</span><ins>+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     bool success = true;
</span><span class="cx"> 
</span><span class="cx">     auto checkException = [&amp;] (bool isLastFile, bool hasException, JSValue value) {
</span><span class="lines">@@ -2207,7 +2239,7 @@
</span><span class="cx">         if (isModule) {
</span><span class="cx">             if (!promise)
</span><span class="cx">                 promise = loadAndEvaluateModule(globalObject-&gt;globalExec(), jscSource(scriptBuffer, fileName));
</span><del>-            vm.clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">             JSFunction* fulfillHandler = JSNativeStdFunction::create(vm, globalObject, 1, String(), [&amp;, isLastFile](ExecState* exec) {
</span><span class="cx">                 checkException(isLastFile, false, exec-&gt;argument(0));
</span><span class="lines">@@ -2224,6 +2256,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             NakedPtr&lt;Exception&gt; evaluationException;
</span><span class="cx">             JSValue returnValue = evaluate(globalObject-&gt;globalExec(), jscSource(scriptBuffer, fileName), JSValue(), evaluationException);
</span><ins>+            ASSERT(!scope.exception());
</ins><span class="cx">             if (evaluationException)
</span><span class="cx">                 returnValue = evaluationException-&gt;value();
</span><span class="cx">             checkException(isLastFile, evaluationException, returnValue);
</span><span class="lines">@@ -2230,7 +2263,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         scriptBuffer.clear();
</span><del>-        vm.clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REGEXP_TRACING)
</span><span class="lines">@@ -2243,6 +2276,9 @@
</span><span class="cx"> 
</span><span class="cx"> static void runInteractive(GlobalObject* globalObject)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     String interpreterName(ASCIILiteral(&quot;Interpreter&quot;));
</span><span class="cx">     
</span><span class="cx">     bool shouldQuit = false;
</span><span class="lines">@@ -2293,7 +2329,7 @@
</span><span class="cx">         else
</span><span class="cx">             printf(&quot;%s\n&quot;, returnValue.toWTFString(globalObject-&gt;globalExec()).utf8().data());
</span><span class="cx"> 
</span><del>-        globalObject-&gt;globalExec()-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         globalObject-&gt;vm().drainMicrotasks();
</span><span class="cx">     }
</span><span class="cx">     printf(&quot;\n&quot;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntExceptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -46,7 +46,8 @@
</span><span class="cx">     UNUSED_PARAM(exec);
</span><span class="cx"> #if LLINT_SLOW_PATH_TRACING
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    dataLog(&quot;Throwing exception &quot;, vm-&gt;exception(), &quot; (returnToThrow).\n&quot;);
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
+    dataLog(&quot;Throwing exception &quot;, scope.exception(), &quot; (returnToThrow).\n&quot;);
</ins><span class="cx"> #endif
</span><span class="cx">     return LLInt::exceptionInstructions();
</span><span class="cx"> }
</span><span class="lines">@@ -56,7 +57,8 @@
</span><span class="cx">     UNUSED_PARAM(exec);
</span><span class="cx"> #if LLINT_SLOW_PATH_TRACING
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    dataLog(&quot;Throwing exception &quot;, vm-&gt;exception(), &quot; (callToThrow).\n&quot;);
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(*vm);
+    dataLog(&quot;Throwing exception &quot;, scope.exception(), &quot; (callToThrow).\n&quot;);
</ins><span class="cx"> #endif
</span><span class="cx">     return LLInt::getCodePtr(llint_throw_during_call_trampoline);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -882,7 +882,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Don't put to an object if toString threw an exception.
</span><span class="cx">     auto property = subscript.toPropertyKey(exec);
</span><del>-    if (exec-&gt;vm().exception())
</del><ins>+    if (throwScope.exception())
</ins><span class="cx">         LLINT_END();
</span><span class="cx"> 
</span><span class="cx">     if (Optional&lt;uint32_t&gt; index = parseIndex(property))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerBytecodeSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -79,8 +79,9 @@
</span><span class="cx"> void BytecodeSequence::addSequenceProperties(ExecState* exec, JSObject* result) const
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* header = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     for (unsigned i = 0; i &lt; m_header.size(); ++i)
</span><span class="cx">         header-&gt;putDirectIndex(exec, i, jsString(exec, String::fromUTF8(m_header[i])));
</span><span class="lines">@@ -87,7 +88,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().header, header);
</span><span class="cx">     
</span><span class="cx">     JSArray* sequence = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     for (unsigned i = 0; i &lt; m_sequence.size(); ++i)
</span><span class="cx">         sequence-&gt;putDirectIndex(exec, i, m_sequence[i].toJS(exec));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerCompilationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -115,14 +115,15 @@
</span><span class="cx"> JSValue Compilation::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().bytecodesID, jsNumber(m_bytecodes-&gt;id()));
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind))));
</span><span class="cx">     
</span><span class="cx">     JSArray* profiledBytecodes = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_profiledBytecodes.size(); ++i)
</span><span class="cx">         profiledBytecodes-&gt;putDirectIndex(exec, i, m_profiledBytecodes[i].toJS(exec));
</span><span class="lines">@@ -129,7 +130,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().profiledBytecodes, profiledBytecodes);
</span><span class="cx">     
</span><span class="cx">     JSArray* descriptions = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_descriptions.size(); ++i)
</span><span class="cx">         descriptions-&gt;putDirectIndex(exec, i, m_descriptions[i].toJS(exec));
</span><span class="lines">@@ -136,7 +137,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().descriptions, descriptions);
</span><span class="cx">     
</span><span class="cx">     JSArray* counters = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (auto it = m_counters.begin(), end = m_counters.end(); it != end; ++it) {
</span><span class="cx">         JSObject* counterEntry = constructEmptyObject(exec);
</span><span class="lines">@@ -147,7 +148,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().counters, counters);
</span><span class="cx">     
</span><span class="cx">     JSArray* exitSites = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_osrExitSites.size(); ++i)
</span><span class="cx">         exitSites-&gt;putDirectIndex(exec, i, m_osrExitSites[i].toJS(exec));
</span><span class="lines">@@ -154,7 +155,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().osrExitSites, exitSites);
</span><span class="cx">     
</span><span class="cx">     JSArray* exits = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_osrExits.size(); ++i)
</span><span class="cx">         exits-&gt;putDirectIndex(exec, i, m_osrExits[i].toJS(exec));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -100,10 +100,11 @@
</span><span class="cx"> JSValue Database::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><span class="cx">     
</span><span class="cx">     JSArray* bytecodes = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_bytecodes.size(); ++i)
</span><span class="cx">         bytecodes-&gt;putDirectIndex(exec, i, m_bytecodes[i].toJS(exec));
</span><span class="lines">@@ -110,7 +111,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().bytecodes, bytecodes);
</span><span class="cx">     
</span><span class="cx">     JSArray* compilations = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_compilations.size(); ++i)
</span><span class="cx">         compilations-&gt;putDirectIndex(exec, i, m_compilations[i]-&gt;toJS(exec));
</span><span class="lines">@@ -117,7 +118,7 @@
</span><span class="cx">     result-&gt;putDirect(vm, exec-&gt;propertyNames().compilations, compilations);
</span><span class="cx">     
</span><span class="cx">     JSArray* events = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_events.size(); ++i)
</span><span class="cx">         events-&gt;putDirectIndex(exec, i, m_events[i].toJS(exec));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerOSRExitSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -37,8 +37,9 @@
</span><span class="cx"> JSValue OSRExitSite::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; m_codeAddresses.size(); ++i)
</span><span class="cx">         result-&gt;putDirectIndex(exec, i, jsString(exec, toString(RawPointer(m_codeAddresses[i]))));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerOriginStackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -101,8 +101,9 @@
</span><span class="cx"> JSValue OriginStack::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     
</span><span class="cx">     for (unsigned i = 0; i &lt; m_stack.size(); ++i)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -196,6 +196,9 @@
</span><span class="cx"> 
</span><span class="cx"> static ALWAYS_INLINE std::pair&lt;SpeciesConstructResult, JSObject*&gt; speciesConstructArray(ExecState* exec, JSObject* thisObject, unsigned length)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // ECMA 9.4.2.3: https://tc39.github.io/ecma262/#sec-arrayspeciescreate
</span><span class="cx">     JSValue constructor = jsUndefined();
</span><span class="cx">     if (LIKELY(isArray(exec, thisObject))) {
</span><span class="lines">@@ -205,7 +208,7 @@
</span><span class="cx">             return std::make_pair(SpeciesConstructResult::FastPath, nullptr);
</span><span class="cx"> 
</span><span class="cx">         constructor = thisObject-&gt;get(exec, exec-&gt;propertyNames().constructor);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return std::make_pair(SpeciesConstructResult::Exception, nullptr);
</span><span class="cx">         if (constructor.isConstructor()) {
</span><span class="cx">             JSObject* constructorObject = jsCast&lt;JSObject*&gt;(constructor);
</span><span class="lines">@@ -214,12 +217,12 @@
</span><span class="cx">         }
</span><span class="cx">         if (constructor.isObject()) {
</span><span class="cx">             constructor = constructor.get(exec, exec-&gt;propertyNames().speciesSymbol);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return std::make_pair(SpeciesConstructResult::Exception, nullptr);
</span><span class="cx">             if (constructor.isNull())
</span><span class="cx">                 return std::make_pair(SpeciesConstructResult::FastPath, nullptr);;
</span><span class="cx">         }
</span><del>-    } else if (exec-&gt;hadException())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return std::make_pair(SpeciesConstructResult::Exception, nullptr);
</span><span class="cx"> 
</span><span class="cx">     if (constructor.isUndefined())
</span><span class="lines">@@ -228,7 +231,7 @@
</span><span class="cx">     MarkedArgumentBuffer args;
</span><span class="cx">     args.append(jsNumber(length));
</span><span class="cx">     JSObject* newObject = construct(exec, constructor, args, &quot;Species construction did not get a valid constructor&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return std::make_pair(SpeciesConstructResult::Exception, nullptr);
</span><span class="cx">     return std::make_pair(SpeciesConstructResult::CreatedObject, newObject);
</span><span class="cx"> }
</span><span class="lines">@@ -284,10 +287,10 @@
</span><span class="cx">         unsigned from = k + currentCount;
</span><span class="cx">         unsigned to = k + resultCount;
</span><span class="cx">         if (JSValue value = getProperty(exec, thisObj, from)) {
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return;
</span><span class="cx">             thisObj-&gt;putByIndexInline(exec, to, value, true);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return;
</span><span class="cx">         } else if (!thisObj-&gt;methodTable(vm)-&gt;deletePropertyByIndex(thisObj, exec, to)) {
</span><span class="cx">             throwTypeError(exec, scope, ASCIILiteral(&quot;Unable to delete property.&quot;));
</span><span class="lines">@@ -330,7 +333,7 @@
</span><span class="cx">         unsigned from = k + currentCount - 1;
</span><span class="cx">         unsigned to = k + resultCount - 1;
</span><span class="cx">         if (JSValue value = getProperty(exec, thisObj, from)) {
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return;
</span><span class="cx">             thisObj-&gt;putByIndexInline(exec, to, value, true);
</span><span class="cx">         } else if (!thisObj-&gt;methodTable(vm)-&gt;deletePropertyByIndex(thisObj, exec, to)) {
</span><span class="lines">@@ -337,7 +340,7 @@
</span><span class="cx">             throwTypeError(exec, scope, ASCIILiteral(&quot;Unable to delete property.&quot;));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -344,17 +347,18 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncToString(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx"> 
</span><span class="cx">     // 1. Let array be the result of calling ToObject on the this value.
</span><span class="cx">     JSObject* thisObject = thisValue.toObject(exec);
</span><del>-    VM&amp; vm = exec-&gt;vm();
-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     
</span><span class="cx">     // 2. Let func be the result of calling the [[Get]] internal method of array with argument &quot;join&quot;.
</span><span class="cx">     JSValue function = JSValue(thisObject).get(exec, exec-&gt;propertyNames().join);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 3. If IsCallable(func) is false, then let func be the standard built-in method Object.prototype.toString (15.2.4.2).
</span><span class="lines">@@ -383,7 +387,7 @@
</span><span class="cx">         return JSValue::encode(earlyReturnValue);
</span><span class="cx"> 
</span><span class="cx">     JSStringJoiner joiner(*exec, ',', length);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="lines">@@ -390,11 +394,11 @@
</span><span class="cx">         JSValue element = thisArray-&gt;tryGetIndexQuickly(i);
</span><span class="cx">         if (!element) {
</span><span class="cx">             element = thisArray-&gt;get(exec, i);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx">         joiner.append(*exec, element);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -403,14 +407,16 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncToLocaleString(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx"> 
</span><span class="cx">     JSObject* thisObject = thisValue.toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned length = getLength(exec, thisObject);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     StringRecursionChecker checker(exec, thisObject);
</span><span class="lines">@@ -418,7 +424,7 @@
</span><span class="cx">         return JSValue::encode(earlyReturnValue);
</span><span class="cx"> 
</span><span class="cx">     JSStringJoiner stringJoiner(*exec, ',', length);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INTL)
</span><span class="lines">@@ -425,45 +431,45 @@
</span><span class="cx">     ArgList arguments(exec);
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         JSValue element = thisObject-&gt;getIndex(exec, i);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (element.isUndefinedOrNull())
</span><span class="cx">             element = jsEmptyString(exec);
</span><span class="cx">         else {
</span><span class="cx">             JSValue conversionFunction = element.get(exec, exec-&gt;propertyNames().toLocaleString);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             CallData callData;
</span><span class="cx">             CallType callType = getCallData(conversionFunction, callData);
</span><span class="cx">             if (callType != CallType::None) {
</span><span class="cx">                 element = call(exec, conversionFunction, callType, callData, element, arguments);
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         stringJoiner.append(*exec, element);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> #else // !ENABLE(INTL)
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         JSValue element = thisObject-&gt;getIndex(exec, i);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (element.isUndefinedOrNull())
</span><span class="cx">             continue;
</span><span class="cx">         JSValue conversionFunction = element.get(exec, exec-&gt;propertyNames().toLocaleString);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         CallData callData;
</span><span class="cx">         CallType callType = getCallData(conversionFunction, callData);
</span><span class="cx">         if (callType != CallType::None) {
</span><span class="cx">             element = call(exec, conversionFunction, callType, callData, element, exec-&gt;emptyList());
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx">         stringJoiner.append(*exec, element);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> #endif // !ENABLE(INTL)
</span><span class="lines">@@ -498,15 +504,16 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValue slowJoin(ExecState&amp; exec, JSObject* thisObject, JSString* separator, uint64_t length)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 5. If len is zero, return the empty String.
</span><span class="cx">     if (!length)
</span><span class="cx">         return jsEmptyString(&amp;exec);
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec.vm();
-
</del><span class="cx">     // 6. Let element0 be Get(O, &quot;0&quot;).
</span><span class="cx">     JSValue element0 = thisObject-&gt;getIndex(&amp;exec, 0);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     // 7. If element0 is undefined or null, let R be the empty String; otherwise, let R be ? ToString(element0).
</span><span class="lines">@@ -515,7 +522,7 @@
</span><span class="cx">         r = jsEmptyString(&amp;exec);
</span><span class="cx">     else
</span><span class="cx">         r = element0.toString(&amp;exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     // 8. Let k be 1.
</span><span class="lines">@@ -524,7 +531,7 @@
</span><span class="cx">     for (uint64_t k = 1; k &lt; length; ++k) {
</span><span class="cx">         // b. Let element be ? Get(O, ! ToString(k)).
</span><span class="cx">         JSValue element = thisObject-&gt;get(&amp;exec, Identifier::fromString(&amp;exec, AtomicString::number(k)));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue();
</span><span class="cx"> 
</span><span class="cx">         // c. If element is undefined or null, let next be the empty String; otherwise, let next be ? ToString(element).
</span><span class="lines">@@ -535,7 +542,7 @@
</span><span class="cx">             next = jsEmptyString(&amp;exec);
</span><span class="cx">         } else
</span><span class="cx">             next = element.toString(&amp;exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue();
</span><span class="cx"> 
</span><span class="cx">         // a. Let S be the String value produced by concatenating R and sep.
</span><span class="lines">@@ -561,6 +568,9 @@
</span><span class="cx"> 
</span><span class="cx"> static inline JSValue fastJoin(ExecState&amp; state, JSObject* thisObject, StringView separator, unsigned length)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     switch (thisObject-&gt;indexingType()) {
</span><span class="cx">     case ALL_CONTIGUOUS_INDEXING_TYPES:
</span><span class="cx">     case ALL_INT32_INDEXING_TYPES: {
</span><span class="lines">@@ -568,7 +578,7 @@
</span><span class="cx">         if (length &gt; butterfly.publicLength())
</span><span class="cx">             break;
</span><span class="cx">         JSStringJoiner joiner(state, separator, length);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         auto data = butterfly.contiguous().data();
</span><span class="cx">         bool holesKnownToBeOK = false;
</span><span class="lines">@@ -592,7 +602,7 @@
</span><span class="cx">         if (length &gt; butterfly.publicLength())
</span><span class="cx">             break;
</span><span class="cx">         JSStringJoiner joiner(state, separator, length);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         auto data = butterfly.contiguousDouble().data();
</span><span class="cx">         bool holesKnownToBeOK = false;
</span><span class="lines">@@ -602,7 +612,7 @@
</span><span class="cx">                 joiner.append(state, jsDoubleNumber(value));
</span><span class="cx">             else {
</span><span class="cx">                 if (!holesKnownToBeOK) {
</span><del>-                    if (thisObject-&gt;structure(state.vm())-&gt;holesMustForwardToPrototype(state.vm()))
</del><ins>+                    if (thisObject-&gt;structure(vm)-&gt;holesMustForwardToPrototype(vm))
</ins><span class="cx">                         goto generalCase;
</span><span class="cx">                     holesKnownToBeOK = true;
</span><span class="cx">                 }
</span><span class="lines">@@ -615,14 +625,14 @@
</span><span class="cx"> 
</span><span class="cx"> generalCase:
</span><span class="cx">     JSStringJoiner joiner(state, separator, length);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         JSValue element = thisObject-&gt;getIndex(&amp;state, i);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         joiner.append(state, element);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     return joiner.join(state);
</span><span class="lines">@@ -630,6 +640,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 1. Let O be ? ToObject(this value).
</span><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObject)
</span><span class="lines">@@ -641,7 +654,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 2. Let len be ? ToLength(? Get(O, &quot;length&quot;)).
</span><span class="cx">     double length = toLength(exec, thisObject);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     // 3. If separator is undefined, let separator be the single-element String &quot;,&quot;.
</span><span class="lines">@@ -653,7 +666,7 @@
</span><span class="cx">             uint64_t length64 = static_cast&lt;uint64_t&gt;(length);
</span><span class="cx">             ASSERT(static_cast&lt;double&gt;(length64) == length);
</span><span class="cx">             JSString* jsSeparator = jsSingleCharacterString(exec, comma);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">             return JSValue::encode(slowJoin(*exec, thisObject, jsSeparator, length64));
</span><span class="lines">@@ -666,7 +679,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 4. Let sep be ? ToString(separator).
</span><span class="cx">     JSString* jsSeparator = separatorValue.toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (UNLIKELY(length &gt; std::numeric_limits&lt;unsigned&gt;::max() || !canUseFastJoin(thisObject))) {
</span><span class="lines">@@ -692,7 +705,7 @@
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue result;
</span><span class="lines">@@ -701,7 +714,7 @@
</span><span class="cx">         result = jsUndefined();
</span><span class="cx">     } else {
</span><span class="cx">         result = thisObj-&gt;get(exec, length - 1);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (!thisObj-&gt;methodTable(vm)-&gt;deletePropertyByIndex(thisObj, exec, length - 1)) {
</span><span class="cx">             throwTypeError(exec, scope, ASCIILiteral(&quot;Unable to delete property.&quot;));
</span><span class="lines">@@ -714,6 +727,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncPush(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx"> 
</span><span class="cx">     if (isJSArray(thisValue) &amp;&amp; exec-&gt;argumentCount() == 1) {
</span><span class="lines">@@ -726,7 +741,7 @@
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     for (unsigned n = 0; n &lt; exec-&gt;argumentCount(); n++) {
</span><span class="lines">@@ -738,7 +753,7 @@
</span><span class="cx">             Identifier propertyName = Identifier::fromString(exec, JSValue(static_cast&lt;int64_t&gt;(length) + static_cast&lt;int64_t&gt;(n)).toWTFString(exec));
</span><span class="cx">             thisObj-&gt;methodTable()-&gt;put(thisObj, exec, propertyName, exec-&gt;uncheckedArgument(n), slot);
</span><span class="cx">         }
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -757,7 +772,7 @@
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     unsigned length = getLength(exec, thisObject);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     switch (thisObject-&gt;indexingType()) {
</span><span class="lines">@@ -798,31 +813,31 @@
</span><span class="cx">     for (unsigned lower = 0; lower &lt; middle; lower++) {
</span><span class="cx">         unsigned upper = length - lower - 1;
</span><span class="cx">         bool lowerExists = thisObject-&gt;hasProperty(exec, lower);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         JSValue lowerValue;
</span><span class="cx">         if (lowerExists) {
</span><span class="cx">             lowerValue = thisObject-&gt;get(exec, lower);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         bool upperExists = thisObject-&gt;hasProperty(exec, upper);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         JSValue upperValue;
</span><span class="cx">         if (upperExists) {
</span><span class="cx">             upperValue = thisObject-&gt;get(exec, upper);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (upperExists) {
</span><span class="cx">             thisObject-&gt;putByIndexInline(exec, lower, upperValue, true);
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(JSValue());
</span><span class="cx">         } else if (!thisObject-&gt;methodTable(vm)-&gt;deletePropertyByIndex(thisObject, exec, lower)) {
</span><del>-            if (!vm.exception())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwTypeError(exec, scope, ASCIILiteral(&quot;Unable to delete property.&quot;));
</span><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         }
</span><span class="lines">@@ -829,10 +844,10 @@
</span><span class="cx"> 
</span><span class="cx">         if (lowerExists) {
</span><span class="cx">             thisObject-&gt;putByIndexInline(exec, upper, lowerValue, true);
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(JSValue());
</span><span class="cx">         } else if (!thisObject-&gt;methodTable(vm)-&gt;deletePropertyByIndex(thisObject, exec, upper)) {
</span><del>-            if (!vm.exception())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwTypeError(exec, scope, ASCIILiteral(&quot;Unable to delete property.&quot;));
</span><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         }
</span><span class="lines">@@ -842,11 +857,13 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue result;
</span><span class="lines">@@ -856,7 +873,7 @@
</span><span class="cx">     } else {
</span><span class="cx">         result = thisObj-&gt;getIndex(exec, 0);
</span><span class="cx">         shift&lt;JSArray::ShiftCountForShift&gt;(exec, thisObj, 0, 1, 0, length);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         putLength(exec, thisObj, jsNumber(length - 1));
</span><span class="cx">     }
</span><span class="lines">@@ -867,11 +884,12 @@
</span><span class="cx"> {
</span><span class="cx">     // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, length);
</span><span class="lines">@@ -892,7 +910,7 @@
</span><span class="cx">         result = speciesResult.second;
</span><span class="cx">     else {
</span><span class="cx">         result = constructEmptyArray(exec, nullptr, end - begin);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -899,7 +917,7 @@
</span><span class="cx">     unsigned n = 0;
</span><span class="cx">     for (unsigned k = begin; k &lt; end; k++, n++) {
</span><span class="cx">         JSValue v = getProperty(exec, thisObj, k);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (v)
</span><span class="cx">             result-&gt;putDirectIndex(exec, n, v);
</span><span class="lines">@@ -919,7 +937,7 @@
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (!exec-&gt;argumentCount()) {
</span><span class="lines">@@ -932,7 +950,7 @@
</span><span class="cx">             result = speciesResult.second;
</span><span class="cx">         else {
</span><span class="cx">             result = constructEmptyArray(exec, nullptr);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -967,12 +985,12 @@
</span><span class="cx">             
</span><span class="cx">             for (unsigned k = 0; k &lt; deleteCount; ++k) {
</span><span class="cx">                 JSValue v = getProperty(exec, thisObj, k + begin);
</span><del>-                if (UNLIKELY(vm.exception()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">                 if (UNLIKELY(!v))
</span><span class="cx">                     continue;
</span><span class="cx">                 result-&gt;putByIndexInline(exec, k, v, true);
</span><del>-                if (UNLIKELY(vm.exception()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="lines">@@ -982,7 +1000,7 @@
</span><span class="cx">             
</span><span class="cx">             for (unsigned k = 0; k &lt; deleteCount; ++k) {
</span><span class="cx">                 JSValue v = getProperty(exec, thisObj, k + begin);
</span><del>-                if (UNLIKELY(vm.exception()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">                 if (UNLIKELY(!v))
</span><span class="cx">                     continue;
</span><span class="lines">@@ -994,16 +1012,16 @@
</span><span class="cx">     unsigned additionalArgs = std::max&lt;int&gt;(exec-&gt;argumentCount() - 2, 0);
</span><span class="cx">     if (additionalArgs &lt; deleteCount) {
</span><span class="cx">         shift&lt;JSArray::ShiftCountForSplice&gt;(exec, thisObj, begin, deleteCount, additionalArgs, length);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     } else if (additionalArgs &gt; deleteCount) {
</span><span class="cx">         unshift&lt;JSArray::ShiftCountForSplice&gt;(exec, thisObj, begin, deleteCount, additionalArgs, length);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     for (unsigned k = 0; k &lt; additionalArgs; ++k) {
</span><span class="cx">         thisObj-&gt;putByIndexInline(exec, k + begin, exec-&gt;uncheckedArgument(k + 2), true);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -1013,6 +1031,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncUnShift(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 15.4.4.13
</span><span class="cx"> 
</span><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="lines">@@ -1019,18 +1039,18 @@
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned nrArgs = exec-&gt;argumentCount();
</span><span class="cx">     if (nrArgs) {
</span><span class="cx">         unshift&lt;JSArray::ShiftCountForShift&gt;(exec, thisObj, 0, 0, nrArgs, length);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     for (unsigned k = 0; k &lt; nrArgs; ++k) {
</span><span class="cx">         thisObj-&gt;putByIndexInline(exec, k, exec-&gt;uncheckedArgument(k), true);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     JSValue result = jsNumber(length + nrArgs);
</span><span class="lines">@@ -1040,13 +1060,15 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncIndexOf(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 15.4.4.14
</span><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="cx">         return JSValue::encode(JSValue());
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     unsigned length = getLength(exec, thisObj);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
</span><span class="lines">@@ -1053,13 +1075,13 @@
</span><span class="cx">     JSValue searchElement = exec-&gt;argument(0);
</span><span class="cx">     for (; index &lt; length; ++index) {
</span><span class="cx">         JSValue e = getProperty(exec, thisObj, index);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (!e)
</span><span class="cx">             continue;
</span><span class="cx">         if (JSValue::strictEqual(exec, searchElement, e))
</span><span class="cx">             return JSValue::encode(jsNumber(index));
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1068,6 +1090,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 15.4.4.15
</span><span class="cx">     JSObject* thisObj = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="lines">@@ -1089,18 +1114,17 @@
</span><span class="cx">             index = static_cast&lt;unsigned&gt;(fromDouble);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     JSValue searchElement = exec-&gt;argument(0);
</span><span class="cx">     do {
</span><span class="cx">         RELEASE_ASSERT(index &lt; length);
</span><span class="cx">         JSValue e = getProperty(exec, thisObj, index);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (!e)
</span><span class="cx">             continue;
</span><span class="cx">         if (JSValue::strictEqual(exec, searchElement, e))
</span><span class="cx">             return JSValue::encode(jsNumber(index));
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     } while (index--);
</span><span class="cx"> 
</span><span class="lines">@@ -1109,12 +1133,14 @@
</span><span class="cx"> 
</span><span class="cx"> static bool moveElements(ExecState* exec, VM&amp; vm, JSArray* target, unsigned targetOffset, JSArray* source, unsigned sourceLength)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (LIKELY(!hasAnyArrayStorage(source-&gt;indexingType()) &amp;&amp; !source-&gt;structure()-&gt;holesMustForwardToPrototype(vm))) {
</span><span class="cx">         for (unsigned i = 0; i &lt; sourceLength; ++i) {
</span><span class="cx">             JSValue value = source-&gt;tryGetIndexQuickly(i);
</span><span class="cx">             if (value) {
</span><span class="cx">                 target-&gt;putDirectIndex(exec, targetOffset + i, value);
</span><del>-                if (vm.exception())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return false;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -1121,11 +1147,11 @@
</span><span class="cx">     } else {
</span><span class="cx">         for (unsigned i = 0; i &lt; sourceLength; ++i) {
</span><span class="cx">             JSValue value = getProperty(exec, source, i);
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">             if (value) {
</span><span class="cx">                 target-&gt;putDirectIndex(exec, targetOffset + i, value);
</span><del>-                if (vm.exception())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return false;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="lines">@@ -1154,7 +1180,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!result-&gt;appendMemcpy(exec, vm, 0, first)) {
</span><span class="cx">         if (!moveElements(exec, vm, result, 0, first, firstArraySize)) {
</span><del>-            ASSERT(vm.exception());
</del><ins>+            ASSERT(scope.exception());
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1199,12 +1225,12 @@
</span><span class="cx">     IndexingType type = firstArray-&gt;mergeIndexingTypeForCopying(secondType);
</span><span class="cx">     if (type == NonArray || !firstArray-&gt;canFastCopy(vm, secondArray) || firstArraySize + secondArraySize &gt;= MIN_SPARSE_ARRAY_INDEX) {
</span><span class="cx">         JSArray* result = constructEmptyArray(exec, nullptr, firstArraySize + secondArraySize);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">         if (!moveElements(exec, vm, result, 0, firstArray, firstArraySize)
</span><span class="cx">             || !moveElements(exec, vm, result, firstArraySize, secondArray, secondArraySize)) {
</span><del>-            ASSERT(vm.exception());
</del><ins>+            ASSERT(scope.exception());
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeBooleanConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -48,12 +48,14 @@
</span><span class="cx"> // ECMA 15.6.2
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructWithBooleanConstructor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue boolean = jsBoolean(exec-&gt;argument(0).toBoolean(exec));
</span><span class="cx">     Structure* booleanStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), asInternalFunction(exec-&gt;callee())-&gt;globalObject()-&gt;booleanObjectStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><del>-    BooleanObject* obj = BooleanObject::create(exec-&gt;vm(), booleanStructure);
-    obj-&gt;setInternalValue(exec-&gt;vm(), boolean);
</del><ins>+    BooleanObject* obj = BooleanObject::create(vm, booleanStructure);
+    obj-&gt;setInternalValue(vm, boolean);
</ins><span class="cx">     return JSValue::encode(obj);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCallDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CallData.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CallData.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/CallData.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008, 2016 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -42,10 +42,12 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue call(ExecState* exec, JSValue functionObject, CallType callType, const CallData&amp; callData, JSValue thisValue, const ArgList&amp; args, NakedPtr&lt;Exception&gt;&amp; returnedException)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSValue result = call(exec, functionObject, callType, callData, thisValue, args);
</span><del>-    if (exec-&gt;hadException()) {
-        returnedException = exec-&gt;exception();
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        returnedException = scope.exception();
+        scope.clearException();
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     RELEASE_ASSERT(result);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCatchScopecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/CatchScope.cpp (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CatchScope.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/CatchScope.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 &quot;config.h&quot;
+#include &quot;CatchScope.h&quot;
+
+namespace JSC {
+    
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+
+CatchScope::CatchScope(VM&amp; vm, ExceptionEventLocation location)
+    : ExceptionScope(vm, location)
+{
+    m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
+}
+
+CatchScope::~CatchScope()
+{
+    RELEASE_ASSERT(m_vm.m_topExceptionScope);
+    m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
+}
+
+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCatchScopeh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/CatchScope.h (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CatchScope.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/CatchScope.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 CatchScope_h
+#define CatchScope_h
+
+#include &quot;ExceptionScope.h&quot;
+
+namespace JSC {
+    
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+// If a function can clear JS exceptions, it should declare a CatchScope at the
+// top of the function (as early as possible) using the DECLARE_CATCH_SCOPE macro.
+// Declaring a CatchScope in a function means that the function intends to clear
+// pending exceptions before returning to its caller.
+    
+class CatchScope : public ExceptionScope {
+public:
+    JS_EXPORT_PRIVATE CatchScope(VM&amp;, ExceptionEventLocation);
+    CatchScope(const CatchScope&amp;) = delete;
+    CatchScope(CatchScope&amp;&amp;) = default;
+
+    JS_EXPORT_PRIVATE ~CatchScope();
+
+    void clearException() { m_vm.clearException(); }
+};
+
+#define DECLARE_CATCH_SCOPE(vm__) \
+    JSC::CatchScope((vm__), JSC::ExceptionEventLocation(__FUNCTION__, __FILE__, __LINE__))
+
+#else // not ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+
+class CatchScope : public ExceptionScope {
+public:
+    ALWAYS_INLINE CatchScope(VM&amp; vm)
+        : ExceptionScope(vm)
+    { }
+    CatchScope(const CatchScope&amp;) = delete;
+    CatchScope(CatchScope&amp;&amp;) = default;
+
+    ALWAYS_INLINE void clearException() { m_vm.clearException(); }
+};
+
+#define DECLARE_CATCH_SCOPE(vm__) \
+    JSC::CatchScope((vm__))
+
+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+
+} // namespace JSC
+
+#endif // CatchScope_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -62,7 +62,9 @@
</span><span class="cx"> 
</span><span class="cx"> #define BEGIN_NO_SET_PC() \
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();      \
</span><del>-    NativeCallFrameTracer tracer(&amp;vm, exec)
</del><ins>+    NativeCallFrameTracer tracer(&amp;vm, exec); \
+    auto throwScope = DECLARE_THROW_SCOPE(vm); \
+    UNUSED_PARAM(throwScope)
</ins><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> #define SET_PC_FOR_STUBS() do { \
</span><span class="lines">@@ -99,10 +101,10 @@
</span><span class="cx"> 
</span><span class="cx"> #define CHECK_EXCEPTION() do {                    \
</span><span class="cx">         doExceptionFuzzingIfEnabled(exec, &quot;CommonSlowPaths&quot;, pc);   \
</span><del>-        if (UNLIKELY(vm.exception())) {           \
-            RETURN_TO_THROW(exec, pc);               \
</del><ins>+        if (UNLIKELY(throwScope.exception())) {   \
+            RETURN_TO_THROW(exec, pc);            \
</ins><span class="cx">             END_IMPL();                           \
</span><del>-        }                                               \
</del><ins>+        }                                         \
</ins><span class="cx">     } while (false)
</span><span class="cx"> 
</span><span class="cx"> #define END() do {                        \
</span><span class="lines">@@ -144,7 +146,7 @@
</span><span class="cx"> #define CALL_CHECK_EXCEPTION(exec, pc) do {                          \
</span><span class="cx">         ExecState* cceExec = (exec);                                 \
</span><span class="cx">         Instruction* ccePC = (pc);                                   \
</span><del>-        if (UNLIKELY(vm.exception()))                                \
</del><ins>+        if (UNLIKELY(throwScope.exception()))                        \
</ins><span class="cx">             CALL_END_IMPL(cceExec, LLInt::callToThrow(cceExec));     \
</span><span class="cx">     } while (false)
</span><span class="cx"> 
</span><span class="lines">@@ -427,7 +429,7 @@
</span><span class="cx">     JSValue left = OP_C(2).jsValue();
</span><span class="cx">     JSValue right = OP_C(3).jsValue();
</span><span class="cx">     double a = left.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     double b = right.toNumber(exec);
</span><span class="cx">     JSValue result = jsNumber(a * b);
</span><span class="lines">@@ -442,7 +444,7 @@
</span><span class="cx">     JSValue left = OP_C(2).jsValue();
</span><span class="cx">     JSValue right = OP_C(3).jsValue();
</span><span class="cx">     double a = left.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     double b = right.toNumber(exec);
</span><span class="cx">     JSValue result = jsNumber(a - b);
</span><span class="lines">@@ -457,10 +459,10 @@
</span><span class="cx">     JSValue left = OP_C(2).jsValue();
</span><span class="cx">     JSValue right = OP_C(3).jsValue();
</span><span class="cx">     double a = left.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     double b = right.toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     JSValue result = jsNumber(a / b);
</span><span class="cx">     RETURN_WITH_PROFILING(result, {
</span><span class="lines">@@ -472,7 +474,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     double a = OP_C(2).jsValue().toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     double b = OP_C(3).jsValue().toNumber(exec);
</span><span class="cx">     RETURN(jsNumber(jsMod(a, b)));
</span><span class="lines">@@ -482,10 +484,10 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     double a = OP_C(2).jsValue().toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     double b = OP_C(3).jsValue().toNumber(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     RETURN(jsNumber(operationMathPow(a, b)));
</span><span class="cx"> }
</span><span class="lines">@@ -494,7 +496,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     int32_t a = OP_C(2).jsValue().toInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     uint32_t b = OP_C(3).jsValue().toUInt32(exec);
</span><span class="cx">     RETURN(jsNumber(a &lt;&lt; (b &amp; 31)));
</span><span class="lines">@@ -504,7 +506,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     int32_t a = OP_C(2).jsValue().toInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     uint32_t b = OP_C(3).jsValue().toUInt32(exec);
</span><span class="cx">     RETURN(jsNumber(a &gt;&gt; (b &amp; 31)));
</span><span class="lines">@@ -514,7 +516,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     uint32_t a = OP_C(2).jsValue().toUInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     uint32_t b = OP_C(3).jsValue().toUInt32(exec);
</span><span class="cx">     RETURN(jsNumber(static_cast&lt;int32_t&gt;(a &gt;&gt; (b &amp; 31))));
</span><span class="lines">@@ -531,7 +533,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     int32_t a = OP_C(2).jsValue().toInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     int32_t b = OP_C(3).jsValue().toInt32(exec);
</span><span class="cx">     RETURN(jsNumber(a &amp; b));
</span><span class="lines">@@ -541,7 +543,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     int32_t a = OP_C(2).jsValue().toInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     int32_t b = OP_C(3).jsValue().toInt32(exec);
</span><span class="cx">     RETURN(jsNumber(a | b));
</span><span class="lines">@@ -551,7 +553,7 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><span class="cx">     int32_t a = OP_C(2).jsValue().toInt32(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         RETURN(JSValue());
</span><span class="cx">     int32_t b = OP_C(3).jsValue().toInt32(exec);
</span><span class="cx">     RETURN(jsNumber(a ^ b));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">         return baseObj-&gt;hasProperty(exec, i);
</span><span class="cx"> 
</span><span class="cx">     auto property = propName.toPropertyKey(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (scope.exception())
</ins><span class="cx">         return false;
</span><span class="cx">     return baseObj-&gt;hasProperty(exec, property);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsExceptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPathsExceptions.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPathsExceptions.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPathsExceptions.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx">     throwException(exec, scope, error);
</span><span class="cx"> #if LLINT_SLOW_PATH_TRACING
</span><del>-    dataLog(&quot;Throwing exception &quot;, vm-&gt;exception(), &quot;.\n&quot;);
</del><ins>+    dataLog(&quot;Throwing exception &quot;, scope.exception(), &quot;.\n&quot;);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCompletioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Completion.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Completion.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/Completion.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -87,16 +87,19 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue evaluate(ExecState* exec, const SourceCode&amp; source, JSValue thisValue, NakedPtr&lt;Exception&gt;&amp; returnedException)
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(exec);
-    RELEASE_ASSERT(exec-&gt;vm().atomicStringTable() == wtfThreadData().atomicStringTable());
-    RELEASE_ASSERT(!exec-&gt;vm().isCollectorBusy());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
+    RELEASE_ASSERT(!vm.isCollectorBusy());
</ins><span class="cx"> 
</span><span class="cx">     CodeProfiling profile(source);
</span><span class="cx"> 
</span><span class="cx">     ProgramExecutable* program = ProgramExecutable::create(exec, source);
</span><ins>+    ASSERT(scope.exception() || program);
</ins><span class="cx">     if (!program) {
</span><del>-        returnedException = exec-&gt;vm().exception();
-        exec-&gt;vm().clearException();
</del><ins>+        returnedException = scope.exception();
+        scope.clearException();
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -105,9 +108,9 @@
</span><span class="cx">     JSObject* thisObj = jsCast&lt;JSObject*&gt;(thisValue.toThis(exec, NotStrictMode));
</span><span class="cx">     JSValue result = exec-&gt;interpreter()-&gt;execute(program, exec, thisObj);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
-        returnedException = exec-&gt;exception();
-        exec-&gt;clearException();
</del><ins>+    if (scope.exception()) {
+        returnedException = scope.exception();
+        scope.clearException();
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -147,9 +150,11 @@
</span><span class="cx"> 
</span><span class="cx"> static JSInternalPromise* rejectPromise(ExecState* exec, JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><del>-    ASSERT(exec-&gt;hadException());
-    JSValue exception = exec-&gt;exception()-&gt;value();
-    exec-&gt;clearException();
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ASSERT(scope.exception());
+    JSValue exception = scope.exception()-&gt;value();
+    scope.clearException();
</ins><span class="cx">     JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx">     deferred-&gt;reject(exec, exception);
</span><span class="cx">     return deferred-&gt;promise();
</span><span class="lines">@@ -176,17 +181,19 @@
</span><span class="cx"> 
</span><span class="cx"> JSInternalPromise* loadAndEvaluateModule(ExecState* exec, const SourceCode&amp; source, JSValue initiator)
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(exec);
-    RELEASE_ASSERT(exec-&gt;vm().atomicStringTable() == wtfThreadData().atomicStringTable());
-    RELEASE_ASSERT(!exec-&gt;vm().isCollectorBusy());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
+    RELEASE_ASSERT(!vm.isCollectorBusy());
</ins><span class="cx"> 
</span><del>-    Symbol* key = createSymbolForEntryPointModule(exec-&gt;vm());
</del><ins>+    Symbol* key = createSymbolForEntryPointModule(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;vmEntryGlobalObject();
</span><span class="cx"> 
</span><span class="cx">     // Insert the given source code to the ModuleLoader registry as the fetched registry entry.
</span><span class="cx">     globalObject-&gt;moduleLoader()-&gt;provide(exec, key, JSModuleLoader::Status::Fetch, source.view().toString());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return rejectPromise(exec, globalObject);
</span><span class="cx"> 
</span><span class="cx">     return loadAndEvaluateModule(lock, exec, globalObject, key, jsUndefined(), initiator);
</span><span class="lines">@@ -213,11 +220,13 @@
</span><span class="cx"> 
</span><span class="cx"> JSInternalPromise* loadModule(ExecState* exec, const SourceCode&amp; source, JSValue initiator)
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(exec);
-    RELEASE_ASSERT(exec-&gt;vm().atomicStringTable() == wtfThreadData().atomicStringTable());
-    RELEASE_ASSERT(!exec-&gt;vm().isCollectorBusy());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    RELEASE_ASSERT(vm.atomicStringTable() == wtfThreadData().atomicStringTable());
+    RELEASE_ASSERT(!vm.isCollectorBusy());
</ins><span class="cx"> 
</span><del>-    Symbol* key = createSymbolForEntryPointModule(exec-&gt;vm());
</del><ins>+    Symbol* key = createSymbolForEntryPointModule(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;vmEntryGlobalObject();
</span><span class="cx"> 
</span><span class="lines">@@ -224,7 +233,7 @@
</span><span class="cx">     // Insert the given source code to the ModuleLoader registry as the fetched registry entry.
</span><span class="cx">     // FIXME: Introduce JSSourceCode object to wrap around this source.
</span><span class="cx">     globalObject-&gt;moduleLoader()-&gt;provide(exec, key, JSModuleLoader::Status::Fetch, source.view().toString());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return rejectPromise(exec, globalObject);
</span><span class="cx"> 
</span><span class="cx">     return loadModule(lock, exec, globalObject, key, jsUndefined(), initiator);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeConsoleObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ConsoleObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ConsoleObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ConsoleObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -196,12 +196,14 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncAssert(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     bool condition = exec-&gt;argument(0).toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (condition)
</span><span class="lines">@@ -225,6 +227,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncProfile(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -236,7 +240,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const String&amp; title(valueToStringWithUndefinedOrNullCheck(exec, exec-&gt;argument(0)));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     client-&gt;profile(exec, title);
</span><span class="lines">@@ -245,6 +249,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncProfileEnd(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -256,7 +262,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const String&amp; title(valueToStringWithUndefinedOrNullCheck(exec, exec-&gt;argument(0)));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     client-&gt;profileEnd(exec, title);
</span><span class="lines">@@ -265,6 +271,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTakeHeapSnapshot(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -276,7 +284,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     const String&amp; title(valueToStringWithUndefinedOrNullCheck(exec, exec-&gt;argument(0)));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     client-&gt;takeHeapSnapshot(exec, title);
</span><span class="lines">@@ -292,6 +300,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTime(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -301,7 +311,7 @@
</span><span class="cx">         title = ASCIILiteral(&quot;default&quot;);
</span><span class="cx">     else {
</span><span class="cx">         title = valueOrDefaultLabelString(exec, exec-&gt;argument(0));
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -311,6 +321,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL consoleProtoFuncTimeEnd(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConsoleClient* client = exec-&gt;lexicalGlobalObject()-&gt;consoleClient();
</span><span class="cx">     if (!client)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -320,7 +332,7 @@
</span><span class="cx">         title =  ASCIILiteral(&quot;default&quot;);
</span><span class="cx">     else {
</span><span class="cx">         title = valueOrDefaultLabelString(exec, exec-&gt;argument(0));
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDateConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -147,6 +147,7 @@
</span><span class="cx"> JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, JSValue newTarget, const ArgList&amp; args)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     int numArgs = args.size();
</span><span class="cx"> 
</span><span class="cx">     double value;
</span><span class="lines">@@ -167,7 +168,7 @@
</span><span class="cx">         value = millisecondsFromComponents(exec, args, WTF::LocalTime);
</span><span class="cx"> 
</span><span class="cx">     Structure* dateStructure = InternalFunction::createSubclassStructure(exec, newTarget, globalObject-&gt;dateStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return DateInstance::create(vm, dateStructure, value);
</span><span class="lines">@@ -202,10 +203,12 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateParse(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     String dateStr = exec-&gt;argument(0).toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    return JSValue::encode(jsNumber(parseDate(exec-&gt;vm(), dateStr)));
</del><ins>+    return JSValue::encode(jsNumber(parseDate(vm, dateStr)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateNow(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeDatePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -603,7 +603,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncToPrimitiveSymbol(ExecState* exec)
</span><span class="cx"> {
</span><del>-    auto scope = DECLARE_THROW_SCOPE(exec-&gt;vm());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     if (!thisValue.isObject())
</span><span class="cx">         return throwVMTypeError(exec, scope, &quot;Date.prototype[Symbol.toPrimitive] expected |this| to be an object.&quot;);
</span><span class="lines">@@ -614,7 +615,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSValue hintValue = exec-&gt;uncheckedArgument(0);
</span><span class="cx">     PreferredPrimitiveType type = toPreferredPrimitiveType(exec, hintValue);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     if (type == NoPreference)
</span><span class="lines">@@ -1123,20 +1124,21 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL dateProtoFuncToJSON(ExecState* exec)
</span><span class="cx"> {
</span><del>-    auto scope = DECLARE_THROW_SCOPE(exec-&gt;vm());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     JSObject* object = jsCast&lt;JSObject*&gt;(thisValue.toThis(exec, NotStrictMode));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx"> 
</span><span class="cx">     JSValue timeValue = object-&gt;toPrimitive(exec, PreferNumber);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     if (timeValue.isNumber() &amp;&amp; !(timeValue.isInt32() || std::isfinite(timeValue.asDouble())))
</span><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx"> 
</span><del>-    JSValue toISOValue = object-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;toISOString);
-    if (exec-&gt;hadException())
</del><ins>+    JSValue toISOValue = object-&gt;get(exec, vm.propertyNames-&gt;toISOString);
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx"> 
</span><span class="cx">     CallData callData;
</span><span class="lines">@@ -1145,7 +1147,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;toISOString is not a function&quot;));
</span><span class="cx"> 
</span><span class="cx">     JSValue result = call(exec, asObject(toISOValue), callType, callData, object, exec-&gt;emptyList());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     if (result.isObject())
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;toISOString did not return a primitive value&quot;));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -50,9 +50,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL Interpreter::constructWithErrorConstructor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue message = exec-&gt;argumentCount() ? exec-&gt;argument(0) : jsUndefined();
</span><span class="cx">     Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), asInternalFunction(exec-&gt;callee())-&gt;globalObject()-&gt;errorStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorInstancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -158,6 +158,7 @@
</span><span class="cx"> String ErrorInstance::sanitizedToString(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue nameValue;
</span><span class="cx">     auto namePropertName = vm.propertyNames-&gt;name;
</span><span class="lines">@@ -177,7 +178,7 @@
</span><span class="cx">         }
</span><span class="cx">         currentObj = obj-&gt;getPrototypeDirect();
</span><span class="cx">     }
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     String nameString;
</span><span class="cx">     if (!nameValue)
</span><span class="lines">@@ -184,7 +185,7 @@
</span><span class="cx">         nameString = ASCIILiteral(&quot;Error&quot;);
</span><span class="cx">     else {
</span><span class="cx">         nameString = nameValue.toString(exec)-&gt;value(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return String();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -193,7 +194,7 @@
</span><span class="cx">     PropertySlot messageSlot(this, PropertySlot::InternalMethodType::VMInquiry);
</span><span class="cx">     if (JSObject::getOwnPropertySlot(this, exec, messagePropertName, messageSlot) &amp;&amp; messageSlot.isValue())
</span><span class="cx">         messageValue = messageSlot.getValue(exec, messagePropertName);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     String messageString;
</span><span class="cx">     if (!messageValue)
</span><span class="lines">@@ -200,7 +201,7 @@
</span><span class="cx">         messageString = String();
</span><span class="cx">     else {
</span><span class="cx">         messageString = messageValue.toString(exec)-&gt;value(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return String();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 3. Let name be the result of calling the [[Get]] internal method of O with argument &quot;name&quot;.
</span><span class="cx">     JSValue name = thisObj-&gt;get(exec, exec-&gt;propertyNames().name);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 4. If name is undefined, then let name be &quot;Error&quot;; else let name be ToString(name).
</span><span class="lines">@@ -94,13 +94,13 @@
</span><span class="cx">         nameString = ASCIILiteral(&quot;Error&quot;);
</span><span class="cx">     else {
</span><span class="cx">         nameString = name.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 5. Let msg be the result of calling the [[Get]] internal method of O with argument &quot;message&quot;.
</span><span class="cx">     JSValue message = thisObj-&gt;get(exec, exec-&gt;propertyNames().message);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // (sic)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">         messageString = String();
</span><span class="cx">     else {
</span><span class="cx">         messageString = message.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionEventLocationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.cpp (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 &quot;config.h&quot;
+#include &quot;ExceptionEventLocation.h&quot;
+
+#include &lt;wtf/PrintStream.h&gt;
+
+namespace WTF {
+    
+void printInternal(PrintStream&amp; out, JSC::ExceptionEventLocation location)
+{
+    out.print(location.functionName, &quot; @ &quot;, location.file, &quot;:&quot;, location.line);
+}
+
+} // namespace WTF
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionEventLocationhfromrev205568trunkSourceJavaScriptCoreruntimeThrowScopeLocationh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.h (from rev 205568, trunk/Source/JavaScriptCore/runtime/ThrowScopeLocation.h) (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionEventLocation.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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.
+ */
+
+#pragma once
+
+namespace JSC {
+
+struct ExceptionEventLocation {
+    ExceptionEventLocation() { }
+    ExceptionEventLocation(const char* functionName, const char* file, unsigned line)
+        : functionName(functionName)
+        , file(file)
+        , line(line)
+    { }
+    
+    const char* functionName { nullptr };
+    const char* file { nullptr };
+    unsigned line { 0 };
+};
+
+} // namespace JSC
+
+namespace WTF {
+    
+class PrintStream;
+
+void printInternal(PrintStream&amp;, JSC::ExceptionEventLocation);
+    
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #ifndef ExceptionHelpers_h
</span><span class="cx"> #define ExceptionHelpers_h
</span><span class="cx"> 
</span><ins>+#include &quot;CatchScope.h&quot;
</ins><span class="cx"> #include &quot;ErrorInstance.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;ThrowScope.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionScopecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/ExceptionScope.cpp (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionScope.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionScope.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 &quot;config.h&quot;
+#include &quot;ExceptionScope.h&quot;
+
+#include &quot;Exception.h&quot;
+
+namespace JSC {
+    
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+ExceptionScope::ExceptionScope(VM&amp; vm, ExceptionEventLocation location)
+    : m_vm(vm)
+    , m_previousScope(vm.m_topExceptionScope)
+    , m_location(location)
+    , m_recursionDepth(m_previousScope ? m_previousScope-&gt;m_recursionDepth + 1 : 0)
+{
+    m_vm.m_topExceptionScope = this;
+}
+
+ExceptionScope::~ExceptionScope()
+{
+    RELEASE_ASSERT(m_vm.m_topExceptionScope);
+    m_vm.m_topExceptionScope = m_previousScope;
+}
+
+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExceptionScopeh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/runtime/ExceptionScope.h (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ExceptionScope.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/runtime/ExceptionScope.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2016 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
+ * 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 ExceptionScope_h
+#define ExceptionScope_h
+
+#include &quot;VM.h&quot;
+
+namespace JSC {
+    
+class Exception;
+    
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+class ExceptionScope {
+public:
+    VM&amp; vm() const { return m_vm; }
+    unsigned recursionDepth() const { return m_recursionDepth; }
+    Exception* exception() { return m_vm.exception(); }
+    
+protected:
+    ExceptionScope(VM&amp;, ExceptionEventLocation);
+    ExceptionScope(const ExceptionScope&amp;) = delete;
+    ExceptionScope(ExceptionScope&amp;&amp;) = default;
+    ~ExceptionScope();
+
+    VM&amp; m_vm;
+    ExceptionScope* m_previousScope;
+    ExceptionEventLocation m_location;
+    unsigned m_recursionDepth;
+};
+    
+#else // not ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+class ExceptionScope {
+public:
+    ALWAYS_INLINE VM&amp; vm() const { return m_vm; }
+    ALWAYS_INLINE Exception* exception() { return m_vm.exception(); }
+
+protected:
+    ALWAYS_INLINE ExceptionScope(VM&amp; vm)
+        : m_vm(vm)
+    { }
+    ExceptionScope(const ExceptionScope&amp;) = delete;
+    ExceptionScope(ExceptionScope&amp;&amp;) = default;
+
+    VM&amp; m_vm;
+};
+    
+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    
+} // namespace JSC
+
+#endif // ExceptionScope_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeFunctionConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Structure* subclassStructure = InternalFunction::createSubclassStructure(exec, newTarget, globalObject-&gt;functionStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return JSFunction::create(vm, function, globalObject-&gt;globalScope(), subclassStructure);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeFunctionPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -160,7 +160,7 @@
</span><span class="cx">     // Else set the length own property of F to 0.
</span><span class="cx">     unsigned length = 0;
</span><span class="cx">     if (targetObject-&gt;hasOwnProperty(exec, exec-&gt;propertyNames().length)) {
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         // a. Let L be the length property of Target minus the length of A.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGenericArgumentsInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -219,6 +219,9 @@
</span><span class="cx"> template&lt;typename Type&gt;
</span><span class="cx"> void GenericArguments&lt;Type&gt;::copyToArguments(ExecState* exec, VirtualRegister firstElementDest, unsigned offset, unsigned length)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     Type* thisObject = static_cast&lt;Type*&gt;(this);
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         if (thisObject-&gt;canAccessIndexQuickly(i + offset))
</span><span class="lines">@@ -225,7 +228,7 @@
</span><span class="cx">             exec-&gt;r(firstElementDest + i) = thisObject-&gt;getIndexQuickly(i + offset);
</span><span class="cx">         else {
</span><span class="cx">             exec-&gt;r(firstElementDest + i) = get(exec, i + offset);
</span><del>-            if (UNLIKELY(exec-&gt;vm().exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGetterSettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/GetterSetter.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -73,15 +73,17 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue callGetter(ExecState* exec, JSValue base, JSValue getterSetter)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // FIXME: Some callers may invoke get() without checking for an exception first.
</span><span class="cx">     // We work around that by checking here.
</span><del>-    if (exec-&gt;hadException())
-        return exec-&gt;exception()-&gt;value();
</del><ins>+    if (UNLIKELY(scope.exception()))
+        return scope.exception()-&gt;value();
</ins><span class="cx"> 
</span><span class="cx">     JSObject* getter = jsCast&lt;GetterSetter*&gt;(getterSetter)-&gt;getter();
</span><span class="cx"> 
</span><span class="cx">     CallData callData;
</span><del>-    CallType callType = getter-&gt;methodTable(exec-&gt;vm())-&gt;getCallData(getter, callData);
</del><ins>+    CallType callType = getter-&gt;methodTable(vm)-&gt;getCallData(getter, callData);
</ins><span class="cx">     return call(exec, getter, callType, callData, base, ArgList());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInspectorInstrumentationObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InspectorInstrumentationObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InspectorInstrumentationObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/InspectorInstrumentationObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -83,9 +83,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL inspectorInstrumentationObjectLog(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue target = exec-&gt;argument(0);
</span><span class="cx">     String value = target.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     dataLog(value, &quot;\n&quot;);
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeInternalFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> {
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // We allow newTarget == JSValue() because the API needs to be able to create classes without having a real JS frame.
</span><span class="cx">     // Since we don't allow subclassing in the API we just treat newTarget == JSValue() as newTarget == exec-&gt;callee()
</span><span class="cx">     ASSERT(!newTarget || newTarget.isConstructor());
</span><span class="lines">@@ -112,13 +113,13 @@
</span><span class="cx"> 
</span><span class="cx">             // Note, Reflect.construct might cause the profile to churn but we don't care.
</span><span class="cx">             JSValue prototypeValue = newTarget.get(exec, exec-&gt;propertyNames().prototype);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return nullptr;
</span><span class="cx">             if (JSObject* prototype = jsDynamicCast&lt;JSObject*&gt;(prototypeValue))
</span><span class="cx">                 return targetFunction-&gt;rareData(vm)-&gt;createInternalFunctionAllocationStructureFromBase(vm, prototype, baseClass);
</span><span class="cx">         } else {
</span><span class="cx">             JSValue prototypeValue = newTarget.get(exec, exec-&gt;propertyNames().prototype);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return nullptr;
</span><span class="cx">             if (JSObject* prototype = jsDynamicCast&lt;JSObject*&gt;(prototypeValue)) {
</span><span class="cx">                 // This only happens if someone Reflect.constructs our builtin constructor with another builtin constructor as the new.target.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlCollatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlCollator.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlCollator.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlCollator.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -162,6 +162,9 @@
</span><span class="cx"> 
</span><span class="cx"> void IntlCollator::initializeCollator(ExecState&amp; state, JSValue locales, JSValue optionsValue)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 10.1.1 InitializeCollator (collator, locales, options) (ECMA-402 2.0)
</span><span class="cx">     // 1. If collator has an [[initializedIntlObject]] internal slot with value true, throw a TypeError exception.
</span><span class="cx">     // 2. Set collator.[[initializedIntlObject]] to true.
</span><span class="lines">@@ -169,7 +172,7 @@
</span><span class="cx">     // 3. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="cx">     auto requestedLocales = canonicalizeLocaleList(state, locales);
</span><span class="cx">     // 4. ReturnIfAbrupt(requestedLocales).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 5. If options is undefined, then
</span><span class="lines">@@ -181,14 +184,14 @@
</span><span class="cx">         // a. Let options be ToObject(options).
</span><span class="cx">         options = optionsValue.toObject(&amp;state);
</span><span class="cx">         // b. ReturnIfAbrupt(options).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 7. Let u be GetOption(options, &quot;usage&quot;, &quot;string&quot;, Â«&quot;sort&quot;, &quot;search&quot;», &quot;sort&quot;).
</span><del>-    String usageString = intlStringOption(state, options, state.vm().propertyNames-&gt;usage, { &quot;sort&quot;, &quot;search&quot; }, &quot;usage must be either \&quot;sort\&quot; or \&quot;search\&quot;&quot;, &quot;sort&quot;);
</del><ins>+    String usageString = intlStringOption(state, options, vm.propertyNames-&gt;usage, { &quot;sort&quot;, &quot;search&quot; }, &quot;usage must be either \&quot;sort\&quot; or \&quot;search\&quot;&quot;, &quot;sort&quot;);
</ins><span class="cx">     // 8. ReturnIfAbrupt(u).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 9. Set collator.[[usage]] to u.
</span><span class="cx">     if (usageString == &quot;sort&quot;)
</span><span class="lines">@@ -212,9 +215,9 @@
</span><span class="cx">     HashMap&lt;String, String&gt; opt;
</span><span class="cx"> 
</span><span class="cx">     // 13. Let matcher be GetOption(options, &quot;localeMatcher&quot;, &quot;string&quot;, Â«&quot;lookup&quot;, &quot;best fit&quot;», &quot;best fit&quot;).
</span><del>-    String matcher = intlStringOption(state, options, state.vm().propertyNames-&gt;localeMatcher, { &quot;lookup&quot;, &quot;best fit&quot; }, &quot;localeMatcher must be either \&quot;lookup\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</del><ins>+    String matcher = intlStringOption(state, options, vm.propertyNames-&gt;localeMatcher, { &quot;lookup&quot;, &quot;best fit&quot; }, &quot;localeMatcher must be either \&quot;lookup\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</ins><span class="cx">     // 14. ReturnIfAbrupt(matcher).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 15. Set opt.[[localeMatcher]] to matcher.
</span><span class="cx">     opt.add(ASCIILiteral(&quot;localeMatcher&quot;), matcher);
</span><span class="lines">@@ -233,8 +236,8 @@
</span><span class="cx">     {
</span><span class="cx">         String numericString;
</span><span class="cx">         bool usesFallback;
</span><del>-        bool numeric = intlBooleanOption(state, options, state.vm().propertyNames-&gt;numeric, usesFallback);
-        if (state.hadException())
</del><ins>+        bool numeric = intlBooleanOption(state, options, vm.propertyNames-&gt;numeric, usesFallback);
+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         if (!usesFallback)
</span><span class="cx">             numericString = ASCIILiteral(numeric ? &quot;true&quot; : &quot;false&quot;);
</span><span class="lines">@@ -241,8 +244,8 @@
</span><span class="cx">         opt.add(ASCIILiteral(&quot;kn&quot;), numericString);
</span><span class="cx">     }
</span><span class="cx">     {
</span><del>-        String caseFirst = intlStringOption(state, options, state.vm().propertyNames-&gt;caseFirst, { &quot;upper&quot;, &quot;lower&quot;, &quot;false&quot; }, &quot;caseFirst must be either \&quot;upper\&quot;, \&quot;lower\&quot;, or \&quot;false\&quot;&quot;, nullptr);
-        if (state.hadException())
</del><ins>+        String caseFirst = intlStringOption(state, options, vm.propertyNames-&gt;caseFirst, { &quot;upper&quot;, &quot;lower&quot;, &quot;false&quot; }, &quot;caseFirst must be either \&quot;upper\&quot;, \&quot;lower\&quot;, or \&quot;false\&quot;&quot;, nullptr);
+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         opt.add(ASCIILiteral(&quot;kf&quot;), caseFirst);
</span><span class="cx">     }
</span><span class="lines">@@ -277,9 +280,9 @@
</span><span class="cx">     m_numeric = (result.get(ASCIILiteral(&quot;kn&quot;)) == &quot;true&quot;);
</span><span class="cx"> 
</span><span class="cx">     // 24. Let s be GetOption(options, &quot;sensitivity&quot;, &quot;string&quot;, Â«&quot;base&quot;, &quot;accent&quot;, &quot;case&quot;, &quot;variant&quot;», undefined).
</span><del>-    String sensitivityString = intlStringOption(state, options, state.vm().propertyNames-&gt;sensitivity, { &quot;base&quot;, &quot;accent&quot;, &quot;case&quot;, &quot;variant&quot; }, &quot;sensitivity must be either \&quot;base\&quot;, \&quot;accent\&quot;, \&quot;case\&quot;, or \&quot;variant\&quot;&quot;, nullptr);
</del><ins>+    String sensitivityString = intlStringOption(state, options, vm.propertyNames-&gt;sensitivity, { &quot;base&quot;, &quot;accent&quot;, &quot;case&quot;, &quot;variant&quot; }, &quot;sensitivity must be either \&quot;base\&quot;, \&quot;accent\&quot;, \&quot;case\&quot;, or \&quot;variant\&quot;&quot;, nullptr);
</ins><span class="cx">     // 25. ReturnIfAbrupt(s).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 26. If s is undefined, then
</span><span class="cx">     // a. If u is &quot;sort&quot;, then let s be &quot;variant&quot;.
</span><span class="lines">@@ -300,11 +303,11 @@
</span><span class="cx"> 
</span><span class="cx">     // 28. Let ip be GetOption(options, &quot;ignorePunctuation&quot;, &quot;boolean&quot;, undefined, false).
</span><span class="cx">     bool usesFallback;
</span><del>-    bool ignorePunctuation = intlBooleanOption(state, options, state.vm().propertyNames-&gt;ignorePunctuation, usesFallback);
</del><ins>+    bool ignorePunctuation = intlBooleanOption(state, options, vm.propertyNames-&gt;ignorePunctuation, usesFallback);
</ins><span class="cx">     if (usesFallback)
</span><span class="cx">         ignorePunctuation = false;
</span><span class="cx">     // 29. ReturnIfAbrupt(ip).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 30. Set collator.[[ignorePunctuation]] to ip.
</span><span class="cx">     m_ignorePunctuation = ignorePunctuation;
</span><span class="lines">@@ -318,11 +321,13 @@
</span><span class="cx"> 
</span><span class="cx"> void IntlCollator::createCollator(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     ASSERT(!m_collator);
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializedCollator) {
</span><span class="cx">         initializeCollator(state, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!state.hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     UErrorCode status = U_ZERO_ERROR;
</span><span class="lines">@@ -416,6 +421,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSObject* IntlCollator::resolvedOptions(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 10.3.5 Intl.Collator.prototype.resolvedOptions() (ECMA-402 2.0)
</span><span class="cx">     // The function returns a new object whose properties and attributes are set as if
</span><span class="cx">     // constructed by an object literal assigning to each of the following properties the
</span><span class="lines">@@ -427,10 +435,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializedCollator) {
</span><span class="cx">         initializeCollator(state, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!state.hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    VM&amp; vm = state.vm();
</del><span class="cx">     JSObject* options = constructEmptyObject(&amp;state);
</span><span class="cx">     options-&gt;putDirect(vm, vm.propertyNames-&gt;locale, jsString(&amp;state, m_locale));
</span><span class="cx">     options-&gt;putDirect(vm, vm.propertyNames-&gt;usage, jsNontrivialString(&amp;state, ASCIILiteral(usageString(m_usage))));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlCollatorConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -83,14 +83,16 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructIntlCollator(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 10.1.2 Intl.Collator ([locales [, options]]) (ECMA-402 2.0)
</span><span class="cx">     // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
</span><span class="cx">     // 2. Let collator be OrdinaryCreateFromConstructor(newTarget, %CollatorPrototype%).
</span><span class="cx">     // 3. ReturnIfAbrupt(collator).
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(state, state-&gt;newTarget(), jsCast&lt;IntlCollatorConstructor*&gt;(state-&gt;callee())-&gt;collatorStructure());
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    IntlCollator* collator = IntlCollator::create(state-&gt;vm(), structure);
</del><ins>+    IntlCollator* collator = IntlCollator::create(vm, structure);
</ins><span class="cx">     ASSERT(collator);
</span><span class="cx"> 
</span><span class="cx">     // 4. Return InitializeCollator(collator, locales, options).
</span><span class="lines">@@ -134,6 +136,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL IntlCollatorConstructorFuncSupportedLocalesOf(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 10.2.2 Intl.Collator.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
</span><span class="cx"> 
</span><span class="cx">     // 1. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="lines">@@ -140,7 +144,7 @@
</span><span class="cx">     Vector&lt;String&gt; requestedLocales = canonicalizeLocaleList(*state, state-&gt;argument(0));
</span><span class="cx"> 
</span><span class="cx">     // 2. ReturnIfAbrupt(requestedLocales).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 3. Return SupportedLocales(%Collator%.[[availableLocales]], requestedLocales, options).
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlCollatorPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlCollatorPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL IntlCollatorFuncCompare(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 10.3.4 Collator Compare Functions (ECMA-402 2.0)
</span><span class="cx">     // 1. Let collator be the this value.
</span><span class="cx">     // 2. Assert: Type(collator) is Object and collator has an [[initializedCollator]] internal slot whose value is true.
</span><span class="lines">@@ -88,13 +90,13 @@
</span><span class="cx">     // 5. Let X be ToString(x).
</span><span class="cx">     JSString* x = state-&gt;argument(0).toString(state);
</span><span class="cx">     // 6. ReturnIfAbrupt(X).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 7. Let Y be ToString(y).
</span><span class="cx">     JSString* y = state-&gt;argument(1).toString(state);
</span><span class="cx">     // 8. ReturnIfAbrupt(Y).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 9. Return CompareStrings(collator, X, Y).
</span><span class="lines">@@ -122,7 +124,7 @@
</span><span class="cx"> 
</span><span class="cx">         // c. Let bc be BoundFunctionCreate(F, Â«this value»).
</span><span class="cx">         boundCompare = JSBoundFunction::create(vm, state, globalObject, targetObject, collator, nullptr, 2, ASCIILiteral(&quot;compare&quot;));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         // d. Set collator.[[boundCompare]] to bc.
</span><span class="cx">         collator-&gt;setBoundCompare(vm, boundCompare);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -215,6 +215,7 @@
</span><span class="cx"> {
</span><span class="cx">     // 12.1.1 ToDateTimeOptions abstract operation (ECMA-402 2.0)
</span><span class="cx">     VM&amp; vm = exec.vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     // 1. If options is undefined, then let options be null, else let options be ToObject(options).
</span><span class="cx">     // 2. ReturnIfAbrupt(options).
</span><span class="lines">@@ -224,7 +225,7 @@
</span><span class="cx">         options = constructEmptyObject(&amp;exec, exec.lexicalGlobalObject()-&gt;nullPrototypeObjectStructure());
</span><span class="cx">     else {
</span><span class="cx">         JSObject* originalToObject = originalOptions.toObject(&amp;exec);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         options = constructEmptyObject(&amp;exec, originalToObject);
</span><span class="cx">     }
</span><span class="lines">@@ -241,25 +242,25 @@
</span><span class="cx">     // iii. ReturnIfAbrupt(value).
</span><span class="cx">     // iv. If value is not undefined, then let needDefaults be false.
</span><span class="cx">     JSValue weekday = options-&gt;get(&amp;exec, vm.propertyNames-&gt;weekday);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!weekday.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="cx"> 
</span><span class="cx">     JSValue year = options-&gt;get(&amp;exec, vm.propertyNames-&gt;year);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!year.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="cx"> 
</span><span class="cx">     JSValue month = options-&gt;get(&amp;exec, vm.propertyNames-&gt;month);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!month.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="cx"> 
</span><span class="cx">     JSValue day = options-&gt;get(&amp;exec, vm.propertyNames-&gt;day);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!day.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="lines">@@ -273,19 +274,19 @@
</span><span class="cx">     // iii. ReturnIfAbrupt(value).
</span><span class="cx">     // iv. If value is not undefined, then let needDefaults be false.
</span><span class="cx">     JSValue hour = options-&gt;get(&amp;exec, vm.propertyNames-&gt;hour);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!hour.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="cx"> 
</span><span class="cx">     JSValue minute = options-&gt;get(&amp;exec, vm.propertyNames-&gt;minute);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!minute.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="cx"> 
</span><span class="cx">     JSValue second = options-&gt;get(&amp;exec, vm.propertyNames-&gt;second);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (!second.isUndefined())
</span><span class="cx">         needDefaults = false;
</span><span class="lines">@@ -299,15 +300,15 @@
</span><span class="cx">         JSString* numeric = jsNontrivialString(&amp;exec, ASCIILiteral(&quot;numeric&quot;));
</span><span class="cx"> 
</span><span class="cx">         options-&gt;putDirect(vm, vm.propertyNames-&gt;year, numeric);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         options-&gt;putDirect(vm, vm.propertyNames-&gt;month, numeric);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         options-&gt;putDirect(vm, vm.propertyNames-&gt;day, numeric);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -428,13 +429,13 @@
</span><span class="cx">     // 3. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="cx">     Vector&lt;String&gt; requestedLocales = canonicalizeLocaleList(exec, locales);
</span><span class="cx">     // 4. ReturnIfAbrupt(requestedLocales),
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 5. Let options be ToDateTimeOptions(options, &quot;any&quot;, &quot;date&quot;).
</span><span class="cx">     JSObject* options = toDateTimeOptionsAnyDate(exec, originalOptions);
</span><span class="cx">     // 6. ReturnIfAbrupt(options).
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 7. Let opt be a new Record.
</span><span class="lines">@@ -443,7 +444,7 @@
</span><span class="cx">     // 8. Let matcher be GetOption(options, &quot;localeMatcher&quot;, &quot;string&quot;, Â«&quot;lookup&quot;, &quot;best fit&quot;», &quot;best fit&quot;).
</span><span class="cx">     String localeMatcher = intlStringOption(exec, options, vm.propertyNames-&gt;localeMatcher, { &quot;lookup&quot;, &quot;best fit&quot; }, &quot;localeMatcher must be either \&quot;lookup\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</span><span class="cx">     // 9. ReturnIfAbrupt(matcher).
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 10. Set opt.[[localeMatcher]] to matcher.
</span><span class="cx">     localeOpt.add(vm.propertyNames-&gt;localeMatcher.string(), localeMatcher);
</span><span class="lines">@@ -472,7 +473,7 @@
</span><span class="cx">     // 17. Let tz be Get(options, &quot;timeZone&quot;).
</span><span class="cx">     JSValue tzValue = options-&gt;get(&amp;exec, vm.propertyNames-&gt;timeZone);
</span><span class="cx">     // 18. ReturnIfAbrupt(tz).
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 19. If tz is not undefined, then
</span><span class="lines">@@ -481,7 +482,7 @@
</span><span class="cx">         // a. Let tz be ToString(tz).
</span><span class="cx">         String originalTz = tzValue.toWTFString(&amp;exec);
</span><span class="cx">         // b. ReturnIfAbrupt(tz).
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         // c. If the result of IsValidTimeZoneName(tz) is false, then i. Throw a RangeError exception.
</span><span class="cx">         // d. Let tz be CanonicalizeTimeZoneName(tz).
</span><span class="lines">@@ -514,7 +515,7 @@
</span><span class="cx">     auto shortLong = { &quot;short&quot;, &quot;long&quot; };
</span><span class="cx"> 
</span><span class="cx">     String weekday = intlStringOption(exec, options, vm.propertyNames-&gt;weekday, narrowShortLong, &quot;weekday must be \&quot;narrow\&quot;, \&quot;short\&quot;, or \&quot;long\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!weekday.isNull()) {
</span><span class="cx">         if (weekday == &quot;narrow&quot;)
</span><span class="lines">@@ -526,7 +527,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String era = intlStringOption(exec, options, vm.propertyNames-&gt;era, narrowShortLong, &quot;era must be \&quot;narrow\&quot;, \&quot;short\&quot;, or \&quot;long\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!era.isNull()) {
</span><span class="cx">         if (era == &quot;narrow&quot;)
</span><span class="lines">@@ -538,7 +539,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String year = intlStringOption(exec, options, vm.propertyNames-&gt;year, twoDigitNumeric, &quot;year must be \&quot;2-digit\&quot; or \&quot;numeric\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!year.isNull()) {
</span><span class="cx">         if (year == &quot;2-digit&quot;)
</span><span class="lines">@@ -548,7 +549,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String month = intlStringOption(exec, options, vm.propertyNames-&gt;month, twoDigitNumericNarrowShortLong, &quot;month must be \&quot;2-digit\&quot;, \&quot;numeric\&quot;, \&quot;narrow\&quot;, \&quot;short\&quot;, or \&quot;long\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!month.isNull()) {
</span><span class="cx">         if (month == &quot;2-digit&quot;)
</span><span class="lines">@@ -564,7 +565,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String day = intlStringOption(exec, options, vm.propertyNames-&gt;day, twoDigitNumeric, &quot;day must be \&quot;2-digit\&quot; or \&quot;numeric\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!day.isNull()) {
</span><span class="cx">         if (day == &quot;2-digit&quot;)
</span><span class="lines">@@ -574,7 +575,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String hour = intlStringOption(exec, options, vm.propertyNames-&gt;hour, twoDigitNumeric, &quot;hour must be \&quot;2-digit\&quot; or \&quot;numeric\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // We need hour12 to make the hour skeleton pattern decision, so do this early.
</span><span class="lines">@@ -582,7 +583,7 @@
</span><span class="cx">     bool isHour12Undefined;
</span><span class="cx">     bool hr12 = intlBooleanOption(exec, options, vm.propertyNames-&gt;hour12, isHour12Undefined);
</span><span class="cx">     // 33. ReturnIfAbrupt(hr12).
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!hour.isNull()) {
</span><span class="lines">@@ -605,7 +606,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String minute = intlStringOption(exec, options, vm.propertyNames-&gt;minute, twoDigitNumeric, &quot;minute must be \&quot;2-digit\&quot; or \&quot;numeric\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!minute.isNull()) {
</span><span class="cx">         if (minute == &quot;2-digit&quot;)
</span><span class="lines">@@ -615,7 +616,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String second = intlStringOption(exec, options, vm.propertyNames-&gt;second, twoDigitNumeric, &quot;second must be \&quot;2-digit\&quot; or \&quot;numeric\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!second.isNull()) {
</span><span class="cx">         if (second == &quot;2-digit&quot;)
</span><span class="lines">@@ -625,7 +626,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String timeZoneName = intlStringOption(exec, options, vm.propertyNames-&gt;timeZoneName, shortLong, &quot;timeZoneName must be \&quot;short\&quot; or \&quot;long\&quot;&quot;, nullptr);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (!timeZoneName.isNull()) {
</span><span class="cx">         if (timeZoneName == &quot;short&quot;)
</span><span class="lines">@@ -639,7 +640,7 @@
</span><span class="cx">     // 26. Let matcher be GetOption(options, &quot;formatMatcher&quot;, &quot;string&quot;, Â«&quot;basic&quot;, &quot;best fit&quot;», &quot;best fit&quot;).
</span><span class="cx">     intlStringOption(exec, options, vm.propertyNames-&gt;formatMatcher, { &quot;basic&quot;, &quot;best fit&quot; }, &quot;formatMatcher must be either \&quot;basic\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</span><span class="cx">     // 27. ReturnIfAbrupt(matcher).
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Always use ICU date format generator, rather than our own pattern list and matcher.
</span><span class="lines">@@ -834,15 +835,17 @@
</span><span class="cx"> 
</span><span class="cx"> JSObject* IntlDateTimeFormat::resolvedOptions(ExecState&amp; exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 12.3.5 Intl.DateTimeFormat.prototype.resolvedOptions() (ECMA-402 2.0)
</span><span class="cx">     // The function returns a new object whose properties and attributes are set as if constructed by an object literal assigning to each of the following properties the value of the corresponding internal slot of this DateTimeFormat object (see 12.4): locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day, hour, minute, second, and timeZoneName. Properties whose corresponding internal slots are not present are not assigned.
</span><span class="cx">     // Note: In this version of the ECMAScript 2015 Internationalization API, the timeZone property will be the name of the default time zone if no timeZone property was provided in the options object provided to the Intl.DateTimeFormat constructor. The previous version left the timeZone property undefined in this case.
</span><span class="cx">     if (!m_initializedDateTimeFormat) {
</span><span class="cx">         initializeDateTimeFormat(exec, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!exec.hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec.vm();
</del><span class="cx">     JSObject* options = constructEmptyObject(&amp;exec);
</span><span class="cx">     options-&gt;putDirect(vm, vm.propertyNames-&gt;locale, jsNontrivialString(&amp;exec, m_locale));
</span><span class="cx">     options-&gt;putDirect(vm, vm.propertyNames-&gt;calendar, jsNontrivialString(&amp;exec, m_calendar));
</span><span class="lines">@@ -889,7 +892,7 @@
</span><span class="cx">     // 12.3.4 FormatDateTime abstract operation (ECMA-402 2.0)
</span><span class="cx">     if (!m_initializedDateTimeFormat) {
</span><span class="cx">         initializeDateTimeFormat(exec, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!exec.hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 1. If x is not a finite Number, then throw a RangeError exception.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -83,14 +83,16 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructIntlDateTimeFormat(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 12.1.2 Intl.DateTimeFormat ([locales [, options]]) (ECMA-402 2.0)
</span><span class="cx">     // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
</span><span class="cx">     // 2. Let dateTimeFormat be OrdinaryCreateFromConstructor(newTarget, %DateTimeFormatPrototype%).
</span><span class="cx">     // 3. ReturnIfAbrupt(dateTimeFormat).
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(state, state-&gt;newTarget(), jsCast&lt;IntlDateTimeFormatConstructor*&gt;(state-&gt;callee())-&gt;dateTimeFormatStructure());
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(state-&gt;vm(), structure);
</del><ins>+    IntlDateTimeFormat* dateTimeFormat = IntlDateTimeFormat::create(vm, structure);
</ins><span class="cx">     ASSERT(dateTimeFormat);
</span><span class="cx"> 
</span><span class="cx">     // 4. Return InitializeDateTimeFormat(dateTimeFormat, locales, options).
</span><span class="lines">@@ -134,6 +136,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatConstructorFuncSupportedLocalesOf(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 12.2.2 Intl.DateTimeFormat.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
</span><span class="cx"> 
</span><span class="cx">     // 1. Let availableLocales be %DateTimeFormat%.[[availableLocales]].
</span><span class="lines">@@ -142,7 +146,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 2. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="cx">     Vector&lt;String&gt; requestedLocales = canonicalizeLocaleList(*state, state-&gt;argument(0));
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 3. Return SupportedLocales(availableLocales, requestedLocales, options).
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlDateTimeFormatPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlDateTimeFormatPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL IntlDateTimeFormatFuncFormatDateTime(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 12.3.4 DateTime Format Functions (ECMA-402 2.0)
</span><span class="cx">     // 1. Let dtf be the this value.
</span><span class="cx">     // 2. Assert: Type(dtf) is Object and dtf has an [[initializedDateTimeFormat]] internal slot whose value is true.
</span><span class="lines">@@ -99,7 +101,7 @@
</span><span class="cx">         // a. Let x be ToNumber(date).
</span><span class="cx">         value = date.toNumber(state);
</span><span class="cx">         // b. ReturnIfAbrupt(x).
</span><del>-        if (state-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx">         // c. Let bf be BoundFunctionCreate(F, Â«this value»).
</span><span class="cx">         boundFormat = JSBoundFunction::create(vm, state, globalObject, targetObject, dtf, boundArgs, 1, ASCIILiteral(&quot;format&quot;));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         // d. Set dtf.[[boundFormat]] to bf.
</span><span class="cx">         dtf-&gt;setBoundFormat(vm, boundFormat);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlNumberFormatcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">     // 3. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="cx">     auto requestedLocales = canonicalizeLocaleList(state, locales);
</span><span class="cx">     // 4. ReturnIfAbrupt(requestedLocales).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 5. If options is undefined, then
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">         // a. Let options be ToObject(options).
</span><span class="cx">         options = optionsValue.toObject(&amp;state);
</span><span class="cx">         // b. ReturnIfAbrupt(options).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">     // 8. Let matcher be GetOption(options, &quot;localeMatcher&quot;, &quot;string&quot;, Â«&quot;lookup&quot;, &quot;best fit&quot;», &quot;best fit&quot;).
</span><span class="cx">     String matcher = intlStringOption(state, options, vm.propertyNames-&gt;localeMatcher, { &quot;lookup&quot;, &quot;best fit&quot; }, &quot;localeMatcher must be either \&quot;lookup\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</span><span class="cx">     // 9. ReturnIfAbrupt(matcher).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 10. Set opt.[[localeMatcher]] to matcher.
</span><span class="cx">     opt.add(ASCIILiteral(&quot;localeMatcher&quot;), matcher);
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx">     // 16. Let s be GetOption(options, &quot;style&quot;, &quot;string&quot;, Â« &quot;decimal&quot;, &quot;percent&quot;, &quot;currency&quot;», &quot;decimal&quot;).
</span><span class="cx">     String styleString = intlStringOption(state, options, Identifier::fromString(&amp;vm, &quot;style&quot;), { &quot;decimal&quot;, &quot;percent&quot;, &quot;currency&quot; }, &quot;style must be either \&quot;decimal\&quot;, \&quot;percent\&quot;, or \&quot;currency\&quot;&quot;, &quot;decimal&quot;);
</span><span class="cx">     // 17. ReturnIfAbrupt(s).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 18. Set numberFormat.[[style]] to s.
</span><span class="cx">     if (styleString == &quot;decimal&quot;)
</span><span class="lines">@@ -222,7 +222,7 @@
</span><span class="cx">     // 19. Let c be GetOption(options, &quot;currency&quot;, &quot;string&quot;, undefined, undefined).
</span><span class="cx">     String currency = intlStringOption(state, options, Identifier::fromString(&amp;vm, &quot;currency&quot;), { }, nullptr, nullptr);
</span><span class="cx">     // 20. ReturnIfAbrupt(c).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 21. If c is not undefined, then
</span><span class="cx">     if (!currency.isNull()) {
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">     // 24. Let cd be GetOption(options, &quot;currencyDisplay&quot;, &quot;string&quot;, Â«&quot;code&quot;, &quot;symbol&quot;, &quot;name&quot;», &quot;symbol&quot;).
</span><span class="cx">     String currencyDisplayString = intlStringOption(state, options, Identifier::fromString(&amp;vm, &quot;currencyDisplay&quot;), { &quot;code&quot;, &quot;symbol&quot;, &quot;name&quot; }, &quot;currencyDisplay must be either \&quot;code\&quot;, \&quot;symbol\&quot;, or \&quot;name\&quot;&quot;, &quot;symbol&quot;);
</span><span class="cx">     // 25. ReturnIfAbrupt(cd).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 26. If s is &quot;currency&quot;, set numberFormat.[[currencyDisplay]] to cd.
</span><span class="cx">     if (m_style == Style::Currency) {
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx">     // 28. ReturnIfAbrupt(mnid).
</span><span class="cx">     // 29. Set numberFormat.[[minimumIntegerDigits]] to mnid.
</span><span class="cx">     unsigned minimumIntegerDigits = intlNumberOption(state, options, Identifier::fromString(&amp;vm, &quot;minimumIntegerDigits&quot;), 1, 21, 1);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     m_minimumIntegerDigits = minimumIntegerDigits;
</span><span class="cx"> 
</span><span class="lines">@@ -282,7 +282,7 @@
</span><span class="cx">     // 32. ReturnIfAbrupt(mnfd).
</span><span class="cx">     // 33. Set numberFormat.[[minimumFractionDigits]] to mnfd.
</span><span class="cx">     unsigned minimumFractionDigits = intlNumberOption(state, options, Identifier::fromString(&amp;vm, &quot;minimumFractionDigits&quot;), 0, 20, minimumFractionDigitsDefault);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     m_minimumFractionDigits = minimumFractionDigits;
</span><span class="cx"> 
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx">     // 36. ReturnIfAbrupt(mxfd).
</span><span class="cx">     // 37. Set numberFormat.[[maximumFractionDigits]] to mxfd.
</span><span class="cx">     unsigned maximumFractionDigits = intlNumberOption(state, options, Identifier::fromString(&amp;vm, &quot;maximumFractionDigits&quot;), minimumFractionDigits, 20, maximumFractionDigitsDefault);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     m_maximumFractionDigits = maximumFractionDigits;
</span><span class="cx"> 
</span><span class="lines">@@ -306,13 +306,13 @@
</span><span class="cx">     // 38. Let mnsd be Get(options, &quot;minimumSignificantDigits&quot;).
</span><span class="cx">     JSValue minimumSignificantDigitsValue = options-&gt;get(&amp;state, Identifier::fromString(&amp;vm, &quot;minimumSignificantDigits&quot;));
</span><span class="cx">     // 39. ReturnIfAbrupt(mnsd).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 40. Let mxsd be Get(options, &quot;maximumSignificantDigits&quot;).
</span><span class="cx">     JSValue maximumSignificantDigitsValue = options-&gt;get(&amp;state, Identifier::fromString(&amp;vm, &quot;maximumSignificantDigits&quot;));
</span><span class="cx">     // 41. ReturnIfAbrupt(mxsd).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // 42. If mnsd is not undefined or mxsd is not undefined, then
</span><span class="lines">@@ -320,12 +320,12 @@
</span><span class="cx">         // a. Let mnsd be GetNumberOption(options, &quot;minimumSignificantDigits&quot;, 1, 21, 1).
</span><span class="cx">         unsigned minimumSignificantDigits = intlNumberOption(state, options, Identifier::fromString(&amp;vm, &quot;minimumSignificantDigits&quot;), 1, 21, 1);
</span><span class="cx">         // b. ReturnIfAbrupt(mnsd).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         // c. Let mxsd be GetNumberOption(options, &quot;maximumSignificantDigits&quot;, mnsd, 21, 21).
</span><span class="cx">         unsigned maximumSignificantDigits = intlNumberOption(state, options, Identifier::fromString(&amp;vm, &quot;maximumSignificantDigits&quot;), minimumSignificantDigits, 21, 21);
</span><span class="cx">         // d. ReturnIfAbrupt(mxsd).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         // e. Set numberFormat.[[minimumSignificantDigits]] to mnsd.
</span><span class="cx">         m_minimumSignificantDigits = minimumSignificantDigits;
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx">     if (usesFallback)
</span><span class="cx">         useGrouping = true;
</span><span class="cx">     // 44. ReturnIfAbrupt(g).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     // 45. Set numberFormat.[[useGrouping]] to g.
</span><span class="cx">     m_useGrouping = useGrouping;
</span><span class="lines">@@ -361,11 +361,14 @@
</span><span class="cx"> 
</span><span class="cx"> void IntlNumberFormat::createNumberFormat(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ASSERT(!m_numberFormat);
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializedNumberFormat) {
</span><span class="cx">         initializeNumberFormat(state, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!state.hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     UNumberFormatStyle style;
</span><span class="lines">@@ -479,6 +482,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSObject* IntlNumberFormat::resolvedOptions(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 11.3.5 Intl.NumberFormat.prototype.resolvedOptions() (ECMA-402 2.0)
</span><span class="cx">     // The function returns a new object whose properties and attributes are set as if
</span><span class="cx">     // constructed by an object literal assigning to each of the following properties the
</span><span class="lines">@@ -490,10 +496,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_initializedNumberFormat) {
</span><span class="cx">         initializeNumberFormat(state, jsUndefined(), jsUndefined());
</span><del>-        ASSERT(!state.hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    VM&amp; vm = state.vm();
</del><span class="cx">     JSObject* options = constructEmptyObject(&amp;state);
</span><span class="cx">     options-&gt;putDirect(vm, vm.propertyNames-&gt;locale, jsString(&amp;state, m_locale));
</span><span class="cx">     options-&gt;putDirect(vm, Identifier::fromString(&amp;vm, &quot;numberingSystem&quot;), jsString(&amp;state, m_numberingSystem));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlNumberFormatConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -83,14 +83,16 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructIntlNumberFormat(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 11.1.2 Intl.NumberFormat ([locales [, options]]) (ECMA-402 2.0)
</span><span class="cx">     // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.
</span><span class="cx">     // 2. Let numberFormat be OrdinaryCreateFromConstructor(newTarget, %NumberFormatPrototype%).
</span><span class="cx">     // 3. ReturnIfAbrupt(numberFormat).
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(state, state-&gt;newTarget(), jsCast&lt;IntlNumberFormatConstructor*&gt;(state-&gt;callee())-&gt;numberFormatStructure());
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><del>-    IntlNumberFormat* numberFormat = IntlNumberFormat::create(state-&gt;vm(), structure);
</del><ins>+    IntlNumberFormat* numberFormat = IntlNumberFormat::create(vm, structure);
</ins><span class="cx">     ASSERT(numberFormat);
</span><span class="cx"> 
</span><span class="cx">     // 4. Return InitializeNumberFormat(numberFormat, locales, options).
</span><span class="lines">@@ -134,6 +136,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL IntlNumberFormatConstructorFuncSupportedLocalesOf(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 11.2.2 Intl.NumberFormat.supportedLocalesOf(locales [, options]) (ECMA-402 2.0)
</span><span class="cx"> 
</span><span class="cx">     // 1. Let availableLocales be %NumberFormat%.[[availableLocales]].
</span><span class="lines">@@ -142,7 +146,7 @@
</span><span class="cx"> 
</span><span class="cx">     // 2. Let requestedLocales be CanonicalizeLocaleList(locales).
</span><span class="cx">     Vector&lt;String&gt; requestedLocales = canonicalizeLocaleList(*state, state-&gt;argument(0));
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 3. Return SupportedLocales(availableLocales, requestedLocales, options).
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlNumberFormatPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlNumberFormatPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL IntlNumberFormatFuncFormatNumber(ExecState* state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 11.3.4 Format Number Functions (ECMA-402 2.0)
</span><span class="cx">     // 1. Let nf be the this value.
</span><span class="cx">     // 2. Assert: Type(nf) is Object and nf has an [[initializedNumberFormat]] internal slot whose value  true.
</span><span class="lines">@@ -89,7 +91,7 @@
</span><span class="cx">     // 4. Let x be ToNumber(value).
</span><span class="cx">     double number = state-&gt;argument(0).toNumber(state);
</span><span class="cx">     // 5. ReturnIfAbrupt(x).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 6. Return FormatNumber(nf, x).
</span><span class="lines">@@ -126,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">         // c. Let bf be BoundFunctionCreate(F, Â«this value»).
</span><span class="cx">         boundFormat = JSBoundFunction::create(vm, state, globalObject, targetObject, nf, boundArgs, 1, ASCIILiteral(&quot;format&quot;));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         // d. Set nf.[[boundFormat]] to bf.
</span><span class="cx">         nf-&gt;setBoundFormat(vm, boundFormat);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -124,6 +124,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool intlBooleanOption(ExecState&amp; state, JSValue options, PropertyName property, bool&amp; usesFallback)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 9.2.9 GetOption (options, property, type, values, fallback)
</span><span class="cx">     // For type=&quot;boolean&quot;. values is always undefined.
</span><span class="cx"> 
</span><span class="lines">@@ -131,7 +134,7 @@
</span><span class="cx">     JSObject* opts = options.toObject(&amp;state);
</span><span class="cx"> 
</span><span class="cx">     // 2. ReturnIfAbrupt(opts).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // 3. Let value be Get(opts, property).
</span><span class="lines">@@ -138,7 +141,7 @@
</span><span class="cx">     JSValue value = opts-&gt;get(&amp;state, property);
</span><span class="cx"> 
</span><span class="cx">     // 4. ReturnIfAbrupt(value).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // 5. If value is not undefined, then
</span><span class="lines">@@ -173,7 +176,7 @@
</span><span class="cx">     JSObject* opts = options.toObject(&amp;state);
</span><span class="cx"> 
</span><span class="cx">     // 2. ReturnIfAbrupt(opts).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     // 3. Let value be Get(opts, property).
</span><span class="lines">@@ -180,7 +183,7 @@
</span><span class="cx">     JSValue value = opts-&gt;get(&amp;state, property);
</span><span class="cx"> 
</span><span class="cx">     // 4. ReturnIfAbrupt(value).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     // 5. If value is not undefined, then
</span><span class="lines">@@ -193,7 +196,7 @@
</span><span class="cx">         String stringValue = value.toWTFString(&amp;state);
</span><span class="cx"> 
</span><span class="cx">         // ii. ReturnIfAbrupt(value).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return { };
</span><span class="cx"> 
</span><span class="cx">         // d. If values is not undefined, then
</span><span class="lines">@@ -221,7 +224,7 @@
</span><span class="cx">     JSObject* opts = options.toObject(&amp;state);
</span><span class="cx"> 
</span><span class="cx">     // 2. ReturnIfAbrupt(opts).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     // 3. Let value be Get(opts, property).
</span><span class="lines">@@ -228,7 +231,7 @@
</span><span class="cx">     JSValue value = opts-&gt;get(&amp;state, property);
</span><span class="cx"> 
</span><span class="cx">     // 4. ReturnIfAbrupt(value).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     // 5. If value is not undefined, then
</span><span class="lines">@@ -236,7 +239,7 @@
</span><span class="cx">         // a. Let value be ToNumber(value).
</span><span class="cx">         double doubleValue = value.toNumber(&amp;state);
</span><span class="cx">         // b. ReturnIfAbrupt(value).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return 0;
</span><span class="cx">         // 1. If value is NaN or less than minimum or greater than maximum, throw a RangeError exception.
</span><span class="cx">         if (!(doubleValue &gt;= minimum &amp;&amp; doubleValue &lt;= maximum)) {
</span><span class="lines">@@ -557,16 +560,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 5. ReturnIfAbrupt(O).
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">     // 6. Let len be ToLength(Get(O, &quot;length&quot;)).
</span><span class="cx">     JSValue lengthProperty = localesObject-&gt;get(&amp;state, vm.propertyNames-&gt;length);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">     double length = lengthProperty.toLength(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">     // Keep track of locales that have been added to the list.
</span><span class="lines">@@ -582,7 +585,7 @@
</span><span class="cx">         bool kPresent = localesObject-&gt;hasProperty(&amp;state, k);
</span><span class="cx"> 
</span><span class="cx">         // c. ReturnIfAbrupt(kPresent).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">         // d. If kPresent is true, then
</span><span class="lines">@@ -591,7 +594,7 @@
</span><span class="cx">             JSValue kValue = localesObject-&gt;get(&amp;state, k);
</span><span class="cx"> 
</span><span class="cx">             // ii. ReturnIfAbrupt(kValue).
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">             // iii. If Type(kValue) is not String or Object, throw a TypeError exception.
</span><span class="lines">@@ -604,7 +607,7 @@
</span><span class="cx">             JSString* tag = kValue.toString(&amp;state);
</span><span class="cx"> 
</span><span class="cx">             // v. ReturnIfAbrupt(tag).
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return Vector&lt;String&gt;();
</span><span class="cx"> 
</span><span class="cx">             // vi. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.
</span><span class="lines">@@ -934,6 +937,7 @@
</span><span class="cx"> {
</span><span class="cx">     // 9.2.8 SupportedLocales (availableLocales, requestedLocales, options)
</span><span class="cx">     VM&amp; vm = state.vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     String matcher;
</span><span class="cx"> 
</span><span class="cx">     // 1. If options is not undefined, then
</span><span class="lines">@@ -941,7 +945,7 @@
</span><span class="cx">         // a. Let matcher be GetOption(options, &quot;localeMatcher&quot;, &quot;string&quot;, Â« &quot;lookup&quot;, &quot;best fit&quot; Â», &quot;best fit&quot;).
</span><span class="cx">         matcher = intlStringOption(state, options, vm.propertyNames-&gt;localeMatcher, { &quot;lookup&quot;, &quot;best fit&quot; }, &quot;localeMatcher must be either \&quot;lookup\&quot; or \&quot;best fit\&quot;&quot;, &quot;best fit&quot;);
</span><span class="cx">         // b. ReturnIfAbrupt(matcher).
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     } else {
</span><span class="cx">         // 2. Else, let matcher be &quot;best fit&quot;.
</span><span class="lines">@@ -961,7 +965,7 @@
</span><span class="cx">         supportedLocales = lookupSupportedLocales(state, availableLocales, requestedLocales);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     // 6. Let subset be CreateArrayFromList(supportedLocales).
</span><span class="lines">@@ -970,7 +974,7 @@
</span><span class="cx">     // 7. Let keys be subset.[[OwnPropertyKeys]]().
</span><span class="cx">     PropertyNameArray keys(&amp;state, PropertyNameMode::Strings);
</span><span class="cx">     supportedLocales-&gt;getOwnPropertyNames(supportedLocales, &amp;state, keys, EnumerationMode());
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor desc;
</span><span class="lines">@@ -987,7 +991,7 @@
</span><span class="cx">         supportedLocales-&gt;defineOwnProperty(supportedLocales, &amp;state, keys[i], desc, true);
</span><span class="cx"> 
</span><span class="cx">         // c. Assert: status is not abrupt completion.
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIntlObjectInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IntlObjectInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IntlObjectInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IntlObjectInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -40,15 +40,17 @@
</span><span class="cx">     // FIXME: Workaround to provide compatibility with ECMA-402 1.0 call/apply patterns.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=153679
</span><span class="cx">     VM&amp; vm = state.vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!jsDynamicCast&lt;IntlInstance*&gt;(thisValue)) {
</span><span class="cx">         JSValue prototype = callee-&gt;getDirect(vm, vm.propertyNames-&gt;prototype);
</span><span class="cx">         if (JSObject::defaultHasInstance(&amp;state, thisValue, prototype)) {
</span><span class="cx">             JSObject* thisObject = thisValue.toObject(&amp;state);
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">             IntlInstance* instance = factory(vm);
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">             thisObject-&gt;putDirect(vm, vm.propertyNames-&gt;builtinNames().intlSubstituteValuePrivateName(), instance);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIteratorOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IteratorOperations.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue nextFunction = iterator.get(exec, vm.propertyNames-&gt;next);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     CallData nextFunctionCallData;
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     if (!value.isEmpty())
</span><span class="cx">         nextFunctionArguments.append(value);
</span><span class="cx">     JSValue result = call(exec, nextFunction, nextFunctionCallType, nextFunctionCallData, iterator, nextFunctionArguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!result.isObject())
</span><span class="lines">@@ -80,11 +80,14 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue iteratorStep(ExecState* exec, JSValue iterator)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue result = iteratorNext(exec, iterator);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     bool done = iteratorComplete(exec, result);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     if (done)
</span><span class="cx">         return jsBoolean(false);
</span><span class="lines">@@ -94,20 +97,21 @@
</span><span class="cx"> void iteratorClose(ExecState* exec, JSValue iterator)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><del>-    auto scope = DECLARE_THROW_SCOPE(vm);
</del><ins>+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+    auto catchScope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     Exception* exception = nullptr;
</span><del>-    if (exec-&gt;hadException()) {
-        exception = exec-&gt;exception();
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(catchScope.exception())) {
+        exception = catchScope.exception();
+        catchScope.clearException();
</ins><span class="cx">     }
</span><span class="cx">     JSValue returnFunction = iterator.get(exec, vm.propertyNames-&gt;returnKeyword);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (returnFunction.isUndefined()) {
</span><span class="cx">         if (exception)
</span><del>-            throwException(exec, scope, exception);
</del><ins>+            throwException(exec, throwScope, exception);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -115,9 +119,9 @@
</span><span class="cx">     CallType returnFunctionCallType = getCallData(returnFunction, returnFunctionCallData);
</span><span class="cx">     if (returnFunctionCallType == CallType::None) {
</span><span class="cx">         if (exception)
</span><del>-            throwException(exec, scope, exception);
</del><ins>+            throwException(exec, throwScope, exception);
</ins><span class="cx">         else
</span><del>-            throwTypeError(exec, scope);
</del><ins>+            throwTypeError(exec, throwScope);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -125,15 +129,15 @@
</span><span class="cx">     JSValue innerResult = call(exec, returnFunction, returnFunctionCallType, returnFunctionCallData, iterator, returnFunctionArguments);
</span><span class="cx"> 
</span><span class="cx">     if (exception) {
</span><del>-        throwException(exec, scope, exception);
</del><ins>+        throwException(exec, throwScope, exception);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!innerResult.isObject()) {
</span><del>-        throwTypeError(exec, scope, ASCIILiteral(&quot;Iterator result interface is not an object.&quot;));
</del><ins>+        throwTypeError(exec, throwScope, ASCIILiteral(&quot;Iterator result interface is not an object.&quot;));
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -167,7 +171,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">     
</span><span class="cx">     JSValue iteratorFunction = iterable.get(state, state-&gt;propertyNames().iteratorSymbol);
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx">     
</span><span class="cx">     CallData iteratorFunctionCallData;
</span><span class="lines">@@ -179,7 +183,7 @@
</span><span class="cx"> 
</span><span class="cx">     ArgList iteratorFunctionArguments;
</span><span class="cx">     JSValue iterator = call(state, iteratorFunction, iteratorFunctionCallType, iteratorFunctionCallData, iterable, iteratorFunctionArguments);
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     if (!iterator.isObject()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeIteratorOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/IteratorOperations.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/IteratorOperations.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/IteratorOperations.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><ins>+#include &quot;ThrowScope.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -47,20 +48,22 @@
</span><span class="cx"> void forEachInIterable(ExecState* state, JSValue iterable, const CallBackType&amp; callback)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; vm = state-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue iterator = iteratorForIterable(state, iterable);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     while (true) {
</span><span class="cx">         JSValue next = iteratorStep(state, iterator);
</span><del>-        if (next.isFalse() || vm.exception())
</del><ins>+        if (next.isFalse() || UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         JSValue nextValue = iteratorValue(state, next);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         callback(vm, state, nextValue);
</span><del>-        if (vm.exception()) {
</del><ins>+        if (UNLIKELY(scope.exception())) {
</ins><span class="cx">             iteratorClose(state, iterator);
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArray.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArray.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSArray.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -654,7 +654,7 @@
</span><span class="cx">     unsigned index = getArrayLength() - 1;
</span><span class="cx">     // Let element be the result of calling the [[Get]] internal method of O with argument indx.
</span><span class="cx">     JSValue element = get(exec, index);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     // Call the [[Delete]] internal method of O with arguments indx and true.
</span><span class="cx">     if (!deletePropertyByIndex(this, exec, index)) {
</span><span class="lines">@@ -706,7 +706,7 @@
</span><span class="cx">         
</span><span class="cx">         if (length &gt; MAX_ARRAY_INDEX) {
</span><span class="cx">             methodTable(vm)-&gt;putByIndex(this, exec, length, value, true);
</span><del>-            if (!exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwException(exec, scope, createRangeError(exec, ASCIILiteral(&quot;Invalid array length&quot;)));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -726,7 +726,7 @@
</span><span class="cx">         
</span><span class="cx">         if (length &gt; MAX_ARRAY_INDEX) {
</span><span class="cx">             methodTable(vm)-&gt;putByIndex(this, exec, length, value, true);
</span><del>-            if (!exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwException(exec, scope, createRangeError(exec, ASCIILiteral(&quot;Invalid array length&quot;)));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -758,7 +758,7 @@
</span><span class="cx">         
</span><span class="cx">         if (length &gt; MAX_ARRAY_INDEX) {
</span><span class="cx">             methodTable(vm)-&gt;putByIndex(this, exec, length, value, true);
</span><del>-            if (!exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwException(exec, scope, createRangeError(exec, ASCIILiteral(&quot;Invalid array length&quot;)));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -771,7 +771,7 @@
</span><span class="cx">         unsigned oldLength = length();
</span><span class="cx">         bool putResult = false;
</span><span class="cx">         if (attemptToInterceptPutByIndexOnHole(exec, oldLength, value, true, putResult)) {
</span><del>-            if (!exec-&gt;hadException() &amp;&amp; oldLength &lt; 0xFFFFFFFFu)
</del><ins>+            if (!scope.exception() &amp;&amp; oldLength &lt; 0xFFFFFFFFu)
</ins><span class="cx">                 setLength(exec, oldLength + 1, true);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -794,7 +794,7 @@
</span><span class="cx">         if (storage-&gt;length() &gt; MAX_ARRAY_INDEX) {
</span><span class="cx">             methodTable(vm)-&gt;putByIndex(this, exec, storage-&gt;length(), value, true);
</span><span class="cx">             // Per ES5.1 15.4.4.7 step 6 &amp; 15.4.5.1 step 3.d.
</span><del>-            if (!exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwException(exec, scope, createRangeError(exec, ASCIILiteral(&quot;Invalid array length&quot;)));
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -1257,6 +1257,9 @@
</span><span class="cx"> 
</span><span class="cx"> void JSArray::copyToArguments(ExecState* exec, VirtualRegister firstElementDest, unsigned offset, unsigned length)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     unsigned i = offset;
</span><span class="cx">     WriteBarrier&lt;Unknown&gt;* vector;
</span><span class="cx">     unsigned vectorEnd;
</span><span class="lines">@@ -1321,7 +1324,7 @@
</span><span class="cx">     
</span><span class="cx">     for (; i &lt; length; ++i) {
</span><span class="cx">         exec-&gt;r(firstElementDest + i - offset) = get(exec, i);
</span><del>-        if (UNLIKELY(exec-&gt;vm().exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     unsigned length;
</span><span class="cx">     if (exec-&gt;argumentCount()) {
</span><span class="cx">         length = exec-&gt;uncheckedArgument(0).toUInt32(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     } else {
</span><span class="cx">         // Although the documentation doesn't say so, it is in fact correct to say
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">         return JSValue::encode(throwOutOfMemoryError(exec, scope));
</span><span class="cx"> 
</span><span class="cx">     Structure* arrayBufferStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), constructor-&gt;globalObject()-&gt;arrayBufferStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     JSArrayBuffer* result = JSArrayBuffer::create(vm, arrayBufferStructure, WTFMove(buffer));
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayBufferPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -50,13 +50,13 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Slice requires at least one argument.&quot;));
</span><span class="cx">     
</span><span class="cx">     int32_t begin = exec-&gt;argument(0).toInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     
</span><span class="cx">     int32_t end;
</span><span class="cx">     if (exec-&gt;argumentCount() &gt;= 2) {
</span><span class="cx">         end = exec-&gt;uncheckedArgument(1).toInt32(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     } else
</span><span class="cx">         end = thisObject-&gt;impl()-&gt;byteLength();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSArrayInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -70,12 +70,13 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE unsigned getLength(ExecState* exec, JSObject* obj)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (isJSArray(obj))
</span><span class="cx">         return jsCast&lt;JSArray*&gt;(obj)-&gt;length();
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     JSValue lengthValue = obj-&gt;get(exec, vm.propertyNames-&gt;length);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return UINT_MAX;
</span><span class="cx">     return lengthValue.toUInt32(exec);
</span><span class="cx"> }
</span><span class="lines">@@ -82,12 +83,13 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE double toLength(ExecState* exec, JSObject* obj)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (isJSArray(obj))
</span><span class="cx">         return jsCast&lt;JSArray*&gt;(obj)-&gt;length();
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     JSValue lengthValue = obj-&gt;get(exec, vm.propertyNames-&gt;length);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return PNaN;
</span><span class="cx">     return lengthValue.toLength(exec);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSBoundFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -126,8 +126,9 @@
</span><span class="cx"> 
</span><span class="cx"> inline Structure* getBoundFunctionStructure(VM&amp; vm, ExecState* exec, JSGlobalObject* globalObject, JSObject* targetFunction)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue prototype = targetFunction-&gt;getPrototype(vm, exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     JSFunction* targetJSFunction = jsDynamicCast&lt;JSFunction*&gt;(targetFunction);
</span><span class="cx"> 
</span><span class="lines">@@ -158,6 +159,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSBoundFunction* JSBoundFunction::create(VM&amp; vm, ExecState* exec, JSGlobalObject* globalObject, JSObject* targetFunction, JSValue boundThis, JSArray* boundArgs, int length, const String&amp; name)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ConstructData constructData;
</span><span class="cx">     ConstructType constructType = JSC::getConstructData(targetFunction, constructData);
</span><span class="cx">     bool canConstruct = constructType != ConstructType::None;
</span><span class="lines">@@ -170,7 +172,7 @@
</span><span class="cx">         canConstruct ? (slowCase ? boundFunctionConstruct : boundThisNoArgsFunctionConstruct) : callHostFunctionAsConstructor,
</span><span class="cx">         name);
</span><span class="cx">     Structure* structure = getBoundFunctionStructure(vm, exec, globalObject, targetFunction);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     JSBoundFunction* function = new (NotNull, allocateCell&lt;JSBoundFunction&gt;(vm.heap)) JSBoundFunction(vm, globalObject, structure, targetFunction, boundThis, boundArgs);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         prototype = obj-&gt;getPrototype(vm, exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (prototype.isNull())
</span><span class="cx">             break;
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx">     
</span><span class="cx">     JSObject* prototype = synthesizePrototype(exec);
</span><span class="cx">     if (UNLIKELY(!prototype)) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><ins>+        ASSERT(scope.exception());
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     bool putResult = false;
</span><span class="lines">@@ -381,11 +381,11 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(isCell());
</span><span class="cx">     JSValue value = asCell()-&gt;toPrimitive(exec, PreferString);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return errorValue();
</span><span class="cx">     ASSERT(!value.isObject());
</span><span class="cx">     JSString* result = value.toString(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return errorValue();
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValueInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -642,7 +642,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     StringImpl* hintString = jsCast&lt;JSString*&gt;(value)-&gt;value(exec).impl();
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return NoPreference;
</span><span class="cx"> 
</span><span class="cx">     if (WTF::equal(hintString, &quot;default&quot;))
</span><span class="lines">@@ -784,8 +784,9 @@
</span><span class="cx"> template&lt;typename CallbackWhenNoException&gt;
</span><span class="cx"> ALWAYS_INLINE typename std::result_of&lt;CallbackWhenNoException(bool, PropertySlot&amp;)&gt;::type JSValue::getPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot, CallbackWhenNoException callback) const
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(exec-&gt;vm());
</ins><span class="cx">     bool found = getPropertySlot(exec, propertyName, slot);
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return { };
</span><span class="cx">     return callback(found, slot);
</span><span class="cx"> }
</span><span class="lines">@@ -897,6 +898,7 @@
</span><span class="cx"> ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     do {
</span><span class="cx">         if (v1.isNumber() &amp;&amp; v2.isNumber())
</span><span class="cx">             return v1.asNumber() == v2.asNumber();
</span><span class="lines">@@ -924,7 +926,7 @@
</span><span class="cx">             if (v2.isObject())
</span><span class="cx">                 return v1 == v2;
</span><span class="cx">             JSValue p1 = v1.toPrimitive(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">             v1 = p1;
</span><span class="cx">             if (v1.isInt32() &amp;&amp; v2.isInt32())
</span><span class="lines">@@ -934,7 +936,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (v2.isObject()) {
</span><span class="cx">             JSValue p2 = v2.toPrimitive(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">             v2 = p2;
</span><span class="cx">             if (v1.isInt32() &amp;&amp; v2.isInt32())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSDataViewPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Need at least one argument (the byteOffset)&quot;));
</span><span class="cx">     
</span><span class="cx">     unsigned byteOffset = exec-&gt;uncheckedArgument(0).toUInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     
</span><span class="cx">     bool littleEndian = false;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">     unsigned elementSize = sizeof(typename Adaptor::Type);
</span><span class="cx">     if (elementSize &gt; 1 &amp;&amp; exec-&gt;argumentCount() &gt;= 2) {
</span><span class="cx">         littleEndian = exec-&gt;uncheckedArgument(1).toBoolean(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Need at least two argument (the byteOffset and value)&quot;));
</span><span class="cx">     
</span><span class="cx">     unsigned byteOffset = exec-&gt;uncheckedArgument(0).toUInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     const unsigned dataSize = sizeof(typename Adaptor::Type);
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx">     } u;
</span><span class="cx"> 
</span><span class="cx">     u.value = toNativeFromValue&lt;Adaptor&gt;(exec, exec-&gt;uncheckedArgument(1));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     
</span><span class="cx">     bool littleEndian = false;
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">     unsigned elementSize = sizeof(typename Adaptor::Type);
</span><span class="cx">     if (elementSize &gt; 1 &amp;&amp; exec-&gt;argumentCount() &gt;= 3) {
</span><span class="cx">         littleEndian = exec-&gt;uncheckedArgument(2).toBoolean(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSFunctioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSFunction.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSFunction.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -592,6 +592,8 @@
</span><span class="cx"> void JSFunction::setFunctionName(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // The &quot;name&quot; property may have been already been defined as part of a property list in an
</span><span class="cx">     // object literal (and therefore reified).
</span><span class="cx">     if (hasReifiedName())
</span><span class="lines">@@ -608,10 +610,10 @@
</span><span class="cx">             name = makeString('[', String(&amp;uid), ']');
</span><span class="cx">     } else {
</span><span class="cx">         JSString* jsStr = value.toString(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         name = jsStr-&gt;value(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx">     reifyName(vm, exec, name);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">         auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">         typename Adaptor::Type value = toNativeFromValue&lt;Adaptor&gt;(exec, jsValue);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         if (isNeutered()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewConstructorInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     MarkedArgumentBuffer storage;
</span><span class="cx">     while (true) {
</span><span class="cx">         JSValue next = iteratorStep(exec, iterator);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         if (next.isFalse())
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         JSValue nextItem = iteratorValue(exec, next);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         storage.append(nextItem);
</span><span class="lines">@@ -104,13 +104,13 @@
</span><span class="cx"> 
</span><span class="cx">     ViewClass* result = ViewClass::createUninitialized(exec, structure, storage.size());
</span><span class="cx">     if (!result) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><ins>+        ASSERT(scope.exception());
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; storage.size(); ++i) {
</span><span class="cx">         if (!result-&gt;setIndex(exec, i, storage.at(i))) {
</span><del>-            ASSERT(exec-&gt;hadException());
</del><ins>+            ASSERT(scope.exception());
</ins><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">             object-&gt;getPropertySlot(exec, vm.propertyNames-&gt;length, lengthSlot);
</span><span class="cx"> 
</span><span class="cx">             JSValue iteratorFunc = object-&gt;get(exec, vm.propertyNames-&gt;iteratorSymbol);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return nullptr;
</span><span class="cx"> 
</span><span class="cx">             // We would like not use the iterator as it is painfully slow. Fortunately, unless
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> 
</span><span class="cx">                     ArgList arguments;
</span><span class="cx">                     JSValue iterator = call(exec, iteratorFunc, callType, callData, object, arguments);
</span><del>-                    if (exec-&gt;hadException())
</del><ins>+                    if (UNLIKELY(scope.exception()))
</ins><span class="cx">                         return nullptr;
</span><span class="cx"> 
</span><span class="cx">                     return constructGenericTypedArrayViewFromIterator&lt;ViewClass&gt;(exec, structure, iterator);
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             length = lengthSlot.isUnset() ? 0 : lengthSlot.getValue(exec, vm.propertyNames-&gt;length).toUInt32(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return nullptr;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx">         
</span><span class="cx">         ViewClass* result = ViewClass::createUninitialized(exec, structure, length);
</span><span class="cx">         if (!result) {
</span><del>-            ASSERT(exec-&gt;hadException());
</del><ins>+            ASSERT(scope.exception());
</ins><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">     InternalFunction* function = asInternalFunction(exec-&gt;callee());
</span><span class="cx">     Structure* parentStructure = function-&gt;globalObject()-&gt;typedArrayStructure(ViewClass::TypedArrayStorageType);
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), parentStructure);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     size_t argCount = exec-&gt;argumentCount();
</span><span class="lines">@@ -252,12 +252,12 @@
</span><span class="cx">     Optional&lt;unsigned&gt; length = Nullopt;
</span><span class="cx">     if (jsDynamicCast&lt;JSArrayBuffer*&gt;(firstValue) &amp;&amp; argCount &gt; 1) {
</span><span class="cx">         offset = exec-&gt;uncheckedArgument(1).toUInt32(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (argCount &gt; 2) {
</span><span class="cx">             length = exec-&gt;uncheckedArgument(2).toUInt32(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGenericTypedArrayViewPrototypeFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototypeFunctions.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue constructor = exemplar-&gt;get(exec, exec-&gt;propertyNames().constructor);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (constructor.isUndefined())
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSValue species = constructor.get(exec, exec-&gt;propertyNames().speciesSymbol);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (species.isUndefinedOrNull())
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">         return defaultConstructor();
</span><span class="cx"> 
</span><span class="cx">     JSValue result = construct(exec, species, args, &quot;species is not a constructor&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (JSArrayBufferView* view = jsDynamicCast&lt;JSArrayBufferView*&gt;(result)) {
</span><span class="lines">@@ -147,7 +147,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncCopyWithin(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // 22.2.3.5
</span><span class="lines">@@ -157,13 +156,13 @@
</span><span class="cx"> 
</span><span class="cx">     long length = thisObject-&gt;length();
</span><span class="cx">     long to = argumentClampedIndexFromStartOrEnd(exec, 0, length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx">     long from = argumentClampedIndexFromStartOrEnd(exec, 1, length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx">     long final = argumentClampedIndexFromStartOrEnd(exec, 2, length, length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx"> 
</span><span class="cx">     if (final &lt; from)
</span><span class="lines">@@ -183,7 +182,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncIncludes(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
</span><span class="lines">@@ -198,7 +196,7 @@
</span><span class="cx">     JSValue valueToFind = exec-&gt;argument(0);
</span><span class="cx"> 
</span><span class="cx">     unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (thisObject-&gt;isNeutered())
</span><span class="lines">@@ -209,7 +207,7 @@
</span><span class="cx">     if (!targetOption)
</span><span class="cx">         return JSValue::encode(jsBoolean(false));
</span><span class="cx"> 
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     RELEASE_ASSERT(!thisObject-&gt;isNeutered());
</span><span class="cx"> 
</span><span class="cx">     if (std::isnan(static_cast&lt;double&gt;(*targetOption))) {
</span><span class="lines">@@ -230,7 +228,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncIndexOf(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // 22.2.3.13
</span><span class="lines">@@ -245,7 +242,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSValue valueToFind = exec-&gt;argument(0);
</span><span class="cx">     unsigned index = argumentClampedIndexFromStartOrEnd(exec, 1, length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx"> 
</span><span class="cx">     if (thisObject-&gt;isNeutered())
</span><span class="lines">@@ -255,7 +252,7 @@
</span><span class="cx">     auto targetOption = ViewClass::toAdaptorNativeFromValueWithoutCoercion(valueToFind);
</span><span class="cx">     if (!targetOption)
</span><span class="cx">         return JSValue::encode(jsNumber(-1));
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     RELEASE_ASSERT(!thisObject-&gt;isNeutered());
</span><span class="cx"> 
</span><span class="cx">     for (; index &lt; length; ++index) {
</span><span class="lines">@@ -269,7 +266,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncJoin(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     ViewClass* thisObject = jsCast&lt;ViewClass*&gt;(exec-&gt;thisValue());
</span><span class="lines">@@ -282,11 +278,11 @@
</span><span class="cx">         unsigned length = thisObject-&gt;length();
</span><span class="cx"> 
</span><span class="cx">         JSStringJoiner joiner(*exec, separator, length);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         for (unsigned i = 0; i &lt; length; i++) {
</span><span class="cx">             joiner.append(*exec, thisObject-&gt;getIndexQuickly(i));
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx">         return JSValue::encode(joiner.join(*exec));
</span><span class="lines">@@ -299,7 +295,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSString* separatorString = separatorValue.toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (thisObject-&gt;isNeutered())
</span><span class="lines">@@ -310,7 +306,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncLastIndexOf(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // 22.2.3.16
</span><span class="lines">@@ -338,7 +333,7 @@
</span><span class="cx">             index = static_cast&lt;unsigned&gt;(fromDouble);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     if (thisObject-&gt;isNeutered())
</span><span class="lines">@@ -349,7 +344,7 @@
</span><span class="cx">         return JSValue::encode(jsNumber(-1));
</span><span class="cx"> 
</span><span class="cx">     typename ViewClass::ElementType* array = thisObject-&gt;typedVector();
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     RELEASE_ASSERT(!thisObject-&gt;isNeutered());
</span><span class="cx"> 
</span><span class="cx">     for (; index &gt;= 0; --index) {
</span><span class="lines">@@ -432,7 +427,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewProtoFuncSlice(VM&amp; vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // 22.2.3.26
</span><span class="lines">@@ -445,10 +439,10 @@
</span><span class="cx">     unsigned thisLength = thisObject-&gt;length();
</span><span class="cx"> 
</span><span class="cx">     unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, thisLength);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx">     unsigned end = argumentClampedIndexFromStartOrEnd(exec, 1, thisLength, thisLength);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return encodedJSValue();
</span><span class="cx"> 
</span><span class="cx">     if (thisObject-&gt;isNeutered())
</span><span class="lines">@@ -467,7 +461,7 @@
</span><span class="cx">         Structure* structure = callee-&gt;globalObject()-&gt;typedArrayStructure(ViewClass::TypedArrayStorageType);
</span><span class="cx">         return ViewClass::createUninitialized(exec, structure, length);
</span><span class="cx">     });
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!result-&gt;isNeutered());
</span><span class="lines">@@ -518,7 +512,6 @@
</span><span class="cx"> template&lt;typename ViewClass&gt;
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL genericTypedArrayViewPrivateFuncSubarrayCreate(VM&amp;vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-//    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     // 22.2.3.23
</span><span class="lines">@@ -537,9 +530,9 @@
</span><span class="cx">     ASSERT(exec-&gt;argument(0).isNumber());
</span><span class="cx">     ASSERT(exec-&gt;argument(1).isUndefined() || exec-&gt;argument(1).isNumber());
</span><span class="cx">     unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, thisLength);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     unsigned end = argumentClampedIndexFromStartOrEnd(exec, 1, thisLength, thisLength);
</span><del>-    ASSERT(!vm.exception());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_ASSERT(!thisObject-&gt;isNeutered());
</span><span class="cx"> 
</span><span class="lines">@@ -572,7 +565,7 @@
</span><span class="cx">     args.append(jsNumber(length));
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = construct(exec, species, args, &quot;species is not a constructor&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     if (jsDynamicCast&lt;JSArrayBufferView*&gt;(result))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  *  Copyright (C) 2007 Eric Seidel &lt;eric@webkit.org&gt;
</span><del>- *  Copyright (C) 2007, 2008, 2009, 2014-2016 Apple Inc. All rights reserved.
</del><ins>+ *  Copyright (C) 2007-2009, 2014-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -815,12 +815,14 @@
</span><span class="cx"> 
</span><span class="cx"> inline JSArray* constructEmptyArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, unsigned initialLength = 0, JSValue newTarget = JSValue())
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     Structure* structure;
</span><span class="cx">     if (initialLength &gt;= MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)
</span><span class="cx">         structure = globalObject-&gt;arrayStructureForIndexingTypeDuringAllocation(exec, ArrayWithArrayStorage, newTarget);
</span><span class="cx">     else
</span><span class="cx">         structure = globalObject-&gt;arrayStructureForProfileDuringAllocation(exec, profile, newTarget);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return ArrayAllocationProfile::updateLastAllocationFor(profile, JSArray::create(exec-&gt;vm(), structure, initialLength));
</span><span class="lines">@@ -833,8 +835,10 @@
</span><span class="cx">  
</span><span class="cx"> inline JSArray* constructArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, const ArgList&amp; values, JSValue newTarget = JSValue())
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     Structure* structure = globalObject-&gt;arrayStructureForProfileDuringAllocation(exec, profile, newTarget);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return ArrayAllocationProfile::updateLastAllocationFor(profile, constructArray(exec, structure, values));
</span><span class="cx"> }
</span><span class="lines">@@ -846,8 +850,10 @@
</span><span class="cx"> 
</span><span class="cx"> inline JSArray* constructArray(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, const JSValue* values, unsigned length, JSValue newTarget = JSValue())
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     Structure* structure = globalObject-&gt;arrayStructureForProfileDuringAllocation(exec, profile, newTarget);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return ArrayAllocationProfile::updateLastAllocationFor(profile, constructArray(exec, structure, values, length));
</span><span class="cx"> }
</span><span class="lines">@@ -859,8 +865,10 @@
</span><span class="cx"> 
</span><span class="cx"> inline JSArray* constructArrayNegativeIndexed(ExecState* exec, ArrayAllocationProfile* profile, JSGlobalObject* globalObject, const JSValue* values, unsigned length, JSValue newTarget = JSValue())
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     Structure* structure = globalObject-&gt;arrayStructureForProfileDuringAllocation(exec, profile, newTarget);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return ArrayAllocationProfile::updateLastAllocationFor(profile, constructArrayNegativeIndexed(exec, structure, values, length));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -660,7 +660,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String s = x.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     if (s.is8Bit()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSJobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSJob.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSJob.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSJob.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -62,6 +62,9 @@
</span><span class="cx"> 
</span><span class="cx"> void JSJobMicrotask::run(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     CallData handlerCallData;
</span><span class="cx">     CallType handlerCallType = getCallData(m_job.get(), handlerCallData);
</span><span class="cx">     ASSERT(handlerCallType != CallType::None);
</span><span class="lines">@@ -70,7 +73,7 @@
</span><span class="cx">     for (unsigned index = 0, length = m_arguments-&gt;length(); index &lt; length; ++index)
</span><span class="cx">         handlerArguments.append(m_arguments-&gt;JSArray::get(exec, index));
</span><span class="cx">     profiledCall(exec, ProfilingReason::Microtask, m_job.get(), handlerCallType, handlerCallData, jsUndefined(), handlerArguments);
</span><del>-    exec-&gt;vm().clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleEnvironmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleEnvironment.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSModuleEnvironment::getOwnPropertySlot(JSObject* cell, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSModuleEnvironment* thisObject = jsCast&lt;JSModuleEnvironment*&gt;(cell);
</span><span class="cx">     JSModuleRecord::Resolution resolution = thisObject-&gt;moduleRecord()-&gt;resolveImport(exec, Identifier::fromUid(exec, propertyName.uid()));
</span><span class="cx">     if (resolution.type == JSModuleRecord::Resolution::Type::Resolved) {
</span><span class="lines">@@ -84,11 +86,11 @@
</span><span class="cx">         // When resolveImport resolves the resolution, the imported module environment must have the binding.
</span><span class="cx">         JSModuleEnvironment* importedModuleEnvironment = resolution.moduleRecord-&gt;moduleEnvironment();
</span><span class="cx">         PropertySlot redirectSlot(importedModuleEnvironment, PropertySlot::InternalMethodType::Get);
</span><del>-        bool result = importedModuleEnvironment-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertySlot(importedModuleEnvironment, exec, resolution.localName, redirectSlot);
</del><ins>+        bool result = importedModuleEnvironment-&gt;methodTable(vm)-&gt;getOwnPropertySlot(importedModuleEnvironment, exec, resolution.localName, redirectSlot);
</ins><span class="cx">         ASSERT_UNUSED(result, result);
</span><span class="cx">         ASSERT(redirectSlot.isValue());
</span><span class="cx">         JSValue value = redirectSlot.getValue(exec, resolution.localName);
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">         slot.setValue(thisObject, redirectSlot.attributes(), value);
</span><span class="cx">         return true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleLoader.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -152,13 +152,15 @@
</span><span class="cx">         dataLog(&quot;Loader [fetch] &quot;, printableModuleKey(exec, key), &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     if (globalObject-&gt;globalObjectMethodTable()-&gt;moduleLoaderFetch)
</span><span class="cx">         return globalObject-&gt;globalObjectMethodTable()-&gt;moduleLoaderFetch(globalObject, exec, this, key, initiator);
</span><span class="cx">     JSInternalPromiseDeferred* deferred = JSInternalPromiseDeferred::create(exec, globalObject);
</span><span class="cx">     String moduleKey = key.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException()) {
-        JSValue exception = exec-&gt;exception()-&gt;value();
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        JSValue exception = scope.exception()-&gt;value();
+        scope.clearException();
</ins><span class="cx">         deferred-&gt;reject(exec, exception);
</span><span class="cx">         return deferred-&gt;promise();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleNamespaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> void JSModuleNamespaceObject::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSModuleRecord* moduleRecord, const IdentifierSet&amp; exports)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx"> 
</span><span class="lines">@@ -77,7 +78,7 @@
</span><span class="cx">     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-isextensible
</span><span class="cx">     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-preventextensions
</span><span class="cx">     methodTable(vm)-&gt;preventExtensions(this, exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSModuleNamespaceObject::destroy(JSCell* cell)
</span><span class="lines">@@ -132,7 +133,7 @@
</span><span class="cx">         ASSERT_UNUSED(found, found);
</span><span class="cx"> 
</span><span class="cx">         JSValue value = trampolineSlot.getValue(exec, propertyName);
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">         // If the value is filled with TDZ value, throw a reference error.
</span><span class="cx">         if (!value) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSModuleRecordcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSModuleRecord.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSModuleRecord.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSModuleRecord.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -778,7 +778,7 @@
</span><span class="cx">         JSModuleRecord* importedModule = hostResolveImportedModule(exec, importEntry.moduleRequest);
</span><span class="cx">         if (importEntry.isNamespace(vm)) {
</span><span class="cx">             JSModuleNamespaceObject* namespaceObject = importedModule-&gt;getModuleNamespace(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return;
</span><span class="cx">             bool putResult = false;
</span><span class="cx">             symbolTablePutTouchWatchpointSet(moduleEnvironment, exec, importEntry.localName, namespaceObject, /* shouldThrowReadOnlyError */ false, /* ignoreReadOnlyErrors */ true, putResult);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSONObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSONObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSONObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -220,6 +220,8 @@
</span><span class="cx">     , m_replacerCallType(CallType::None)
</span><span class="cx">     , m_gap(gap(exec, space.get()))
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (!m_replacer.isObject())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -226,10 +228,10 @@
</span><span class="cx">     if (m_replacer.asObject()-&gt;inherits(JSArray::info())) {
</span><span class="cx">         m_usingArrayReplacer = true;
</span><span class="cx">         Handle&lt;JSObject&gt; array = m_replacer.asObject();
</span><del>-        unsigned length = array-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;length).toUInt32(exec);
</del><ins>+        unsigned length = array-&gt;get(exec, vm.propertyNames-&gt;length).toUInt32(exec);
</ins><span class="cx">         for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">             JSValue name = array-&gt;get(exec, i);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             if (name.isObject()) {
</span><span class="lines">@@ -248,36 +250,39 @@
</span><span class="cx"> 
</span><span class="cx"> Local&lt;Unknown&gt; Stringifier::stringify(Handle&lt;Unknown&gt; value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = constructEmptyObject(m_exec);
</span><del>-    if (m_exec-&gt;hadException())
-        return Local&lt;Unknown&gt;(m_exec-&gt;vm(), jsNull());
</del><ins>+    if (UNLIKELY(scope.exception()))
+        return Local&lt;Unknown&gt;(vm, jsNull());
</ins><span class="cx"> 
</span><del>-    PropertyNameForFunctionCall emptyPropertyName(m_exec-&gt;vm().propertyNames-&gt;emptyIdentifier);
-    object-&gt;putDirect(m_exec-&gt;vm(), m_exec-&gt;vm().propertyNames-&gt;emptyIdentifier, value.get());
</del><ins>+    PropertyNameForFunctionCall emptyPropertyName(vm.propertyNames-&gt;emptyIdentifier);
+    object-&gt;putDirect(vm, vm.propertyNames-&gt;emptyIdentifier, value.get());
</ins><span class="cx"> 
</span><span class="cx">     StringBuilder result;
</span><span class="cx">     if (appendStringifiedValue(result, value.get(), object, emptyPropertyName) != StringifySucceeded)
</span><del>-        return Local&lt;Unknown&gt;(m_exec-&gt;vm(), jsUndefined());
-    if (m_exec-&gt;hadException())
-        return Local&lt;Unknown&gt;(m_exec-&gt;vm(), jsNull());
</del><ins>+        return Local&lt;Unknown&gt;(vm, jsUndefined());
+    if (UNLIKELY(scope.exception()))
+        return Local&lt;Unknown&gt;(vm, jsNull());
</ins><span class="cx"> 
</span><del>-    return Local&lt;Unknown&gt;(m_exec-&gt;vm(), jsString(m_exec, result.toString()));
</del><ins>+    return Local&lt;Unknown&gt;(vm, jsString(m_exec, result.toString()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE JSValue Stringifier::toJSON(JSValue value, const PropertyNameForFunctionCall&amp; propertyName)
</span><span class="cx"> {
</span><del>-    ASSERT(!m_exec-&gt;hadException());
</del><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    ASSERT(!scope.exception());
</ins><span class="cx">     if (!value.isObject())
</span><span class="cx">         return value;
</span><span class="cx">     
</span><span class="cx">     JSObject* object = asObject(value);
</span><del>-    VM&amp; vm = m_exec-&gt;vm();
</del><span class="cx">     PropertySlot slot(object, PropertySlot::InternalMethodType::Get);
</span><span class="cx">     if (!object-&gt;getPropertySlot(m_exec, vm.propertyNames-&gt;toJSON, slot))
</span><span class="cx">         return value;
</span><span class="cx"> 
</span><span class="cx">     JSValue toJSONFunction = slot.getValue(m_exec, vm.propertyNames-&gt;toJSON);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsNull();
</span><span class="cx">     return toJSONImpl(value, toJSONFunction, propertyName);
</span><span class="cx"> }
</span><span class="lines">@@ -301,7 +306,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Call the toJSON function.
</span><span class="cx">     value = toJSON(value, propertyName);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return StringifyFailed;
</span><span class="cx"> 
</span><span class="cx">     // Call the replacer function.
</span><span class="lines">@@ -310,7 +315,7 @@
</span><span class="cx">         args.append(propertyName.value(m_exec));
</span><span class="cx">         args.append(value);
</span><span class="cx">         value = call(m_exec, m_replacer.get(), m_replacerCallType, m_replacerCallData, holder, args);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return StringifyFailed;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -324,7 +329,7 @@
</span><span class="cx"> 
</span><span class="cx">     value = unwrapBoxedPrimitive(m_exec, value);
</span><span class="cx"> 
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return StringifyFailed;
</span><span class="cx"> 
</span><span class="cx">     if (value.isBoolean()) {
</span><span class="lines">@@ -377,7 +382,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool holderStackWasEmpty = m_holderStack.isEmpty();
</span><span class="cx">     m_holderStack.append(Holder(vm, m_exec, object));
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return StringifyFailed;
</span><span class="cx">     if (!holderStackWasEmpty)
</span><span class="cx">         return StringifySucceeded;
</span><span class="lines">@@ -384,7 +389,7 @@
</span><span class="cx"> 
</span><span class="cx">     do {
</span><span class="cx">         while (m_holderStack.last().appendNextProperty(*this, builder)) {
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return StringifyFailed;
</span><span class="cx">         }
</span><span class="cx">         m_holderStack.removeLast();
</span><span class="lines">@@ -436,6 +441,8 @@
</span><span class="cx">     ASSERT(m_index &lt;= m_size);
</span><span class="cx"> 
</span><span class="cx">     ExecState* exec = stringifier.m_exec;
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     // First time through, initialize.
</span><span class="cx">     if (!m_index) {
</span><span class="lines">@@ -444,7 +451,7 @@
</span><span class="cx">             if (m_isJSArray)
</span><span class="cx">                 m_size = asArray(m_object.get())-&gt;length();
</span><span class="cx">             else
</span><del>-                m_size = m_object-&gt;get(exec, exec-&gt;vm().propertyNames-&gt;length).toUInt32(exec);
</del><ins>+                m_size = m_object-&gt;get(exec, vm.propertyNames-&gt;length).toUInt32(exec);
</ins><span class="cx">             builder.append('[');
</span><span class="cx">         } else {
</span><span class="cx">             if (stringifier.m_usingArrayReplacer)
</span><span class="lines">@@ -452,7 +459,7 @@
</span><span class="cx">             else {
</span><span class="cx">                 PropertyNameArray objectPropertyNames(exec, PropertyNameMode::Strings);
</span><span class="cx">                 m_object-&gt;methodTable()-&gt;getOwnPropertyNames(m_object.get(), exec, objectPropertyNames, EnumerationMode());
</span><del>-                if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return false;
</span><span class="cx">                 m_propertyNames = objectPropertyNames.releaseData();
</span><span class="cx">             }
</span><span class="lines">@@ -486,7 +493,7 @@
</span><span class="cx">                 value = slot.getValue(exec, index);
</span><span class="cx">             else
</span><span class="cx">                 value = jsUndefined();
</span><del>-            if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -504,7 +511,7 @@
</span><span class="cx">         if (!m_object-&gt;methodTable()-&gt;getOwnPropertySlot(m_object.get(), exec, propertyName, slot))
</span><span class="cx">             return true;
</span><span class="cx">         JSValue value = slot.getValue(exec, propertyName);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         rollBackPoint = builder.length();
</span><span class="lines">@@ -640,7 +647,7 @@
</span><span class="cx">                         inValue = slot.getValue(m_exec, index);
</span><span class="cx">                     else
</span><span class="cx">                         inValue = jsUndefined();
</span><del>-                    if (m_exec-&gt;hadException())
</del><ins>+                    if (UNLIKELY(scope.exception()))
</ins><span class="cx">                         return jsNull();
</span><span class="cx">                 }
</span><span class="cx">                     
</span><span class="lines">@@ -658,7 +665,7 @@
</span><span class="cx">                     array-&gt;methodTable()-&gt;deletePropertyByIndex(array, m_exec, indexStack.last());
</span><span class="cx">                 else
</span><span class="cx">                     array-&gt;putDirectIndex(m_exec, indexStack.last(), filteredValue);
</span><del>-                if (m_exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return jsNull();
</span><span class="cx">                 indexStack.last()++;
</span><span class="cx">                 goto arrayStartVisitMember;
</span><span class="lines">@@ -675,7 +682,7 @@
</span><span class="cx">                 indexStack.append(0);
</span><span class="cx">                 propertyStack.append(PropertyNameArray(m_exec, PropertyNameMode::Strings));
</span><span class="cx">                 object-&gt;methodTable()-&gt;getOwnPropertyNames(object, m_exec, propertyStack.last(), EnumerationMode());
</span><del>-                if (UNLIKELY(m_exec-&gt;hadException()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return jsNull();
</span><span class="cx">             }
</span><span class="cx">             objectStartVisitMember:
</span><span class="lines">@@ -698,7 +705,7 @@
</span><span class="cx">                     inValue = jsUndefined();
</span><span class="cx"> 
</span><span class="cx">                 // The holder may be modified by the reviver function so any lookup may throw
</span><del>-                if (m_exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return jsNull();
</span><span class="cx"> 
</span><span class="cx">                 if (inValue.isObject()) {
</span><span class="lines">@@ -717,7 +724,7 @@
</span><span class="cx">                     object-&gt;methodTable()-&gt;deleteProperty(object, m_exec, prop);
</span><span class="cx">                 else
</span><span class="cx">                     object-&gt;methodTable()-&gt;put(object, m_exec, prop, filteredValue, slot);
</span><del>-                if (m_exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return jsNull();
</span><span class="cx">                 indexStack.last()++;
</span><span class="cx">                 goto objectStartVisitMember;
</span><span class="lines">@@ -754,7 +761,7 @@
</span><span class="cx">     if (!exec-&gt;argumentCount())
</span><span class="cx">         return throwVMError(exec, scope, createError(exec, ASCIILiteral(&quot;JSON.parse requires at least one parameter&quot;)));
</span><span class="cx">     JSString::SafeView source = exec-&gt;uncheckedArgument(0).toString(exec)-&gt;view(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx"> 
</span><span class="cx">     JSValue unfiltered;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -351,6 +351,7 @@
</span><span class="cx">     // 3. ES6 Proxy.
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* current = object;
</span><span class="cx">     PropertyDescriptor ownDescriptor;
</span><span class="cx">     while (true) {
</span><span class="lines">@@ -362,13 +363,13 @@
</span><span class="cx"> 
</span><span class="cx">         // 9.1.9.1-2 Let ownDesc be ? O.[[GetOwnProperty]](P).
</span><span class="cx">         bool ownDescriptorFound = current-&gt;getOwnPropertyDescriptor(exec, propertyName, ownDescriptor);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         if (!ownDescriptorFound) {
</span><span class="cx">             // 9.1.9.1-3-a Let parent be ? O.[[GetPrototypeOf]]().
</span><span class="cx">             JSValue prototype = current-&gt;getPrototype(vm, exec);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">             // 9.1.9.1-3-b If parent is not null, then
</span><span class="lines">@@ -400,7 +401,7 @@
</span><span class="cx">         JSObject* receiverObject = asObject(receiver);
</span><span class="cx">         PropertyDescriptor existingDescriptor;
</span><span class="cx">         bool existingDescriptorFound = receiverObject-&gt;getOwnPropertyDescriptor(exec, propertyName, existingDescriptor);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="cx">         // 9.1.9.1-4-d If existingDescriptor is not undefined, then
</span><span class="lines">@@ -1292,7 +1293,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     bool isExtensible = this-&gt;isExtensible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!isExtensible) {
</span><span class="lines">@@ -1552,7 +1553,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue function = object-&gt;get(exec, propertyName);
</span><del>-    if (scope.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return scope.exception();
</span><span class="cx">     if (function.isUndefined() &amp;&amp; mode == TypeHintMode::TakesHint)
</span><span class="cx">         return JSValue();
</span><span class="lines">@@ -1580,7 +1581,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSValue result = call(exec, function, callType, callData, const_cast&lt;JSObject*&gt;(object), callArgs);
</span><span class="cx">     ASSERT(!result.isGetterSetter());
</span><del>-    if (scope.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return scope.exception();
</span><span class="cx">     if (result.isObject())
</span><span class="cx">         return mode == TypeHintMode::DoesNotTakeHint ? JSValue() : throwTypeError(exec, scope, ASCIILiteral(&quot;Symbol.toPrimitive returned an object&quot;));
</span><span class="lines">@@ -1618,7 +1619,7 @@
</span><span class="cx">             return value;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     return throwTypeError(exec, scope, ASCIILiteral(&quot;No default value&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1718,7 +1719,7 @@
</span><span class="cx">     JSObject* object = asObject(value);
</span><span class="cx">     while (true) {
</span><span class="cx">         JSValue objectValue = object-&gt;getPrototype(vm, exec);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (!objectValue.isObject())
</span><span class="cx">             return false;
</span><span class="lines">@@ -1740,12 +1741,13 @@
</span><span class="cx"> void JSObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, propertyNames, mode);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSValue nextProto = object-&gt;getPrototype(vm, exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (nextProto.isNull())
</span><span class="cx">         return;
</span><span class="lines">@@ -1757,10 +1759,10 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         prototype-&gt;methodTable(vm)-&gt;getOwnPropertyNames(prototype, exec, propertyNames, mode);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         nextProto = prototype-&gt;getPrototype(vm, exec);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         if (nextProto.isNull())
</span><span class="cx">             break;
</span><span class="lines">@@ -1858,8 +1860,10 @@
</span><span class="cx"> 
</span><span class="cx"> double JSObject::toNumber(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue primitive = toPrimitive(exec, PreferNumber);
</span><del>-    if (exec-&gt;hadException()) // should be picked up soon in Nodes.cpp
</del><ins>+    if (UNLIKELY(scope.exception())) // should be picked up soon in Nodes.cpp
</ins><span class="cx">         return 0.0;
</span><span class="cx">     return primitive.toNumber(exec);
</span><span class="cx"> }
</span><span class="lines">@@ -1866,8 +1870,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSString* JSObject::toString(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue primitive = toPrimitive(exec, PreferString);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsEmptyString(exec);
</span><span class="cx">     return primitive.toString(exec);
</span><span class="cx"> }
</span><span class="lines">@@ -3076,15 +3082,18 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSObject::defineOwnNonIndexProperty(ExecState* exec, PropertyName propertyName, const PropertyDescriptor&amp; descriptor, bool throwException)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm  = exec-&gt;vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Track on the globaldata that we're in define property.
</span><span class="cx">     // Currently DefineOwnProperty uses delete to remove properties when they are being replaced
</span><span class="cx">     // (particularly when changing attributes), however delete won't allow non-configurable (i.e.
</span><span class="cx">     // DontDelete) properties to be deleted. For now, we can use this flag to make this work.
</span><del>-    VM::DeletePropertyModeScope scope(exec-&gt;vm(), VM::DeletePropertyMode::IgnoreConfigurable);
</del><ins>+    VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable);
</ins><span class="cx">     PropertyDescriptor current;
</span><span class="cx">     bool isCurrentDefined = getOwnPropertyDescriptor(exec, propertyName, current);
</span><span class="cx">     bool isExtensible = this-&gt;isExtensible(exec);
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     return validateAndApplyPropertyDescriptor(exec, this, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException);
</span><span class="cx"> }
</span><span class="lines">@@ -3184,12 +3193,13 @@
</span><span class="cx"> void JSObject::getGenericPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, propertyNames, EnumerationMode(mode, JSObjectPropertiesMode::Exclude));
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSValue nextProto = object-&gt;getPrototype(vm, exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     if (nextProto.isNull())
</span><span class="cx">         return;
</span><span class="lines">@@ -3201,10 +3211,10 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         prototype-&gt;methodTable(vm)-&gt;getOwnPropertyNames(prototype, exec, propertyNames, mode);
</span><del>-        if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         nextProto = prototype-&gt;getPrototype(vm, exec);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         if (nextProto.isNull())
</span><span class="cx">             break;
</span><span class="lines">@@ -3220,7 +3230,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue method = get(exec, ident);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!method.isCell()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -40,16 +40,16 @@
</span><span class="cx">     
</span><span class="cx">     Vector&lt;JSValue&gt; result;
</span><span class="cx">     JSValue lengthProperty = arrayLikeValue.get(exec, vm.propertyNames-&gt;length);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     double lengthAsDouble = lengthProperty.toLength(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     RELEASE_ASSERT(lengthAsDouble &gt;= 0.0 &amp;&amp; lengthAsDouble == std::trunc(lengthAsDouble));
</span><span class="cx">     uint64_t length = static_cast&lt;uint64_t&gt;(lengthAsDouble);
</span><span class="cx">     for (uint64_t index = 0; index &lt; length; index++) {
</span><span class="cx">         JSValue next = arrayLikeValue.get(exec, index);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         
</span><span class="cx">         RuntimeType type = runtimeTypeForValue(next);
</span><span class="lines">@@ -96,8 +96,10 @@
</span><span class="cx"> template&lt;typename CallbackWhenNoException&gt;
</span><span class="cx"> ALWAYS_INLINE typename std::result_of&lt;CallbackWhenNoException(bool, PropertySlot&amp;)&gt;::type JSObject::getPropertySlot(ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot, CallbackWhenNoException callback) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     bool found = const_cast&lt;JSObject*&gt;(this)-&gt;getPropertySlot(exec, propertyName, slot);
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return { };
</span><span class="cx">     return callback(found, slot);
</span><span class="cx"> }
</span><span class="lines">@@ -105,6 +107,7 @@
</span><span class="cx"> ALWAYS_INLINE bool JSObject::getPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     auto&amp; structureIDTable = vm.heap.structureIDTable();
</span><span class="cx">     JSObject* object = this;
</span><span class="cx">     MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype;
</span><span class="lines">@@ -112,7 +115,7 @@
</span><span class="cx">         Structure&amp; structure = *structureIDTable.get(object-&gt;structureID());
</span><span class="cx">         if (structure.classInfo()-&gt;methodTable.getOwnPropertySlotByIndex(object, exec, propertyName, slot))
</span><span class="cx">             return true;
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         JSValue prototype;
</span><span class="cx">         if (LIKELY(structure.classInfo()-&gt;methodTable.getPrototype == defaultGetPrototype || slot.internalMethodType() == PropertySlot::InternalMethodType::VMInquiry))
</span><span class="lines">@@ -119,7 +122,7 @@
</span><span class="cx">             prototype = structure.storedPrototype();
</span><span class="cx">         else {
</span><span class="cx">             prototype = object-&gt;getPrototype(vm, exec);
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">         if (!prototype.isObject())
</span><span class="lines">@@ -134,6 +137,7 @@
</span><span class="cx">     ASSERT(!parseIndex(propertyName));
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     auto&amp; structureIDTable = vm.heap.structureIDTable();
</span><span class="cx">     JSObject* object = this;
</span><span class="cx">     MethodTable::GetPrototypeFunctionPtr defaultGetPrototype = JSObject::getPrototype;
</span><span class="lines">@@ -145,7 +149,7 @@
</span><span class="cx">         } else {
</span><span class="cx">             if (structure.classInfo()-&gt;methodTable.getOwnPropertySlot(object, exec, propertyName, slot))
</span><span class="cx">                 return true;
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">         JSValue prototype;
</span><span class="lines">@@ -153,7 +157,7 @@
</span><span class="cx">             prototype = structure.storedPrototype();
</span><span class="cx">         else {
</span><span class="cx">             prototype = object-&gt;getPrototype(vm, exec);
</span><del>-            if (vm.exception())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">         if (!prototype.isObject())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPromiseConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     Structure* promiseStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), globalObject-&gt;promiseStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     JSPromise* promise = JSPromise::create(vm, promiseStructure);
</span><span class="cx">     promise-&gt;initialize(exec, globalObject, exec-&gt;argument(0));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPropertyNameEnumeratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSPropertyNameEnumerator.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -102,6 +102,7 @@
</span><span class="cx"> inline JSPropertyNameEnumerator* propertyNameEnumerator(ExecState* exec, JSObject* base)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     uint32_t indexedLength = base-&gt;methodTable(vm)-&gt;getEnumerableLength(exec, base);
</span><span class="cx"> 
</span><span class="lines">@@ -119,18 +120,18 @@
</span><span class="cx"> 
</span><span class="cx">     if (structure-&gt;canAccessPropertiesQuicklyForEnumeration() &amp;&amp; indexedLength == base-&gt;getArrayLength()) {
</span><span class="cx">         base-&gt;methodTable(vm)-&gt;getStructurePropertyNames(base, exec, propertyNames, EnumerationMode());
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">         numberStructureProperties = propertyNames.size();
</span><span class="cx"> 
</span><span class="cx">         base-&gt;methodTable(vm)-&gt;getGenericPropertyNames(base, exec, propertyNames, EnumerationMode());
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx">     } else {
</span><span class="cx">         // Generic property names vector contains all indexed property names.
</span><span class="cx">         // So disable indexed property enumeration phase by setting |indexedLength| to 0.
</span><span class="cx">         indexedLength = 0;
</span><span class="cx">         base-&gt;methodTable(vm)-&gt;getPropertyNames(base, exec, propertyNames, EnumerationMode());
</span><del>-        if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSPropertyNameIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -55,8 +55,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, Structure* structure, JSObject* iteratedObject)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSPropertyNameEnumerator* enumerator = propertyNameEnumerator(exec, iteratedObject);
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return JSPropertyNameIterator::create(exec, structure, iteratedObject, enumerator);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -200,16 +200,18 @@
</span><span class="cx"> // When an exception occurs, the result of isUnscopable becomes false.
</span><span class="cx"> static inline bool isUnscopable(ExecState* exec, JSScope* scope, JSObject* object, const Identifier&amp; ident)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto throwScope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (scope-&gt;type() != WithScopeType)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSValue unscopables = object-&gt;get(exec, exec-&gt;propertyNames().unscopablesSymbol);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (!unscopables.isObject())
</span><span class="cx">         return false;
</span><span class="cx">     JSValue blocked = jsCast&lt;JSObject*&gt;(unscopables)-&gt;get(exec, ident);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return blocked.toBoolean(exec);
</span><span class="lines">@@ -218,6 +220,7 @@
</span><span class="cx"> JSObject* JSScope::resolve(ExecState* exec, JSScope* scope, const Identifier&amp; ident)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto throwScope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ScopeChainIterator end = scope-&gt;end();
</span><span class="cx">     ScopeChainIterator it = scope-&gt;begin();
</span><span class="cx">     while (1) {
</span><span class="lines">@@ -240,7 +243,7 @@
</span><span class="cx">         if (object-&gt;hasProperty(exec, ident)) {
</span><span class="cx">             if (!isUnscopable(exec, scope, object, ident))
</span><span class="cx">                 return object;
</span><del>-            ASSERT_WITH_MESSAGE(!exec-&gt;hadException(), &quot;When an exception occurs, the result of isUnscopable becomes false&quot;);
</del><ins>+            ASSERT_WITH_MESSAGE_UNUSED(throwScope, !throwScope.exception(), &quot;When an exception occurs, the result of isUnscopable becomes false&quot;);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSString.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSString.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSString.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -74,9 +74,11 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSString::equalSlowCase(ExecState* exec, JSString* other) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     String str1 = value(exec);
</span><span class="cx">     String str2 = other-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     return WTF::equal(*str1.impl(), *str2.impl());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSStringJoinercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSStringJoiner.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSStringJoiner.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/JSStringJoiner.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">     ASSERT(m_strings.size() &lt;= m_strings.capacity());
</span><span class="cx"> 
</span><span class="cx">     unsigned length = joinedLength(state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!length)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeLiteralParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -572,6 +572,8 @@
</span><span class="cx"> template &lt;typename CharType&gt;
</span><span class="cx"> JSValue LiteralParser&lt;CharType&gt;::parse(ParserState initialState)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ParserState state = initialState;
</span><span class="cx">     MarkedArgumentBuffer objectStack;
</span><span class="cx">     JSValue lastValue;
</span><span class="lines">@@ -583,7 +585,7 @@
</span><span class="cx">             startParseArray:
</span><span class="cx">             case StartParseArray: {
</span><span class="cx">                 JSArray* array = constructEmptyArray(m_exec, 0);
</span><del>-                if (UNLIKELY(m_exec-&gt;hadException()))
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue();
</span><span class="cx">                 objectStack.append(array);
</span><span class="cx">             }
</span><span class="lines">@@ -681,7 +683,7 @@
</span><span class="cx">             {
</span><span class="cx">                 JSObject* object = asObject(objectStack.last());
</span><span class="cx">                 PropertyName ident = identifierStack.last();
</span><del>-                if (m_mode != StrictJSON &amp;&amp; ident == m_exec-&gt;vm().propertyNames-&gt;underscoreProto) {
</del><ins>+                if (m_mode != StrictJSON &amp;&amp; ident == vm.propertyNames-&gt;underscoreProto) {
</ins><span class="cx">                     if (!visitedUnderscoreProto.add(object).isNewEntry) {
</span><span class="cx">                         m_parseErrorMessage = ASCIILiteral(&quot;Attempted to redefine __proto__ property&quot;);
</span><span class="cx">                         return JSValue();
</span><span class="lines">@@ -693,7 +695,7 @@
</span><span class="cx">                     if (Optional&lt;uint32_t&gt; index = parseIndex(ident))
</span><span class="cx">                         object-&gt;putDirectIndex(m_exec, index.value(), lastValue);
</span><span class="cx">                     else
</span><del>-                        object-&gt;putDirect(m_exec-&gt;vm(), ident, lastValue);                    
</del><ins>+                        object-&gt;putDirect(vm, ident, lastValue);
</ins><span class="cx">                 }
</span><span class="cx">                 identifierStack.removeLast();
</span><span class="cx">                 if (m_lexer.currentToken()-&gt;type == TokComma)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMapConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/MapConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">         return JSValue::encode(map);
</span><span class="cx"> 
</span><span class="cx">     JSValue adderFunction = map-&gt;JSObject::get(exec, exec-&gt;propertyNames().set);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     CallData adderFunctionCallData;
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope));
</span><span class="cx"> 
</span><span class="cx">     forEachInIterable(exec, iterable, [&amp;](VM&amp; vm, ExecState* exec, JSValue nextItem) {
</span><ins>+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         if (!nextItem.isObject()) {
</span><span class="cx">             throwTypeError(exec, scope);
</span><span class="cx">             return;
</span><span class="lines">@@ -86,11 +87,11 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         JSValue key = nextItem.get(exec, static_cast&lt;unsigned&gt;(0));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         JSValue value = nextItem.get(exec, static_cast&lt;unsigned&gt;(1));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         MarkedArgumentBuffer arguments;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMathObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MathObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/MathObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -162,8 +162,10 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL mathProtoFuncClz32(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     uint32_t value = exec-&gt;argument(0).toUInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     return JSValue::encode(JSValue(clz32(value)));
</span><span class="cx"> }
</span><span class="lines">@@ -185,6 +187,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL mathProtoFuncHypot(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     unsigned argsCount = exec-&gt;argumentCount();
</span><span class="cx">     double max = 0;
</span><span class="cx">     Vector&lt;double, 8&gt; args;
</span><span class="lines">@@ -191,7 +195,7 @@
</span><span class="cx">     args.reserveInitialCapacity(argsCount);
</span><span class="cx">     for (unsigned i = 0; i &lt; argsCount; ++i) {
</span><span class="cx">         args.uncheckedAppend(exec-&gt;uncheckedArgument(i).toNumber(exec));
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsNull());
</span><span class="cx">         if (std::isinf(args[i]))
</span><span class="cx">             return JSValue::encode(jsDoubleNumber(+std::numeric_limits&lt;double&gt;::infinity()));
</span><span class="lines">@@ -292,8 +296,10 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL mathProtoFuncIMul(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     int32_t left = exec-&gt;argument(0).toInt32(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     int32_t right = exec-&gt;argument(1).toInt32(exec);
</span><span class="cx">     return JSValue::encode(jsNumber(left * right));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeModuleLoaderPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -112,11 +112,11 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     const Identifier moduleKey = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     String source = exec-&gt;argument(1).toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     SourceCode sourceCode = makeSource(source, moduleKey.impl());
</span><span class="lines">@@ -142,12 +142,14 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL moduleLoaderPrototypeRequestedModules(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSModuleRecord* moduleRecord = jsDynamicCast&lt;JSModuleRecord*&gt;(exec-&gt;argument(0));
</span><span class="cx">     if (!moduleRecord)
</span><span class="cx">         return JSValue::encode(constructEmptyArray(exec, nullptr));
</span><span class="cx"> 
</span><span class="cx">     JSArray* result = constructEmptyArray(exec, nullptr, moduleRecord-&gt;requestedModules().size());
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         JSValue::encode(jsUndefined());
</span><span class="cx">     size_t i = 0;
</span><span class="cx">     for (auto&amp; key : moduleRecord-&gt;requestedModules())
</span><span class="lines">@@ -158,6 +160,8 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL moduleLoaderPrototypeModuleDeclarationInstantiation(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSModuleRecord* moduleRecord = jsDynamicCast&lt;JSModuleRecord*&gt;(exec-&gt;argument(0));
</span><span class="cx">     if (!moduleRecord)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -166,7 +170,7 @@
</span><span class="cx">         dataLog(&quot;Loader [link] &quot;, moduleRecord-&gt;moduleKey(), &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     moduleRecord-&gt;link(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNativeErrorConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -63,9 +63,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL Interpreter::constructWithNativeErrorConstructor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue message = exec-&gt;argument(0);
</span><span class="cx">     Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), jsCast&lt;NativeErrorConstructor*&gt;(exec-&gt;callee())-&gt;errorStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     ASSERT(errorStructure);
</span><span class="cx">     return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeNumberConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -85,9 +85,11 @@
</span><span class="cx"> // ECMA 15.7.1
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     double n = exec-&gt;argumentCount() ? exec-&gt;uncheckedArgument(0).toNumber(exec) : 0;
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), exec-&gt;lexicalGlobalObject()-&gt;numberObjectStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     NumberObject* object = NumberObject::create(exec-&gt;vm(), structure);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -121,6 +121,8 @@
</span><span class="cx"> {
</span><span class="cx">     ObjectConstructor* objectConstructor = jsCast&lt;ObjectConstructor*&gt;(exec-&gt;callee());
</span><span class="cx">     JSGlobalObject* globalObject = objectConstructor-&gt;globalObject();
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     // We need to check newTarget condition in this caller side instead of InternalFunction::createSubclassStructure side.
</span><span class="cx">     // Since if we found this condition is met, we should not fall into the type conversion in the step 3.
</span><span class="lines">@@ -129,7 +131,7 @@
</span><span class="cx">     if (newTarget &amp;&amp; newTarget != objectConstructor) {
</span><span class="cx">         // a. Return ? OrdinaryCreateFromConstructor(NewTarget, &quot;%ObjectPrototype%&quot;).
</span><span class="cx">         Structure* objectStructure = InternalFunction::createSubclassStructure(exec, newTarget, globalObject-&gt;objectStructureForObjectConstructor());
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return constructEmptyObject(exec, objectStructure);
</span><span class="cx">     }
</span><span class="lines">@@ -211,8 +213,10 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorGetPrototypeOf(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(objectConstructorGetPrototypeOf(exec, object));
</span><span class="cx"> }
</span><span class="lines">@@ -231,7 +235,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     JSObject* object = objectValue.toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(objectValue);
</span><span class="cx"> 
</span><span class="cx">     if (!checkProtoSetterAccessAllowed(exec, object)) {
</span><span class="lines">@@ -241,16 +245,18 @@
</span><span class="cx"> 
</span><span class="cx">     bool shouldThrowIfCantSet = true;
</span><span class="cx">     bool didSetPrototype = object-&gt;setPrototype(vm, exec, protoValue, shouldThrowIfCantSet);
</span><del>-    ASSERT_UNUSED(didSetPrototype, vm.exception() || didSetPrototype);
</del><ins>+    ASSERT_UNUSED(didSetPrototype, scope.exception() || didSetPrototype);
</ins><span class="cx">     return JSValue::encode(objectValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue objectConstructorGetOwnPropertyDescriptor(ExecState* exec, JSObject* object, const Identifier&amp; propertyName)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     PropertyDescriptor descriptor;
</span><span class="cx">     if (!object-&gt;getOwnPropertyDescriptor(exec, propertyName, descriptor))
</span><span class="cx">         return jsUndefined();
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = constructObjectFromPropertyDescriptor(exec, descriptor);
</span><span class="lines">@@ -261,19 +267,21 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue objectConstructorGetOwnPropertyDescriptors(ExecState* exec, JSObject* object)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
-    if (exec-&gt;hadException())
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     JSObject* descriptors = constructEmptyObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; propertyName : properties) {
</span><span class="cx">         PropertyDescriptor descriptor;
</span><span class="cx">         bool didGetDescriptor = object-&gt;getOwnPropertyDescriptor(exec, propertyName, descriptor);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">         if (!didGetDescriptor)
</span><span class="lines">@@ -285,7 +293,7 @@
</span><span class="cx"> 
</span><span class="cx">         PutPropertySlot slot(descriptors);
</span><span class="cx">         descriptors-&gt;putOwnDataPropertyMayBeIndex(exec, propertyName, fromDescriptor, slot);
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return descriptors;
</span><span class="lines">@@ -293,11 +301,13 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorGetOwnPropertyDescriptor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto propertyName = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(objectConstructorGetOwnPropertyDescriptor(exec, object, propertyName));
</span><span class="cx"> }
</span><span class="lines">@@ -304,8 +314,10 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorGetOwnPropertyDescriptors(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(objectConstructorGetOwnPropertyDescriptors(exec, object));
</span><span class="cx"> }
</span><span class="lines">@@ -313,8 +325,10 @@
</span><span class="cx"> // FIXME: Use the enumeration cache.
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorGetOwnPropertyNames(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     return JSValue::encode(ownPropertyKeys(exec, object, PropertyNameMode::Strings, DontEnumPropertiesMode::Include));
</span><span class="cx"> }
</span><span class="lines">@@ -322,8 +336,10 @@
</span><span class="cx"> // FIXME: Use the enumeration cache.
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorGetOwnPropertySymbols(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     return JSValue::encode(ownPropertyKeys(exec, object, PropertyNameMode::Symbols, DontEnumPropertiesMode::Include));
</span><span class="cx"> }
</span><span class="lines">@@ -331,8 +347,10 @@
</span><span class="cx"> // FIXME: Use the enumeration cache.
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorKeys(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     return JSValue::encode(ownPropertyKeys(exec, object, PropertyNameMode::Strings, DontEnumPropertiesMode::Exclude));
</span><span class="cx"> }
</span><span class="lines">@@ -339,8 +357,10 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL ownEnumerablePropertyKeys(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = exec-&gt;argument(0).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     return JSValue::encode(ownPropertyKeys(exec, object, PropertyNameMode::StringsAndSymbols, DontEnumPropertiesMode::Exclude));
</span><span class="cx"> }
</span><span class="lines">@@ -360,40 +380,40 @@
</span><span class="cx"> 
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().enumerable)) {
</span><span class="cx">         JSValue value = description-&gt;get(exec, exec-&gt;propertyNames().enumerable);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         desc.setEnumerable(value.toBoolean(exec));
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().configurable)) {
</span><span class="cx">         JSValue value = description-&gt;get(exec, exec-&gt;propertyNames().configurable);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         desc.setConfigurable(value.toBoolean(exec));
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSValue value;
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().value)) {
</span><span class="cx">         JSValue value = description-&gt;get(exec, exec-&gt;propertyNames().value);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         desc.setValue(value);
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().writable)) {
</span><span class="cx">         JSValue value = description-&gt;get(exec, exec-&gt;propertyNames().writable);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         desc.setWritable(value.toBoolean(exec));
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().get)) {
</span><span class="cx">         JSValue get = description-&gt;get(exec, exec-&gt;propertyNames().get);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (!get.isUndefined()) {
</span><span class="cx">             CallData callData;
</span><span class="lines">@@ -403,12 +423,12 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         desc.setGetter(get);
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (description-&gt;hasProperty(exec, exec-&gt;propertyNames().set)) {
</span><span class="cx">         JSValue set = description-&gt;get(exec, exec-&gt;propertyNames().set);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (!set.isUndefined()) {
</span><span class="cx">             CallData callData;
</span><span class="lines">@@ -418,7 +438,7 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         desc.setSetter(set);
</span><del>-    } else if (vm.exception())
</del><ins>+    } else if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!desc.isAccessorDescriptor())
</span><span class="lines">@@ -445,7 +465,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Properties can only be defined on Objects.&quot;));
</span><span class="cx">     JSObject* obj = asObject(exec-&gt;argument(0));
</span><span class="cx">     auto propertyName = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="cx">     auto success = toPropertyDescriptor(exec, exec-&gt;argument(2), descriptor);
</span><span class="lines">@@ -453,7 +473,7 @@
</span><span class="cx">     if (!success)
</span><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx">     ASSERT((descriptor.attributes() &amp; Accessor) || (!descriptor.isAccessorDescriptor()));
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     obj-&gt;methodTable(vm)-&gt;defineOwnProperty(obj, exec, propertyName, descriptor, true);
</span><span class="cx">     scope.release();
</span><span class="cx">     return JSValue::encode(obj);
</span><span class="lines">@@ -461,9 +481,12 @@
</span><span class="cx"> 
</span><span class="cx"> static JSValue defineProperties(ExecState* exec, JSObject* object, JSObject* properties)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     PropertyNameArray propertyNames(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    asObject(properties)-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(asObject(properties), exec, propertyNames, EnumerationMode(DontEnumPropertiesMode::Exclude));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    asObject(properties)-&gt;methodTable(vm)-&gt;getOwnPropertyNames(asObject(properties), exec, propertyNames, EnumerationMode(DontEnumPropertiesMode::Exclude));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsNull();
</span><span class="cx">     size_t numProperties = propertyNames.size();
</span><span class="cx">     Vector&lt;PropertyDescriptor&gt; descriptors;
</span><span class="lines">@@ -470,7 +493,7 @@
</span><span class="cx">     MarkedArgumentBuffer markBuffer;
</span><span class="cx">     for (size_t i = 0; i &lt; numProperties; i++) {
</span><span class="cx">         JSValue prop = properties-&gt;get(exec, propertyNames[i]);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsNull();
</span><span class="cx">         PropertyDescriptor descriptor;
</span><span class="cx">         if (!toPropertyDescriptor(exec, prop, descriptor))
</span><span class="lines">@@ -490,8 +513,8 @@
</span><span class="cx">         Identifier propertyName = propertyNames[i];
</span><span class="cx">         if (exec-&gt;propertyNames().isPrivateName(propertyName))
</span><span class="cx">             continue;
</span><del>-        object-&gt;methodTable(exec-&gt;vm())-&gt;defineOwnProperty(object, exec, propertyName, descriptors[i], true);
-        if (exec-&gt;hadException())
</del><ins>+        object-&gt;methodTable(vm)-&gt;defineOwnProperty(object, exec, propertyName, descriptors[i], true);
+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsNull();
</span><span class="cx">     }
</span><span class="cx">     return object;
</span><span class="lines">@@ -531,6 +554,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorSeal(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 1. If Type(O) is not Object, return O.
</span><span class="cx">     JSValue obj = exec-&gt;argument(0);
</span><span class="cx">     if (!obj.isObject())
</span><span class="lines">@@ -538,14 +564,14 @@
</span><span class="cx">     JSObject* object = asObject(obj);
</span><span class="cx"> 
</span><span class="cx">     if (isJSFinalObject(object)) {
</span><del>-        object-&gt;seal(exec-&gt;vm());
</del><ins>+        object-&gt;seal(vm);
</ins><span class="cx">         return JSValue::encode(obj);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 2. For each named own property name P of O,
</span><span class="cx">     PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(obj);
</span><span class="cx">     PropertyNameArray::const_iterator end = properties.end();
</span><span class="cx">     for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
</span><span class="lines">@@ -559,14 +585,14 @@
</span><span class="cx">         // b. If desc.[[Configurable]] is true, set desc.[[Configurable]] to false.
</span><span class="cx">         desc.setConfigurable(false);
</span><span class="cx">         // c. Call the [[DefineOwnProperty]] internal method of O with P, desc, and true as arguments.
</span><del>-        object-&gt;methodTable(exec-&gt;vm())-&gt;defineOwnProperty(object, exec, propertyName, desc, true);
-        if (exec-&gt;hadException())
</del><ins>+        object-&gt;methodTable(vm)-&gt;defineOwnProperty(object, exec, propertyName, desc, true);
+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(obj);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 3. Set the [[Extensible]] internal property of O to false.
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;preventExtensions(object, exec);
-    if (exec-&gt;hadException())
</del><ins>+    object-&gt;methodTable(vm)-&gt;preventExtensions(object, exec);
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     // 4. Return O.
</span><span class="lines">@@ -575,15 +601,18 @@
</span><span class="cx"> 
</span><span class="cx"> JSObject* objectConstructorFreeze(ExecState* exec, JSObject* object)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (isJSFinalObject(object) &amp;&amp; !hasIndexedProperties(object-&gt;indexingType())) {
</span><del>-        object-&gt;freeze(exec-&gt;vm());
</del><ins>+        object-&gt;freeze(vm);
</ins><span class="cx">         return object;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 2. For each named own property name P of O,
</span><span class="cx">     PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return object;
</span><span class="cx">     PropertyNameArray::const_iterator end = properties.end();
</span><span class="cx">     for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
</span><span class="lines">@@ -601,14 +630,14 @@
</span><span class="cx">         // c. If desc.[[Configurable]] is true, set desc.[[Configurable]] to false.
</span><span class="cx">         desc.setConfigurable(false);
</span><span class="cx">         // d. Call the [[DefineOwnProperty]] internal method of O with P, desc, and true as arguments.
</span><del>-        object-&gt;methodTable(exec-&gt;vm())-&gt;defineOwnProperty(object, exec, propertyName, desc, true);
-        if (exec-&gt;hadException())
</del><ins>+        object-&gt;methodTable(vm)-&gt;defineOwnProperty(object, exec, propertyName, desc, true);
+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return object;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // 3. Set the [[Extensible]] internal property of O to false.
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;preventExtensions(object, exec);
-    if (exec-&gt;hadException())
</del><ins>+    object-&gt;methodTable(vm)-&gt;preventExtensions(object, exec);
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // 4. Return O.
</span><span class="lines">@@ -617,12 +646,14 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorFreeze(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     // 1. If Type(O) is not Object, return O.
</span><span class="cx">     JSValue obj = exec-&gt;argument(0);
</span><span class="cx">     if (!obj.isObject())
</span><span class="cx">         return JSValue::encode(obj);
</span><span class="cx">     JSObject* result = objectConstructorFreeze(exec, asObject(obj));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -639,6 +670,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorIsSealed(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 1. If Type(O) is not Object, return true.
</span><span class="cx">     JSValue obj = exec-&gt;argument(0);
</span><span class="cx">     if (!obj.isObject())
</span><span class="lines">@@ -646,12 +680,12 @@
</span><span class="cx">     JSObject* object = asObject(obj);
</span><span class="cx"> 
</span><span class="cx">     if (isJSFinalObject(object))
</span><del>-        return JSValue::encode(jsBoolean(object-&gt;isSealed(exec-&gt;vm())));
</del><ins>+        return JSValue::encode(jsBoolean(object-&gt;isSealed(vm)));
</ins><span class="cx"> 
</span><span class="cx">     // 2. For each named own property name P of O,
</span><span class="cx">     PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     PropertyNameArray::const_iterator end = properties.end();
</span><span class="cx">     for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
</span><span class="lines">@@ -670,7 +704,7 @@
</span><span class="cx">     // 3. If the [[Extensible]] internal property of O is false, then return true.
</span><span class="cx">     // 4. Otherwise, return false.
</span><span class="cx">     bool isExtensible = object-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(!isExtensible));
</span><span class="cx"> }
</span><span class="lines">@@ -677,6 +711,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorIsFrozen(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 1. If Type(O) is not Object, return true.
</span><span class="cx">     JSValue obj = exec-&gt;argument(0);
</span><span class="cx">     if (!obj.isObject())
</span><span class="lines">@@ -684,12 +721,12 @@
</span><span class="cx">     JSObject* object = asObject(obj);
</span><span class="cx"> 
</span><span class="cx">     if (isJSFinalObject(object))
</span><del>-        return JSValue::encode(jsBoolean(object-&gt;isFrozen(exec-&gt;vm())));
</del><ins>+        return JSValue::encode(jsBoolean(object-&gt;isFrozen(vm)));
</ins><span class="cx"> 
</span><span class="cx">     // 2. For each named own property name P of O,
</span><span class="cx">     PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     PropertyNameArray::const_iterator end = properties.end();
</span><span class="cx">     for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
</span><span class="lines">@@ -709,7 +746,7 @@
</span><span class="cx">     // 3. If the [[Extensible]] internal property of O is false, then return true.
</span><span class="cx">     // 4. Otherwise, return false.
</span><span class="cx">     bool isExtensible = object-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(!isExtensible));
</span><span class="cx"> }
</span><span class="lines">@@ -716,12 +753,14 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectConstructorIsExtensible(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue obj = exec-&gt;argument(0);
</span><span class="cx">     if (!obj.isObject())
</span><span class="cx">         return JSValue::encode(jsBoolean(false));
</span><span class="cx">     JSObject* object = asObject(obj);
</span><span class="cx">     bool isExtensible = object-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(isExtensible));
</span><span class="cx"> }
</span><span class="lines">@@ -735,13 +774,14 @@
</span><span class="cx"> JSArray* ownPropertyKeys(ExecState* exec, JSObject* object, PropertyNameMode propertyNameMode, DontEnumPropertiesMode dontEnumPropertiesMode)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     PropertyNameArray properties(exec, propertyNameMode);
</span><span class="cx">     object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(dontEnumPropertiesMode));
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSArray* keys = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     switch (propertyNameMode) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -101,8 +101,9 @@
</span><span class="cx"> inline JSObject* constructObjectFromPropertyDescriptor(ExecState* exec, const PropertyDescriptor&amp; descriptor)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* description = constructEmptyObject(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (!descriptor.isAccessorDescriptor()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -89,9 +89,12 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncHasOwnProperty(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSObject* thisObject = thisValue.toObject(exec);
</span><span class="cx">     if (!thisObject)
</span><span class="lines">@@ -101,6 +104,9 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncIsPrototypeOf(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx">     JSObject* thisObj = thisValue.toObject(exec);
</span><span class="cx">     if (!thisObj)
</span><span class="lines">@@ -109,9 +115,8 @@
</span><span class="cx">     if (!exec-&gt;argument(0).isObject())
</span><span class="cx">         return JSValue::encode(jsBoolean(false));
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     JSValue v = asObject(exec-&gt;argument(0))-&gt;getPrototype(vm, exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     while (true) {
</span><span class="lines">@@ -120,7 +125,7 @@
</span><span class="cx">         if (v == thisObj)
</span><span class="cx">             return JSValue::encode(jsBoolean(true));
</span><span class="cx">         v = asObject(v)-&gt;getPrototype(vm, exec);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -131,7 +136,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue get = exec-&gt;argument(1);
</span><span class="lines">@@ -140,7 +145,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;invalid getter usage&quot;));
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="lines">@@ -160,7 +165,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue set = exec-&gt;argument(1);
</span><span class="lines">@@ -169,7 +174,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;invalid setter usage&quot;));
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="lines">@@ -185,12 +190,15 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncLookupGetter(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty);
</span><span class="lines">@@ -212,12 +220,15 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncLookupSetter(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     PropertySlot slot(thisObject, PropertySlot::InternalMethodType::GetOwnProperty);
</span><span class="lines">@@ -239,12 +250,15 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncPropertyIsEnumerable(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto propertyName = exec-&gt;argument(0).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSObject* thisObject = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="cx">     bool enumerable = thisObject-&gt;getOwnPropertyDescriptor(exec, propertyName, descriptor) &amp;&amp; descriptor.enumerable();
</span><span class="lines">@@ -254,9 +268,12 @@
</span><span class="cx"> // 15.2.4.3 Object.prototype.toLocaleString()
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL objectProtoFuncToLocaleString(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // 1. Let O be the result of calling ToObject passing the this value as the argument.
</span><span class="cx">     JSObject* object = exec-&gt;thisValue().toThis(exec, StrictMode).toObject(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 2. Let toString be the result of calling the [[Get]] internal method of O passing &quot;toString&quot; as the argument.
</span><span class="lines">@@ -292,7 +309,7 @@
</span><span class="cx">     return JSValue::encode(thisObject-&gt;getPropertySlot(exec, toStringTagSymbol, [&amp;] (bool found, PropertySlot&amp; toStringTagSlot) -&gt; JSValue {
</span><span class="cx">         if (found) {
</span><span class="cx">             JSValue stringTag = toStringTagSlot.getValue(exec, toStringTagSymbol);
</span><del>-            if (UNLIKELY(vm.exception()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx">             if (stringTag.isString()) {
</span><span class="cx">                 JSRopeString::RopeBuilder ropeBuilder(vm);
</span><span class="lines">@@ -307,7 +324,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         String tag = thisObject-&gt;methodTable(exec-&gt;vm())-&gt;toStringName(thisObject, exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue();
</span><span class="cx">         String newString = WTF::tryMakeString(&quot;[object &quot;, WTFMove(tag), &quot;]&quot;);
</span><span class="cx">         if (!newString)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Operations.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Operations.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/Operations.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
</span><del>- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008, 2016 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  *  This library is free software; you can redistribute it and/or
</span><span class="cx">  *  modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -44,11 +44,12 @@
</span><span class="cx"> {
</span><span class="cx">     // exception for the Date exception in defaultValue()
</span><span class="cx">     VM&amp; vm = callFrame-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue p1 = v1.toPrimitive(callFrame);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx">     JSValue p2 = v2.toPrimitive(callFrame);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     if (p1.isString())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/Options.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -346,6 +346,7 @@
</span><span class="cx">     v(bool, useExceptionFuzz, false, Normal, nullptr) \
</span><span class="cx">     v(unsigned, fireExceptionFuzzAt, 0, Normal, nullptr) \
</span><span class="cx">     v(bool, validateDFGExceptionHandling, false, Normal, &quot;Causes the DFG to emit code validating exception handling for each node that can exit&quot;) /* This is true by default on Debug builds */\
</span><ins>+    v(bool, dumpSimulatedThrows, false, Normal, &quot;Dumps the call stack at each simulated throw for exception scope verification&quot;) \
</ins><span class="cx">     \
</span><span class="cx">     v(bool, useExecutableAllocationFuzz, false, Normal, nullptr) \
</span><span class="cx">     v(unsigned, fireExecutableAllocationFuzzAt, 0, Normal, nullptr) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePropertyDescriptorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -75,9 +75,11 @@
</span><span class="cx"> GetterSetter* PropertyDescriptor::slowGetterSetter(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSGlobalObject* globalObject = exec-&gt;lexicalGlobalObject();
</span><span class="cx">     GetterSetter* getterSetter = GetterSetter::create(vm, globalObject);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (m_getter &amp;&amp; !m_getter.isUndefined())
</span><span class="cx">         getterSetter-&gt;setGetter(vm, globalObject, jsCast&lt;JSObject*&gt;(m_getter));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProxyConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProxyConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProxyConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ProxyConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -55,23 +55,23 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL makeRevocableProxy(ExecState* exec)
</span><span class="cx"> {
</span><del>-    auto scope = DECLARE_THROW_SCOPE(exec-&gt;vm());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (exec-&gt;argumentCount() &lt; 2)
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Proxy.revocable needs to be called with two arguments: the target and the handler&quot;));
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     ArgList args(exec);
</span><span class="cx">     JSValue target = args.at(0);
</span><span class="cx">     JSValue handler = args.at(1);
</span><span class="cx">     ProxyObject* proxy = ProxyObject::create(exec, exec-&gt;lexicalGlobalObject(), target, handler);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     ProxyRevoke* revoke = ProxyRevoke::create(vm, exec-&gt;lexicalGlobalObject()-&gt;proxyRevokeStructure(), proxy);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     result-&gt;putDirect(vm, makeIdentifier(vm, &quot;proxy&quot;), proxy, None);
</span><span class="cx">     result-&gt;putDirect(vm, makeIdentifier(vm, &quot;revoke&quot;), revoke, None);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeProxyObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -53,12 +53,13 @@
</span><span class="cx"> String ProxyObject::toStringName(const JSObject* object, ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     const ProxyObject* proxy = jsCast&lt;const ProxyObject*&gt;(object);
</span><span class="cx">     while (proxy) {
</span><span class="cx">         const JSObject* target = proxy-&gt;target();
</span><span class="cx">         if (isArray(exec, target))
</span><span class="cx">             return target-&gt;classInfo()-&gt;methodTable.toStringName(target, exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         proxy = jsDynamicCast&lt;const ProxyObject*&gt;(target);
</span><span class="lines">@@ -140,7 +141,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue getHandler = handler-&gt;getMethod(exec, callData, callType, vm.propertyNames-&gt;get, ASCIILiteral(&quot;'get' property of a Proxy's handler object should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (getHandler.isUndefined())
</span><span class="lines">@@ -151,7 +152,7 @@
</span><span class="cx">     arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&amp;vm, propertyName.uid())));
</span><span class="cx">     arguments.append(receiver);
</span><span class="cx">     JSValue trapResult = call(exec, getHandler, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="lines">@@ -165,7 +166,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     return trapResult;
</span><span class="lines">@@ -173,8 +174,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool ProxyObject::performGet(ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue result = performProxyGet(exec, this, slot.thisValue(), propertyName);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     unsigned ignoredAttributes = 0;
</span><span class="cx">     slot.setValue(this, ignoredAttributes, result);
</span><span class="lines">@@ -208,7 +211,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue getOwnPropertyDescriptorMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;getOwnPropertyDescriptor&quot;), ASCIILiteral(&quot;'getOwnPropertyDescriptor' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (getOwnPropertyDescriptorMethod.isUndefined())
</span><span class="cx">         return performDefaultGetOwnProperty();
</span><span class="lines">@@ -217,7 +220,7 @@
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&amp;vm, propertyName.uid())));
</span><span class="cx">     JSValue trapResult = call(exec, getOwnPropertyDescriptorMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!trapResult.isUndefined() &amp;&amp; !trapResult.isObject()) {
</span><span class="lines">@@ -227,7 +230,7 @@
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor targetPropertyDescriptor;
</span><span class="cx">     bool isTargetPropertyDescriptorDefined = target-&gt;getOwnPropertyDescriptor(exec, propertyName, targetPropertyDescriptor);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (trapResult.isUndefined()) {
</span><span class="lines">@@ -240,7 +243,7 @@
</span><span class="cx">         // FIXME: this doesn't work if 'target' is another Proxy. We don't have isExtensible implemented in a way that fits w/ Proxys.
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=154375
</span><span class="cx">         bool isExtensible = target-&gt;isExtensible(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (!isExtensible) {
</span><span class="cx">             // FIXME: Come up with a test for this error. I'm not sure how to because
</span><span class="lines">@@ -254,11 +257,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool isExtensible = target-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     PropertyDescriptor trapResultAsDescriptor;
</span><span class="cx">     toPropertyDescriptor(exec, trapResult, trapResultAsDescriptor);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     bool throwException = false;
</span><span class="cx">     bool valid = validateAndApplyPropertyDescriptor(exec, nullptr, propertyName, isExtensible,
</span><span class="lines">@@ -277,7 +280,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (trapResultAsDescriptor.isAccessorDescriptor()) {
</span><span class="cx">         GetterSetter* getterSetter = trapResultAsDescriptor.slowGetterSetter(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         slot.setGetterSlot(this, trapResultAsDescriptor.attributes(), getterSetter);
</span><span class="cx">     } else if (trapResultAsDescriptor.isDataDescriptor() &amp;&amp; !trapResultAsDescriptor.value().isEmpty())
</span><span class="lines">@@ -316,7 +319,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue hasMethod = handler-&gt;getMethod(exec, callData, callType, vm.propertyNames-&gt;has, ASCIILiteral(&quot;'has' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (hasMethod.isUndefined())
</span><span class="cx">         return performDefaultHasProperty();
</span><span class="lines">@@ -325,17 +328,17 @@
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&amp;vm, propertyName.uid())));
</span><span class="cx">     JSValue trapResult = call(exec, hasMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!trapResultAsBool) {
</span><span class="cx">         PropertyDescriptor descriptor;
</span><span class="cx">         bool isPropertyDescriptorDefined = target-&gt;getOwnPropertyDescriptor(exec, propertyName, descriptor); 
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (isPropertyDescriptorDefined) {
</span><span class="cx">             if (!descriptor.configurable()) {
</span><span class="lines">@@ -343,7 +346,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">             }
</span><span class="cx">             bool isExtensible = target-&gt;isExtensible(exec);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return false;
</span><span class="cx">             if (!isExtensible) {
</span><span class="cx">                 throwVMTypeError(exec, scope, ASCIILiteral(&quot;Proxy 'has' must return 'true' for a non-extensible 'target' object with a configurable property&quot;));
</span><span class="lines">@@ -416,7 +419,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue setMethod = handler-&gt;getMethod(exec, callData, callType, vm.propertyNames-&gt;set, ASCIILiteral(&quot;'set' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="cx">     if (setMethod.isUndefined())
</span><span class="lines">@@ -428,10 +431,10 @@
</span><span class="cx">     arguments.append(putValue);
</span><span class="cx">     arguments.append(thisValue);
</span><span class="cx">     JSValue trapResult = call(exec, setMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (!trapResultAsBool)
</span><span class="cx">         return false;
</span><span class="lines">@@ -467,8 +470,9 @@
</span><span class="cx"> bool ProxyObject::putByIndexCommon(ExecState* exec, JSValue thisValue, unsigned propertyName, JSValue putValue, bool shouldThrow)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><del>-    Identifier ident = Identifier::from(exec, propertyName); 
-    if (exec-&gt;hadException())
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+    Identifier ident = Identifier::from(exec, propertyName);
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     auto performDefaultPut = [&amp;] () {
</span><span class="cx">         JSObject* target = this-&gt;target();
</span><span class="lines">@@ -502,7 +506,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue applyMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;apply&quot;), ASCIILiteral(&quot;'apply' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSObject* target = proxy-&gt;target();
</span><span class="cx">     if (applyMethod.isUndefined()) {
</span><span class="lines">@@ -513,7 +517,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSArray* argArray = constructArray(exec, static_cast&lt;ArrayAllocationProfile*&gt;(nullptr), ArgList(exec));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="lines">@@ -552,7 +556,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue constructMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;construct&quot;), ASCIILiteral(&quot;'construct' property of a Proxy's handler should be constructible&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSObject* target = proxy-&gt;target();
</span><span class="cx">     if (constructMethod.isUndefined()) {
</span><span class="lines">@@ -563,7 +567,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSArray* argArray = constructArray(exec, static_cast&lt;ArrayAllocationProfile*&gt;(nullptr), ArgList(exec));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="lines">@@ -570,7 +574,7 @@
</span><span class="cx">     arguments.append(argArray);
</span><span class="cx">     arguments.append(exec-&gt;newTarget());
</span><span class="cx">     JSValue result = call(exec, constructMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (!result.isObject())
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;Result from Proxy handler's 'construct' method should be an object&quot;));
</span><span class="lines">@@ -613,7 +617,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue deletePropertyMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;deleteProperty&quot;), ASCIILiteral(&quot;'deleteProperty' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="cx">     if (deletePropertyMethod.isUndefined())
</span><span class="lines">@@ -623,11 +627,11 @@
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&amp;vm, propertyName.uid())));
</span><span class="cx">     JSValue trapResult = call(exec, deletePropertyMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!trapResultAsBool)
</span><span class="lines">@@ -641,7 +645,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -687,7 +691,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue preventExtensionsMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;preventExtensions&quot;), ASCIILiteral(&quot;'preventExtensions' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="cx">     if (preventExtensionsMethod.isUndefined())
</span><span class="lines">@@ -696,16 +700,16 @@
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     JSValue trapResult = call(exec, preventExtensionsMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (trapResultAsBool) {
</span><span class="cx">         bool targetIsExtensible = target-&gt;isExtensible(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (targetIsExtensible) {
</span><span class="cx">             throwVMTypeError(exec, scope, ASCIILiteral(&quot;Proxy's 'preventExtensions' trap returned true even though its target is extensible. It should have returned false&quot;));
</span><span class="lines">@@ -740,7 +744,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue isExtensibleMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;isExtensible&quot;), ASCIILiteral(&quot;'isExtensible' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="lines">@@ -750,15 +754,15 @@
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     JSValue trapResult = call(exec, isExtensibleMethod, callType, callData, handler, arguments);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool isTargetExtensible = target-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (trapResultAsBool != isTargetExtensible) {
</span><span class="lines">@@ -807,7 +811,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue definePropertyMethod = handler-&gt;getMethod(exec, callData, callType, vm.propertyNames-&gt;defineProperty, ASCIILiteral(&quot;'defineProperty' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (definePropertyMethod.isUndefined())
</span><span class="lines">@@ -814,7 +818,7 @@
</span><span class="cx">         return performDefaultDefineOwnProperty();
</span><span class="cx"> 
</span><span class="cx">     JSObject* descriptorObject = constructObjectFromPropertyDescriptor(exec, descriptor);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="lines">@@ -822,11 +826,11 @@
</span><span class="cx">     arguments.append(identifierToSafePublicJSValue(vm, Identifier::fromUid(&amp;vm, propertyName.uid())));
</span><span class="cx">     arguments.append(descriptorObject);
</span><span class="cx">     JSValue trapResult = call(exec, definePropertyMethod, callType, callData, handler, arguments);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!trapResultAsBool)
</span><span class="lines">@@ -834,11 +838,11 @@
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor targetDescriptor;
</span><span class="cx">     bool isTargetDescriptorDefined = target-&gt;getOwnPropertyDescriptor(exec, propertyName, targetDescriptor);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool targetIsExtensible = target-&gt;isExtensible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     bool settingConfigurableToFalse = descriptor.configurablePresent() &amp;&amp; !descriptor.configurable();
</span><span class="cx"> 
</span><span class="lines">@@ -896,7 +900,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue ownKeysMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;ownKeys&quot;), ASCIILiteral(&quot;'ownKeys' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="cx">     if (ownKeysMethod.isUndefined()) {
</span><span class="lines">@@ -907,7 +911,7 @@
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     JSValue arrayLikeObject = call(exec, ownKeysMethod, callType, callData, handler, arguments);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     PropertyNameMode propertyNameMode = trapResult.mode();
</span><span class="lines">@@ -935,7 +939,7 @@
</span><span class="cx">             return dontExitEarly;
</span><span class="cx"> 
</span><span class="cx">         Identifier ident = value.toPropertyKey(exec);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return doExitEarly;
</span><span class="cx"> 
</span><span class="cx">         uncheckedResultKeys.add(ident.impl());
</span><span class="lines">@@ -944,7 +948,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     createListFromArrayLike(exec, arrayLikeObject, dontThrowAnExceptionTypeFilter, ASCIILiteral(&quot;Proxy handler's 'ownKeys' method must return an array-like object containing only Strings and Symbols&quot;), addPropName);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     bool targetIsExensible = target-&gt;isExtensible(exec);
</span><span class="lines">@@ -951,7 +955,7 @@
</span><span class="cx"> 
</span><span class="cx">     PropertyNameArray targetKeys(&amp;vm, propertyNameMode);
</span><span class="cx">     target-&gt;methodTable(vm)-&gt;getOwnPropertyNames(target, exec, targetKeys, enumerationMode);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     Vector&lt;UniquedStringImpl*&gt; targetConfigurableKeys;
</span><span class="cx">     Vector&lt;UniquedStringImpl*&gt; targetNonConfigurableKeys;
</span><span class="lines">@@ -958,7 +962,7 @@
</span><span class="cx">     for (const Identifier&amp; ident : targetKeys) {
</span><span class="cx">         PropertyDescriptor descriptor;
</span><span class="cx">         bool isPropertyDefined = target-&gt;getOwnPropertyDescriptor(exec, ident.impl(), descriptor); 
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         if (isPropertyDefined &amp;&amp; !descriptor.configurable())
</span><span class="cx">             targetNonConfigurableKeys.append(ident.impl());
</span><span class="lines">@@ -1047,7 +1051,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue setPrototypeOfMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;setPrototypeOf&quot;), ASCIILiteral(&quot;'setPrototypeOf' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="lines">@@ -1058,11 +1062,11 @@
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     arguments.append(prototype);
</span><span class="cx">     JSValue trapResult = call(exec, setPrototypeOfMethod, callType, callData, handler, arguments);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     bool trapResultAsBool = trapResult.toBoolean(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     
</span><span class="cx">     if (!trapResultAsBool) {
</span><span class="lines">@@ -1072,13 +1076,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool targetIsExtensible = target-&gt;isExtensible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (targetIsExtensible)
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     JSValue targetPrototype = target-&gt;getPrototype(vm, exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (!sameValue(exec, prototype, targetPrototype)) {
</span><span class="cx">         throwVMTypeError(exec, scope, ASCIILiteral(&quot;Proxy 'setPrototypeOf' trap returned true when its target is non-extensible and the new prototype value is not the same as the current prototype value. It should have returned false&quot;));
</span><span class="lines">@@ -1112,7 +1116,7 @@
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue getPrototypeOfMethod = handler-&gt;getMethod(exec, callData, callType, makeIdentifier(vm, &quot;getPrototypeOf&quot;), ASCIILiteral(&quot;'getPrototypeOf' property of a Proxy's handler should be callable&quot;));
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     JSObject* target = this-&gt;target();
</span><span class="lines">@@ -1122,7 +1126,7 @@
</span><span class="cx">     MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(target);
</span><span class="cx">     JSValue trapResult = call(exec, getPrototypeOfMethod, callType, callData, handler, arguments);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx"> 
</span><span class="cx">     if (!trapResult.isObject() &amp;&amp; !trapResult.isNull()) {
</span><span class="lines">@@ -1131,13 +1135,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool targetIsExtensible = target-&gt;isExtensible(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx">     if (targetIsExtensible)
</span><span class="cx">         return trapResult;
</span><span class="cx"> 
</span><span class="cx">     JSValue targetPrototype = target-&gt;getPrototype(vm, exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue();
</span><span class="cx">     if (!sameValue(exec, targetPrototype, trapResult)) {
</span><span class="cx">         throwVMTypeError(exec, scope, ASCIILiteral(&quot;Proxy's 'getPrototypeOf' trap for a non-extensible target should return the same value as the target's prototype&quot;));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeReflectObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ReflectObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">         arguments.append(value);
</span><span class="cx">         return false;
</span><span class="cx">     });
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(construct(exec, target, constructType, constructData, arguments, newTarget));
</span><span class="lines">@@ -139,7 +139,7 @@
</span><span class="cx">     if (!target.isObject())
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral(&quot;Reflect.defineProperty requires the first argument be an object&quot;)));
</span><span class="cx">     auto propertyName = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     PropertyDescriptor descriptor;
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">     if (!toPropertyDescriptor(exec, exec-&gt;argument(2), descriptor))
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT((descriptor.attributes() &amp; Accessor) || (!descriptor.isAccessorDescriptor()));
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     // Reflect.defineProperty should not throw an error when the defineOwnProperty operation fails.
</span><span class="cx">     bool shouldThrow = false;
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral(&quot;Reflect.get requires the first argument be an object&quot;)));
</span><span class="cx"> 
</span><span class="cx">     const Identifier propertyName = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsNull());
</span><span class="cx"> 
</span><span class="cx">     JSValue receiver = target;
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral(&quot;Reflect.getOwnPropertyDescriptor requires the first argument be an object&quot;)));
</span><span class="cx"> 
</span><span class="cx">     auto key = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(objectConstructorGetOwnPropertyDescriptor(exec, asObject(target), key));
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral(&quot;Reflect.isExtensible requires the first argument be an object&quot;)));
</span><span class="cx"> 
</span><span class="cx">     bool isExtensible = asObject(target)-&gt;isExtensible(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(isExtensible));
</span><span class="cx"> }
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope, ASCIILiteral(&quot;Reflect.preventExtensions requires the first argument be an object&quot;)));
</span><span class="cx">     JSObject* object = asObject(target);
</span><span class="cx">     bool result = object-&gt;methodTable(vm)-&gt;preventExtensions(object, exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(result));
</span><span class="cx"> }
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">     JSObject* targetObject = asObject(target);
</span><span class="cx"> 
</span><span class="cx">     auto propertyName = exec-&gt;argument(1).toPropertyKey(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue receiver = target;
</span><span class="lines">@@ -307,7 +307,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool shouldThrowIfCantSet = false;
</span><span class="cx">     bool didSetPrototype = object-&gt;setPrototype(vm, exec, proto, shouldThrowIfCantSet);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     return JSValue::encode(jsBoolean(didSetPrototype));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -216,13 +216,13 @@
</span><span class="cx">     if (flags.isUndefined())
</span><span class="cx">         return NoFlags;
</span><span class="cx">     JSString* flagsString = flags.toString(exec);
</span><ins>+    ASSERT(scope.exception() || flagsString);
</ins><span class="cx">     if (!flagsString) {
</span><del>-        ASSERT(exec-&gt;hadException());
</del><span class="cx">         return InvalidFlags;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RegExpFlags result = regExpFlags(flagsString-&gt;value(exec));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return InvalidFlags;
</span><span class="cx">     if (result == InvalidFlags)
</span><span class="cx">         throwSyntaxError(exec, scope, ASCIILiteral(&quot;Invalid flags supplied to RegExp constructor.&quot;));
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String pattern = patternArg.isUndefined() ? emptyString() : patternArg.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RegExpFlags flags = toFlags(exec, flagsArg);
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx">         return throwException(exec, scope, createSyntaxError(exec, regExp-&gt;errorMessage()));
</span><span class="cx"> 
</span><span class="cx">     Structure* structure = getRegExpStructure(exec, globalObject, newTarget);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     return RegExpObject::create(vm, structure, regExp);
</span><span class="cx"> }
</span><span class="lines">@@ -255,6 +255,7 @@
</span><span class="cx"> JSObject* constructRegExp(ExecState* exec, JSGlobalObject* globalObject, const ArgList&amp; args,  JSObject* callee, JSValue newTarget)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue patternArg = args.at(0);
</span><span class="cx">     JSValue flagsArg = args.at(1);
</span><span class="cx"> 
</span><span class="lines">@@ -263,7 +264,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (newTarget.isUndefined() &amp;&amp; constructAsRegexp &amp;&amp; flagsArg.isUndefined()) {
</span><span class="cx">         JSValue constructor = patternArg.get(exec, vm.propertyNames-&gt;constructor);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         if (callee == constructor) {
</span><span class="cx">             // We know that patternArg is a object otherwise constructAsRegexp would be false.
</span><span class="lines">@@ -274,7 +275,7 @@
</span><span class="cx">     if (isPatternRegExp) {
</span><span class="cx">         RegExp* regExp = jsCast&lt;RegExpObject*&gt;(patternArg)-&gt;regExp();
</span><span class="cx">         Structure* structure = getRegExpStructure(exec, globalObject, newTarget);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="cx">         if (!flagsArg.isUndefined()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -133,12 +133,13 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE bool isRegExp(VM&amp; vm, ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     if (!value.isObject())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSObject* object = asObject(value);
</span><span class="cx">     JSValue matchValue = object-&gt;get(exec, vm.propertyNames-&gt;matchSymbol);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (!matchValue.isUndefined())
</span><span class="cx">         return matchValue.toBoolean(exec);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">     static unsigned maxSizeForDirectPath = 100000;
</span><span class="cx">     
</span><span class="cx">     JSArray* array = constructEmptyArray(exec, nullptr);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto iterate = [&amp;] () {
</span><span class="lines">@@ -233,14 +233,14 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue RegExpObject::matchGlobal(ExecState* exec, JSGlobalObject* globalObject, JSString* string)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     RegExp* regExp = this-&gt;regExp();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(regExp-&gt;global());
</span><span class="cx"> 
</span><del>-    VM* vm = &amp;globalObject-&gt;vm();
-
</del><span class="cx">     setLastIndex(exec, 0);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     String s = string-&gt;value(exec);
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     if (regExp-&gt;unicode()) {
</span><span class="cx">         unsigned stringLength = s.length();
</span><span class="cx">         return collectMatches(
</span><del>-            *vm, exec, string, s, regExpConstructor, regExp,
</del><ins>+            vm, exec, string, s, regExpConstructor, regExp,
</ins><span class="cx">             [&amp;] (size_t end) -&gt; size_t {
</span><span class="cx">                 return advanceStringUnicode(s, stringLength, end);
</span><span class="cx">             });
</span><span class="lines">@@ -256,7 +256,7 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return collectMatches(
</span><del>-        *vm, exec, string, s, regExpConstructor, regExp,
</del><ins>+        vm, exec, string, s, regExpConstructor, regExp,
</ins><span class="cx">         [&amp;] (size_t end) -&gt; size_t {
</span><span class="cx">             return end + 1;
</span><span class="cx">         });
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -159,13 +159,13 @@
</span><span class="cx">         regExp = asRegExpObject(arg0)-&gt;regExp();
</span><span class="cx">     } else {
</span><span class="cx">         String pattern = !exec-&gt;argumentCount() ? emptyString() : arg0.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         RegExpFlags flags = NoFlags;
</span><span class="cx">         if (!arg1.isUndefined()) {
</span><span class="cx">             flags = regExpFlags(arg1.toString(exec)-&gt;value(exec));
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             if (flags == InvalidFlags)
</span><span class="cx">                 return throwVMError(exec, scope, createSyntaxError(exec, ASCIILiteral(&quot;Invalid flags supplied to RegExp constructor.&quot;)));
</span><span class="lines">@@ -189,21 +189,22 @@
</span><span class="cx">     string[0] = 0;
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue globalValue = regexp-&gt;get(exec, exec-&gt;propertyNames().global);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return string;
</span><span class="cx">     JSValue ignoreCaseValue = regexp-&gt;get(exec, exec-&gt;propertyNames().ignoreCase);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return string;
</span><span class="cx">     JSValue multilineValue = regexp-&gt;get(exec, exec-&gt;propertyNames().multiline);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return string;
</span><span class="cx">     JSValue unicodeValue = regexp-&gt;get(exec, exec-&gt;propertyNames().unicode);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return string;
</span><span class="cx">     JSValue stickyValue = regexp-&gt;get(exec, exec-&gt;propertyNames().sticky);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return string;
</span><span class="cx"> 
</span><span class="cx">     unsigned index = 0;
</span><span class="lines">@@ -238,17 +239,17 @@
</span><span class="cx">         return JSValue::encode(earlyReturnValue);
</span><span class="cx"> 
</span><span class="cx">     JSValue sourceValue = thisObject-&gt;get(exec, vm.propertyNames-&gt;source);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     String source = sourceValue.toString(exec)-&gt;value(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue flagsValue = thisObject-&gt;get(exec, vm.propertyNames-&gt;flags);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     String flags = flagsValue.toString(exec)-&gt;value(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, '/', source, '/', flags));
</span><span class="lines">@@ -339,7 +340,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope, ASCIILiteral(&quot;The RegExp.prototype.flags getter can only be called on an object&quot;));
</span><span class="cx"> 
</span><span class="cx">     auto flags = flagsString(exec, asObject(thisValue));
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(jsString(exec, flags.data()));
</span><span class="lines">@@ -472,12 +473,13 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL regExpProtoFuncSearchFast(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     RegExp* regExp = asRegExpObject(thisValue)-&gt;regExp();
</span><span class="cx"> 
</span><span class="cx">     JSString* string = exec-&gt;uncheckedArgument(0).toString(exec);
</span><span class="cx">     String s = string-&gt;value(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     RegExpConstructor* regExpConstructor = exec-&gt;lexicalGlobalObject()-&gt;regExpConstructor();
</span><span class="lines">@@ -586,7 +588,7 @@
</span><span class="cx">     // 3. [handled by JS builtin] Let S be ? ToString(string).
</span><span class="cx">     JSString* inputString = exec-&gt;argument(0).toString(exec);
</span><span class="cx">     String input = inputString-&gt;value(exec);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(!input.isNull());
</span><span class="cx"> 
</span><span class="lines">@@ -601,7 +603,7 @@
</span><span class="cx">     // 11. Let A be ArrayCreate(0).
</span><span class="cx">     // 12. Let lengthA be 0.
</span><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     unsigned resultLength = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSetConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/SetConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">         return JSValue::encode(set);
</span><span class="cx"> 
</span><span class="cx">     JSValue adderFunction = set-&gt;get(exec, exec-&gt;propertyNames().add);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     CallData adderFunctionCallData;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         double codePointAsDouble = exec-&gt;uncheckedArgument(i).toNumber(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         uint32_t codePoint = static_cast&lt;uint32_t&gt;(codePointAsDouble);
</span><span class="lines">@@ -122,10 +122,11 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     JSGlobalObject* globalObject = asInternalFunction(exec-&gt;callee())-&gt;globalObject();
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     Structure* structure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), globalObject-&gt;stringObjectStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     if (!exec-&gt;argumentCount())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/StringObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -108,6 +108,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool StringObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor&amp; descriptor, bool throwException)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     StringObject* thisObject = jsCast&lt;StringObject*&gt;(object);
</span><span class="cx"> 
</span><span class="cx">     if (isStringOwnProperty(exec, thisObject, propertyName)) {
</span><span class="lines">@@ -120,7 +122,7 @@
</span><span class="cx">         bool isCurrentDefined = thisObject-&gt;getOwnPropertyDescriptor(exec, propertyName, current);
</span><span class="cx">         ASSERT(isCurrentDefined);
</span><span class="cx">         bool isExtensible = thisObject-&gt;isExtensible(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         return validateAndApplyPropertyDescriptor(exec, nullptr, propertyName, isExtensible, descriptor, isCurrentDefined, current, throwException);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -477,9 +477,11 @@
</span><span class="cx">     VM&amp; vm, ExecState* exec, JSString* string, JSValue searchValue, CallData&amp; callData,
</span><span class="cx">     CallType callType, String&amp; replacementString, JSValue replaceValue)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     const String&amp; source = string-&gt;value(exec);
</span><span class="cx">     unsigned sourceLen = source.length();
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     RegExpObject* regExpObject = asRegExpObject(searchValue);
</span><span class="cx">     RegExp* regExp = regExpObject-&gt;regExp();
</span><span class="lines">@@ -488,7 +490,7 @@
</span><span class="cx">     if (global) {
</span><span class="cx">         // ES5.1 15.5.4.10 step 8.a.
</span><span class="cx">         regExpObject-&gt;setLastIndex(exec, 0);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (callType == CallType::None &amp;&amp; !replacementString.length())
</span><span class="lines">@@ -511,7 +513,7 @@
</span><span class="cx">         int argCount = regExp-&gt;numSubpatterns() + 1 + 2;
</span><span class="cx">         JSFunction* func = jsCast&lt;JSFunction*&gt;(replaceValue);
</span><span class="cx">         CachedCall cachedCall(exec, func, argCount);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (source.is8Bit()) {
</span><span class="cx">             while (true) {
</span><span class="lines">@@ -539,7 +541,7 @@
</span><span class="cx">                 cachedCall.setThis(jsUndefined());
</span><span class="cx">                 JSValue jsResult = cachedCall.call();
</span><span class="cx">                 replacements.append(jsResult.toString(exec)-&gt;value(exec));
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">                 lastIndex = result.end;
</span><span class="lines">@@ -578,7 +580,7 @@
</span><span class="cx">                 cachedCall.setThis(jsUndefined());
</span><span class="cx">                 JSValue jsResult = cachedCall.call();
</span><span class="cx">                 replacements.append(jsResult.toString(exec)-&gt;value(exec));
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">                 lastIndex = result.end;
</span><span class="lines">@@ -618,7 +620,7 @@
</span><span class="cx">                 args.append(string);
</span><span class="cx"> 
</span><span class="cx">                 replacements.append(call(exec, replaceValue, callType, callData, jsUndefined(), args).toString(exec)-&gt;value(exec));
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">             } else {
</span><span class="cx">                 int replLen = replacementString.length();
</span><span class="lines">@@ -658,12 +660,13 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    
</del><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     RegExp* regExp = searchValue-&gt;regExp();
</span><span class="cx">     if (regExp-&gt;global()) {
</span><span class="cx">         // ES5.1 15.5.4.10 step 8.a.
</span><span class="cx">         searchValue-&gt;setLastIndex(exec, 0);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         return removeUsingRegExpSearch(vm, exec, thisValue, thisValue-&gt;value(exec), regExp);
</span><span class="cx">     }
</span><span class="lines">@@ -688,12 +691,14 @@
</span><span class="cx"> 
</span><span class="cx"> static ALWAYS_INLINE EncodedJSValue replaceUsingRegExpSearch(VM&amp; vm, ExecState* exec, JSString* string, JSValue searchValue, JSValue replaceValue)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     String replacementString;
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = getCallData(replaceValue, callData);
</span><span class="cx">     if (callType == CallType::None) {
</span><span class="cx">         replacementString = replaceValue.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -701,11 +706,13 @@
</span><span class="cx">         vm, exec, string, searchValue, callData, callType, replacementString, replaceValue);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ALWAYS_INLINE EncodedJSValue replaceUsingStringSearch(VM&amp;, ExecState* exec, JSString* jsString, JSValue searchValue, JSValue replaceValue)
</del><ins>+static ALWAYS_INLINE EncodedJSValue replaceUsingStringSearch(VM&amp; vm, ExecState* exec, JSString* jsString, JSValue searchValue, JSValue replaceValue)
</ins><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     const String&amp; string = jsString-&gt;value(exec);
</span><span class="cx">     String searchString = searchValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     size_t matchStart = string.find(searchString);
</span><span class="lines">@@ -721,12 +728,12 @@
</span><span class="cx">         args.append(jsNumber(matchStart));
</span><span class="cx">         args.append(jsString);
</span><span class="cx">         replaceValue = call(exec, replaceValue, callType, callData, jsUndefined(), args);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String replaceString = replaceValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     StringImpl* stringImpl = string.impl();
</span><span class="lines">@@ -811,7 +818,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     JSString* string = thisValue.toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return replace(vm, exec, string, searchValue, replaceValue);
</span><span class="cx"> }
</span><span class="lines">@@ -818,8 +825,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncReplaceUsingRegExp(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSString* string = exec-&gt;thisValue().toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue searchValue = exec-&gt;argument(0);
</span><span class="lines">@@ -831,8 +841,11 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncReplaceUsingStringSearch(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSString* string = exec-&gt;thisValue().toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return replaceUsingStringSearch(exec-&gt;vm(), exec, string, exec-&gt;argument(0), exec-&gt;argument(1));
</span><span class="lines">@@ -941,7 +954,7 @@
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     double doublePosition = argument0.toInteger(exec);
</span><span class="lines">@@ -1053,7 +1066,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     int len = s.length();
</span><span class="lines">@@ -1111,6 +1124,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncSplitFast(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     ASSERT(checkObjectCoercible(thisValue));
</span><span class="cx"> 
</span><span class="lines">@@ -1117,7 +1131,7 @@
</span><span class="cx">     // 3. Let S be the result of calling ToString, giving it the this value as its argument.
</span><span class="cx">     // 7. Let s be the number of characters in S.
</span><span class="cx">     String input = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(!input.isNull());
</span><span class="cx"> 
</span><span class="lines">@@ -1124,7 +1138,7 @@
</span><span class="cx">     // 4. Let A be a new array created as if by the expression new Array()
</span><span class="cx">     //    where Array is the standard built-in constructor with that name.
</span><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 5. Let lengthA be 0.
</span><span class="lines">@@ -1141,7 +1155,7 @@
</span><span class="cx">     //    otherwise let R = ToString(separator).
</span><span class="cx">     JSValue separatorValue = exec-&gt;uncheckedArgument(0);
</span><span class="cx">     String separator = separatorValue.toString(exec)-&gt;value(exec);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 10. If lim == 0, return A.
</span><span class="lines">@@ -1250,7 +1264,7 @@
</span><span class="cx">         len = jsString-&gt;length();
</span><span class="cx">     } else {
</span><span class="cx">         uString = thisValue.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         len = uString.length();
</span><span class="cx">     }
</span><span class="lines">@@ -1303,7 +1317,7 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     JSString* jsString = thisValue.toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="lines">@@ -1377,12 +1391,12 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="cx">     String str = a0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsNumber(Collator().collate(s, str)));
</span><span class="cx"> }
</span><span class="lines">@@ -1403,7 +1417,7 @@
</span><span class="cx">     const String&amp; s = sVal-&gt;value(state);
</span><span class="cx"> 
</span><span class="cx">     // 3. ReturnIfAbrupt(S).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // Optimization for empty strings.
</span><span class="lines">@@ -1414,7 +1428,7 @@
</span><span class="cx">     Vector&lt;String&gt; requestedLocales = canonicalizeLocaleList(*state, state-&gt;argument(0));
</span><span class="cx"> 
</span><span class="cx">     // 5. ReturnIfAbrupt(requestedLocales).
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     // 6. Let len be the number of elements in requestedLocales.
</span><span class="lines">@@ -1498,7 +1512,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;big&gt;&quot;, s, &quot;&lt;/big&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1512,7 +1526,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;small&gt;&quot;, s, &quot;&lt;/small&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1526,7 +1540,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;blink&gt;&quot;, s, &quot;&lt;/blink&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1540,7 +1554,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;b&gt;&quot;, s, &quot;&lt;/b&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1554,7 +1568,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;tt&gt;&quot;, s, &quot;&lt;/tt&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1568,7 +1582,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;i&gt;&quot;, s, &quot;&lt;/i&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1582,7 +1596,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;strike&gt;&quot;, s, &quot;&lt;/strike&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1596,7 +1610,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;sub&gt;&quot;, s, &quot;&lt;/sub&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1610,7 +1624,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(jsMakeNontrivialString(exec, &quot;&lt;sup&gt;&quot;, s, &quot;&lt;/sup&gt;&quot;));
</span><span class="cx"> }
</span><span class="lines">@@ -1624,7 +1638,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="lines">@@ -1643,7 +1657,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="lines">@@ -1698,7 +1712,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="lines">@@ -1717,7 +1731,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     String s = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="lines">@@ -1765,7 +1779,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwTypeError(exec, scope);
</span><span class="cx">     String str = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     unsigned left = 0;
</span><span class="lines">@@ -1823,18 +1837,18 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     String stringToSearchIn = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="cx">     bool isRegularExpression = isRegExp(vm, exec, a0);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     if (isRegularExpression)
</span><span class="cx">         return throwVMTypeError(exec, scope, &quot;Argument to String.prototype.startsWith cannot be a RegExp&quot;);
</span><span class="cx"> 
</span><span class="cx">     String searchString = a0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue positionArg = exec-&gt;argument(1);
</span><span class="lines">@@ -1844,7 +1858,7 @@
</span><span class="cx">     else {
</span><span class="cx">         unsigned length = stringToSearchIn.length();
</span><span class="cx">         start = clampAndTruncateToUnsigned(positionArg.toInteger(exec), 0, length);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1861,18 +1875,18 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     String stringToSearchIn = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="cx">     bool isRegularExpression = isRegExp(vm, exec, a0);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     if (isRegularExpression)
</span><span class="cx">         return throwVMTypeError(exec, scope, &quot;Argument to String.prototype.endsWith cannot be a RegExp&quot;);
</span><span class="cx"> 
</span><span class="cx">     String searchString = a0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     unsigned length = stringToSearchIn.length();
</span><span class="lines">@@ -1883,7 +1897,7 @@
</span><span class="cx">         end = std::max(0, endPositionArg.asInt32());
</span><span class="cx">     else if (!endPositionArg.isUndefined()) {
</span><span class="cx">         end = clampAndTruncateToUnsigned(endPositionArg.toInteger(exec), 0, length);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1892,6 +1906,7 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL stringIncludesImpl(VM&amp; vm, ExecState* exec, String stringToSearchIn, String searchString, JSValue positionArg)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     unsigned start = 0;
</span><span class="cx">     if (positionArg.isInt32())
</span><span class="cx">         start = std::max(0, positionArg.asInt32());
</span><span class="lines">@@ -1898,7 +1913,7 @@
</span><span class="cx">     else {
</span><span class="cx">         unsigned length = stringToSearchIn.length();
</span><span class="cx">         start = clampAndTruncateToUnsigned(positionArg.toInteger(exec), 0, length);
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1915,18 +1930,18 @@
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx"> 
</span><span class="cx">     String stringToSearchIn = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;argument(0);
</span><span class="cx">     bool isRegularExpression = isRegExp(vm, exec, a0);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     if (isRegularExpression)
</span><span class="cx">         return throwVMTypeError(exec, scope, &quot;Argument to String.prototype.includes cannot be a RegExp&quot;);
</span><span class="cx"> 
</span><span class="cx">     String searchString = a0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue positionArg = exec-&gt;argument(1);
</span><span class="lines">@@ -1936,17 +1951,19 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL builtinStringIncludesInternal(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     ASSERT(checkObjectCoercible(thisValue));
</span><span class="cx"> 
</span><span class="cx">     String stringToSearchIn = thisValue.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue a0 = exec-&gt;uncheckedArgument(0);
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     String searchString = a0.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSValue positionArg = exec-&gt;argument(1);
</span><span class="lines">@@ -2002,7 +2019,7 @@
</span><span class="cx">     if (!checkObjectCoercible(thisValue))
</span><span class="cx">         return throwVMTypeError(exec, scope);
</span><span class="cx">     JSString::SafeView source = thisValue.toString(exec)-&gt;view(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     UNormalizationMode form = UNORM_NFC;
</span><span class="lines">@@ -2009,7 +2026,7 @@
</span><span class="cx">     // Verify that the argument is provided and is not undefined.
</span><span class="cx">     if (!exec-&gt;argument(0).isUndefined()) {
</span><span class="cx">         String formString = exec-&gt;uncheckedArgument(0).toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (formString == &quot;NFC&quot;)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/SymbolConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -96,11 +96,14 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL symbolConstructorFor(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSString* stringKey = exec-&gt;argument(0).toString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     String string = stringKey-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     return JSValue::encode(Symbol::create(exec-&gt;vm(), exec-&gt;vm().symbolRegistry().symbolForKey(string)));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTemplateRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -45,12 +45,13 @@
</span><span class="cx">         return cached;
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     unsigned count = templateKey.cookedStrings().size();
</span><span class="cx">     JSArray* templateObject = constructEmptyArray(exec, nullptr, count);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     JSArray* rawObject = constructEmptyArray(exec, nullptr, count);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned index = 0; index &lt; count; ++index) {
</span><span class="lines">@@ -59,12 +60,12 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     objectConstructorFreeze(exec, rawObject);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     templateObject-&gt;putDirect(vm, exec-&gt;propertyNames().raw, rawObject, ReadOnly | DontEnum | DontDelete);
</span><span class="cx"> 
</span><span class="cx">     objectConstructorFreeze(exec, templateObject);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     m_templateMap.set(templateKey, templateObject);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeThrowScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ThrowScope.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ThrowScope.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ThrowScope.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -26,256 +26,26 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ThrowScope.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;Exception.h&quot;
</ins><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx">     
</span><del>-#if ENABLE(THROW_SCOPE_VERIFICATION)
</del><ins>+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
</ins><span class="cx"> 
</span><del>-namespace {
-
-// Logs all ThrowScope activity to help debug the source of a verification failure.
-bool traceOn = false;
-
-// A more verbose logging option to dump the C++ stack trace at strategic points to aid debugging.
-bool traceWithStackTraces = false;
-
-// Disabled temporarily until all known verification failures are fixed.
-bool verificationOn = false;
-
-unsigned traceCount = 0;
-};
-
-/*
-    ThrowScope verification works to simulate exception throws and catch cases where
-    exception checks are missing. This is how it works:
-
- 1. The VM has a m_needExceptionCheck bit that indicates where an exception check is
-    needed. You can think of the m_needExceptionCheck bit being set as a simulated
-    throw.
-
- 2. Every throw site must declare a ThrowScope instance using DECLARE_THROW_SCOPE at
-    the top of its function (as early as possible) e.g.

-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-            throwException(exec, scope, ...);
-        }
-
-    Note: VM::throwException() methods are private, and only calleableby the ThrowScope
-    friend class. All throws must go through a ThrowScope. Hence, we are guaranteed that
-    any function that can throw will have a ThrowScope.
-
-    Note: by convention, every throw helper function must take a ThrowScope argument
-    instead of instantiating its own ThrowScope.  This allows the throw to be attributed
-    to the client code rather than the throw helper itself.
-
- 3. Verification of needed exception checks
-
-    a. On construction, each ThrowScope will verify that VM::m_needExceptionCheck is
-       not set.

-       This ensures that the caller of the current function has checked for exceptions
-       where needed before doing more work which led to calling the current function.
-
-    b. On destruction, each ThrowScope will verify that VM::m_needExceptionCheck is
-       not set. This verification will be skipped if the ThrowScope has been released
-       (see (5) below).
-
-       This ensures that the function that owns this ThrowScope is not missing any
-       exception checks before returning.

-    c. When throwing an exception, the ThrowScope will verify that VM::m_needExceptionCheck
-       is not set, unless it's been ask to rethrow the same Exception object.
-
- 4. Simulated throws
-
-    Throws are simulated by setting the m_needExceptionCheck bit.
-
-    The bit will only be set in the ThrowScope destructor except when the ThrowScope
-    detects the caller is a LLInt or JIT function. LLInt or JIT functions will always
-    check for exceptions after a host C++ function returns to it. However, they will
-    not clear the m_needExceptionCheck bit.
-
-    Hence, if the ThrowScope destructor detects the caller is a LLInt or JIT function,
-    it will just skip the setting of the bit.
-
-    Note: there is no need, and it is incorrect to set the m_needExceptionCheck bit
-    in the throwException methods. This is because, in practice, we always return
-    immediately after throwing an exception. It doesn't make sense to set the bit in
-    the throw just to have to clear it immediately after before we do verification in
-    the ThrowScope destructor.
-
- 5. Using ThrowScope::release()
-
-    ThrowScope::release() should only be used at the bottom of a function if:

-    a. This function is going to let its caller check and handle the exception.

-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-            auto result = goo(); // may throw.
-
-            ... // Cleanup code that will are not affected by a pending exceptions.
-
-            scope.release(); // tell the ThrowScope that the caller will handle the exception.
-            return result;
-        }

-    b. This function is going to do a tail call that may throw.
-
-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-            ...
-            scope.release(); // tell the ThrowScope that the caller will handle the exception.
-            return goo(); // may throw.
-        }

-    ThrowScope::release() should not be used in the code paths that branch. For example:

-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-
-            auto result = goo1(); // may throw.
-            scope.release(); // &lt;=================== the WRONG way !!!
-            if (result)
-                return;

-            result = goo2(); // may throw.
-            ...
-            return result;
-        }

-    The above will result in a verification failure in goo2()'s ThrowScope.  The proper way
-    to fix this verification is to do wither (6) or (7) below.

-  6. Checking exceptions with ThrowScope::exception()

-     ThrowScope::exception() returns the thrown Exception object if there is one pending.
-     Else it returns nullptr.

-     It also clears the m_needExceptionCheck bit thereby indicating that we've satisifed
-     the needed exception check.

-     This is how we do it:

-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-
-            auto result = goo1(); // may throw.
-            if (scope.exception())
-                return;
-
-            result = goo2(); // may throw.
-            ...
-            return result;
-        }

-    But sometimes, for optimization reasons, we may choose to test the result of the callee
-    function instead doing a load of the VM exception value. See (7) below.

- 7. Checking exception by checking callee result

-    This approach should only be applied when it makes a difference to performance.
-    If we need to do this, we should add an ASSERT() that invokes ThrowScope::exception()
-    and verify the result. Since ThrowScope verification is only done on DEBUG builds,
-    this ASSERT will satisfy the verification requirements while not impacting performance.

-    This is how we do it:
-
-        void foo(...)
-        {
-            auto scope = DECLARE_THROW_SCOPE(vm);
-
-            bool failed = goo1(); // may throw.
-            ASSERT(!!scope.exception() == failed)
-            if (failed)
-                return;
-
-            result = goo2(); // may throw.
-            ...
-            return result;
-        }

- 8. Debugging verification failures.
-
-    a. When verification fails, you will see a helpful message followed by an assertion failure.
-       For example:

-    FAILED exception check verification:
-        Exception thrown from ThrowScope [2] Exit: setUpCall @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1245
-        is unchecked in ThrowScope [1]: varargsSetup @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1398
-
-       The message tells you that failure was detected at in varargsSetup() @ LLIntSlowPaths.cpp
-       line 1398, and that the missing exception check should have happened somewhere between
-       the call to setUpCall() @ LLIntSlowPaths.cpp line 1245 and it.
-
-       If that is insufficient information, you can ...
-
-    b. Turn on ThrowScope tracing

-       Just set traceOn=true at the top of ThrowScope.cpp, and rebuild. Thereafter, you should
-       see a trace of ThrowScopes being entered and exited as well as their depth e.g.
-
-    ThrowScope [1] Enter: llint_slow_path_jfalse @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1032
-    ThrowScope [1] Exit: llint_slow_path_jfalse @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1032
-
-       You will also see traces of simulated throws e.g.
-
-    ThrowScope [2] Throw from: setUpCall @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1245
-
-       If that is insufficient information, you can ...
-
-    c. Turn on ThrowScope stack dumps
-
-       Just set traceWithStackTraces=true at the top of ThrowScope.cpp, and rebuild.
-       Thereafter, you should see a stack traces at various relevant ThrowScope events.
-
-    d. Using throwScopePrintIfNeedCheck()
-
-       If you have isolated the missing exception check to a function that is large but
-       is unsure which statement can throw and is missing the check, you can sprinkle
-       the function with calls to throwScopePrintIfNeedCheck().
-
-       throwScopePrintIfNeedCheck() will log a line &quot;Need exception check at ...&quot; that
-       inlcudes the file and line number only when it see the m_needExceptionCheck set.
-       This will tell you which statement simulated the throw that is not being checked
-       i.e. the one that preceded the throwScopePrintIfNeedCheck() that printed a line.
-*/
-
-ThrowScope::ThrowScope(VM&amp; vm, ThrowScopeLocation location)
-    : m_vm(vm)
-    , m_previousScope(vm.m_topThrowScope)
-    , m_location(location)
-    , m_depth(m_previousScope ? m_previousScope-&gt;m_depth + 1 : 0)
</del><ins>+ThrowScope::ThrowScope(VM&amp; vm, ExceptionEventLocation location)
+    : ExceptionScope(vm, location)
</ins><span class="cx"> {
</span><del>-    m_vm.m_topThrowScope = this;
-
-    if (traceOn) {
-        dataLog(&quot;&lt;&quot;, traceCount++, &quot;&gt; ThrowScope [&quot;, m_depth, &quot;] Enter: &quot;, location.functionName, &quot; @ &quot;, location.file, &quot;:&quot;, location.line);
-        if (m_vm.m_needExceptionCheck)
-            dataLog(&quot;, needs check&quot;);
-        dataLog(&quot;\n&quot;);
-
-        if (traceWithStackTraces)
-            WTFReportBacktrace();
-    }
-
-    verifyExceptionCheckNeedIsSatisfied(Site::ScopeEntry);
</del><ins>+    m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ThrowScope::~ThrowScope()
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT(m_vm.m_topThrowScope);
</del><ins>+    RELEASE_ASSERT(m_vm.m_topExceptionScope);
</ins><span class="cx"> 
</span><span class="cx">     if (!m_isReleased)
</span><del>-        verifyExceptionCheckNeedIsSatisfied(Site::ScopeExit);
</del><ins>+        m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
</ins><span class="cx">     else {
</span><span class="cx">         // If we released the scope, that means we're letting our callers do the
</span><span class="cx">         // exception check. However, because our caller may be a LLInt or JIT
</span><span class="lines">@@ -298,26 +68,12 @@
</span><span class="cx">     
</span><span class="cx">     if (!willBeHandleByLLIntOrJIT)
</span><span class="cx">         simulateThrow();
</span><del>-
-    if (traceOn) {
-        dataLog(&quot;&lt;&quot;, traceCount++, &quot;&gt; ThrowScope [&quot;, m_depth, &quot;] Exit: &quot;, m_location.functionName, &quot; @ &quot;, m_location.file, &quot;:&quot;, m_location.line);
-        if (!willBeHandleByLLIntOrJIT)
-            dataLog(&quot;, with rethrow&quot;);
-        if (m_vm.m_needExceptionCheck)
-            dataLog(&quot;, needs check&quot;);
-        dataLog(&quot;\n&quot;);
-
-        if (traceWithStackTraces)
-            WTFReportBacktrace();
-    }
-
-    m_vm.m_topThrowScope = m_previousScope;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ThrowScope::throwException(ExecState* exec, Exception* exception)
</span><span class="cx"> {
</span><span class="cx">     if (m_vm.exception() &amp;&amp; m_vm.exception() != exception)
</span><del>-        verifyExceptionCheckNeedIsSatisfied(Site::Throw);
</del><ins>+        m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
</ins><span class="cx">     
</span><span class="cx">     m_vm.throwException(exec, exception);
</span><span class="cx"> }
</span><span class="lines">@@ -325,7 +81,7 @@
</span><span class="cx"> JSValue ThrowScope::throwException(ExecState* exec, JSValue error)
</span><span class="cx"> {
</span><span class="cx">     if (!error.isCell() || !jsDynamicCast&lt;Exception*&gt;(error.asCell()))
</span><del>-        verifyExceptionCheckNeedIsSatisfied(Site::Throw);
</del><ins>+        m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
</ins><span class="cx">     
</span><span class="cx">     return m_vm.throwException(exec, error);
</span><span class="cx"> }
</span><span class="lines">@@ -333,63 +89,25 @@
</span><span class="cx"> JSObject* ThrowScope::throwException(ExecState* exec, JSObject* obj)
</span><span class="cx"> {
</span><span class="cx">     if (!jsDynamicCast&lt;Exception*&gt;(obj))
</span><del>-        verifyExceptionCheckNeedIsSatisfied(Site::Throw);
</del><ins>+        m_vm.verifyExceptionCheckNeedIsSatisfied(m_recursionDepth, m_location);
</ins><span class="cx">     
</span><span class="cx">     return m_vm.throwException(exec, obj);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThrowScope::printIfNeedCheck(const char* functionName, const char* file, unsigned line)
-{
-    if (m_vm.m_needExceptionCheck)
-        dataLog(&quot;&lt;&quot;, traceCount++, &quot;&gt; Need exception check at &quot;, functionName, &quot; @ &quot;, file, &quot;:&quot;, line, &quot;\n&quot;);
-}
-
</del><span class="cx"> void ThrowScope::simulateThrow()
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT(m_vm.m_topThrowScope);
</del><ins>+    RELEASE_ASSERT(m_vm.m_topExceptionScope);
</ins><span class="cx">     m_vm.m_simulatedThrowPointLocation = m_location;
</span><del>-    m_vm.m_simulatedThrowPointDepth = m_depth;
</del><ins>+    m_vm.m_simulatedThrowPointRecursionDepth = m_recursionDepth;
</ins><span class="cx">     m_vm.m_needExceptionCheck = true;
</span><span class="cx"> 
</span><del>-    if (traceOn) {
-        dataLog(&quot;&lt;&quot;, traceCount++, &quot;&gt; ThrowScope [&quot;, m_depth, &quot;] Throw from: &quot;, m_location.functionName, &quot; @ &quot;, m_location.file, &quot;:&quot;, m_location.line, &quot;\n&quot;);
-        if (traceWithStackTraces)
-            WTFReportBacktrace();
</del><ins>+    if (Options::dumpSimulatedThrows()) {
+        dataLog(&quot;Simulated throw from this scope: &quot;, m_location, &quot;\n&quot;);
+        dataLog(&quot;    (ExceptionScope::m_recursionDepth was &quot;, m_recursionDepth, &quot;)\n&quot;);
+        WTFReportBacktrace();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThrowScope::verifyExceptionCheckNeedIsSatisfied(ThrowScope::Site site)
-{
-    if (!verificationOn)
-        return;
-
-    if (UNLIKELY(m_vm.m_needExceptionCheck)) {
-        auto failDepth = m_vm.m_simulatedThrowPointDepth;
-        auto&amp; failLocation = m_vm.m_simulatedThrowPointLocation;
-
-        auto siteName = [] (Site site) -&gt; const char* {
-            switch (site) {
-            case Site::ScopeEntry:
-                return &quot;Entry&quot;;
-            case Site::ScopeExit:
-                return &quot;Exit&quot;;
-            case Site::Throw:
-                return &quot;Throw&quot;;
-            }
-            RELEASE_ASSERT_NOT_REACHED();
-            return nullptr;
-        };
-
-        dataLog(
-            &quot;FAILED exception check verification:\n&quot;
-            &quot;    Exception thrown from ThrowScope [&quot;, failDepth, &quot;] &quot;, siteName(site), &quot;: &quot;, failLocation.functionName, &quot; @ &quot;, failLocation.file, &quot;:&quot;, failLocation.line, &quot;\n&quot;
-            &quot;    is unchecked in ThrowScope [&quot;, m_depth, &quot;]: &quot;, m_location.functionName, &quot; @ &quot;, m_location.file, &quot;:&quot;, m_location.line, &quot;\n&quot;
-            &quot;\n&quot;);
-
-        RELEASE_ASSERT(!m_vm.m_needExceptionCheck);
-    }
-}
-
-#endif // ENABLE(THROW_SCOPE_VERIFICATION)
</del><ins>+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
</ins><span class="cx">     
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeThrowScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ThrowScope.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ThrowScope.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ThrowScope.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -26,8 +26,7 @@
</span><span class="cx"> #ifndef ThrowScope_h
</span><span class="cx"> #define ThrowScope_h
</span><span class="cx"> 
</span><del>-#include &quot;Exception.h&quot;
-#include &quot;VM.h&quot;
</del><ins>+#include &quot;ExceptionScope.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -34,80 +33,62 @@
</span><span class="cx"> class ExecState;
</span><span class="cx"> class JSObject;
</span><span class="cx"> 
</span><del>-#if ENABLE(THROW_SCOPE_VERIFICATION)
</del><ins>+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
</ins><span class="cx"> 
</span><del>-class ThrowScope {
</del><ins>+// If a function can throw a JS exception, it should declare a ThrowScope at the
+// top of the function (as early as possible) using the DECLARE_THROW_SCOPE macro.
+// Declaring a ThrowScope in a function means that the function may throw an
+// exception that its caller will have to handle.
+
+class ThrowScope : public ExceptionScope {
</ins><span class="cx"> public:
</span><del>-    JS_EXPORT_PRIVATE ThrowScope(VM&amp;, ThrowScopeLocation);
</del><ins>+    JS_EXPORT_PRIVATE ThrowScope(VM&amp;, ExceptionEventLocation);
</ins><span class="cx">     JS_EXPORT_PRIVATE ~ThrowScope();
</span><span class="cx"> 
</span><span class="cx">     ThrowScope(const ThrowScope&amp;) = delete;
</span><span class="cx">     ThrowScope(ThrowScope&amp;&amp;) = default;
</span><span class="cx"> 
</span><del>-    VM&amp; vm() const { return m_vm; }
-
</del><span class="cx">     JS_EXPORT_PRIVATE void throwException(ExecState*, Exception*);
</span><span class="cx">     JS_EXPORT_PRIVATE JSValue throwException(ExecState*, JSValue);
</span><span class="cx">     JS_EXPORT_PRIVATE JSObject* throwException(ExecState*, JSObject*);
</span><span class="cx"> 
</span><del>-    inline Exception* exception()
-    {
-        m_vm.m_needExceptionCheck = false;
-        return m_vm.exception();
-    }
</del><ins>+    void release() { m_isReleased = true; }
</ins><span class="cx"> 
</span><del>-    inline void release() { m_isReleased = true; }
-
</del><span class="cx">     JS_EXPORT_PRIVATE void printIfNeedCheck(const char* functionName, const char* file, unsigned line);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void simulateThrow();
</span><span class="cx"> 
</span><del>-    enum class Site {
-        ScopeEntry,
-        ScopeExit,
-        Throw
-    };
-    void verifyExceptionCheckNeedIsSatisfied(Site);
-
-    VM&amp; m_vm;
-    ThrowScope* m_previousScope;
-    ThrowScopeLocation m_location;
-    unsigned m_depth;
</del><span class="cx">     bool m_isReleased { false };
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define DECLARE_THROW_SCOPE(vm__) \
</span><del>-    JSC::ThrowScope((vm__), JSC::ThrowScopeLocation(__FUNCTION__, __FILE__, __LINE__))
</del><ins>+    JSC::ThrowScope((vm__), JSC::ExceptionEventLocation(__FUNCTION__, __FILE__, __LINE__))
</ins><span class="cx"> 
</span><span class="cx"> #define throwScopePrintIfNeedCheck(scope__) \
</span><span class="cx">     scope__.printIfNeedCheck(__FUNCTION__, __FILE__, __LINE__)
</span><span class="cx"> 
</span><del>-#else // not ENABLE(THROW_SCOPE_VERIFICATION)
</del><ins>+#else // not ENABLE(EXCEPTION_SCOPE_VERIFICATION)
</ins><span class="cx"> 
</span><del>-class ThrowScope {
</del><ins>+class ThrowScope : public ExceptionScope {
</ins><span class="cx"> public:
</span><del>-    ThrowScope(VM&amp; vm)
-        : m_vm(vm)
</del><ins>+    ALWAYS_INLINE ThrowScope(VM&amp; vm)
+        : ExceptionScope(vm)
</ins><span class="cx">     { }
</span><ins>+    ThrowScope(const ThrowScope&amp;) = delete;
+    ThrowScope(ThrowScope&amp;&amp;) = default;
</ins><span class="cx"> 
</span><del>-    VM&amp; vm() const { return m_vm; }
-    
-    void throwException(ExecState* exec, Exception* exception) { m_vm.throwException(exec, exception); }
-    JSValue throwException(ExecState* exec, JSValue value) { return m_vm.throwException(exec, value); }
-    JSObject* throwException(ExecState* exec, JSObject* obj) { return m_vm.throwException(exec, obj); }
-    
-    Exception* exception() { return m_vm.exception(); }
-    void release() { }
-    
-private:
-    VM&amp; m_vm;
</del><ins>+    ALWAYS_INLINE void throwException(ExecState* exec, Exception* exception) { m_vm.throwException(exec, exception); }
+    ALWAYS_INLINE JSValue throwException(ExecState* exec, JSValue value) { return m_vm.throwException(exec, value); }
+    ALWAYS_INLINE JSObject* throwException(ExecState* exec, JSObject* obj) { return m_vm.throwException(exec, obj); }
+
+    ALWAYS_INLINE void release() { }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define DECLARE_THROW_SCOPE(vm__) \
</span><span class="cx">     JSC::ThrowScope((vm__))
</span><span class="cx"> 
</span><del>-#endif // ENABLE(THROW_SCOPE_VERIFICATION)
</del><ins>+#endif // ENABLE(EXCEPTION_SCOPE_VERIFICATION)
</ins><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE void throwException(ExecState* exec, ThrowScope&amp; scope, Exception* exception)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeThrowScopeLocationh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/runtime/ThrowScopeLocation.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ThrowScopeLocation.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/ThrowScopeLocation.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-/*
- * Copyright (C) 2016 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 INC. OR
- * 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.
- */
-
-#pragma once
-
-namespace JSC {
-
-struct ThrowScopeLocation {
-    ThrowScopeLocation() { }
-    ThrowScopeLocation(const char* functionName, const char* file, unsigned line)
-        : functionName(functionName)
-        , file(file)
-        , line(line)
-    { }
-    
-    const char* functionName { nullptr };
-    const char* file { nullptr };
-    unsigned line { 0 };
-};
-
-} // namespace JSC
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -894,4 +894,28 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // !ENABLE(JIT)
</span><span class="cx"> 
</span><ins>+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+void VM::verifyExceptionCheckNeedIsSatisfied(unsigned recursionDepth, ExceptionEventLocation&amp; location)
+{
+    if (!m_verifyExceptionEvents)
+        return;
+
+    if (UNLIKELY(m_needExceptionCheck)) {
+        auto throwDepth = m_simulatedThrowPointRecursionDepth;
+        auto&amp; throwLocation = m_simulatedThrowPointLocation;
+
+        dataLog(
+            &quot;ERROR: Unchecked JS exception:\n&quot;
+            &quot;    This scope can throw a JS exception: &quot;, throwLocation, &quot;\n&quot;
+            &quot;        (ExceptionScope::m_recursionDepth was  &quot;, throwDepth, &quot;)\n&quot;
+            &quot;    But the exception was unchecked as of this scope: &quot;, location, &quot;\n&quot;
+            &quot;        (ExceptionScope::m_recursionDepth was  &quot;, recursionDepth, &quot;)\n&quot;
+            &quot;\n&quot;);
+        WTFReportBacktrace();
+
+        RELEASE_ASSERT(!m_needExceptionCheck);
+    }
+}
+#endif
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;ConcurrentJITLock.h&quot;
</span><span class="cx"> #include &quot;ControlFlowProfiler.h&quot;
</span><span class="cx"> #include &quot;DateInstanceCache.h&quot;
</span><ins>+#include &quot;ExceptionEventLocation.h&quot;
</ins><span class="cx"> #include &quot;ExecutableAllocator.h&quot;
</span><span class="cx"> #include &quot;FunctionHasExecutedCache.h&quot;
</span><span class="cx"> #include &quot;Heap.h&quot;
</span><span class="lines">@@ -47,7 +48,6 @@
</span><span class="cx"> #include &quot;SmallStrings.h&quot;
</span><span class="cx"> #include &quot;SourceCode.h&quot;
</span><span class="cx"> #include &quot;Strong.h&quot;
</span><del>-#include &quot;ThrowScopeLocation.h&quot;
</del><span class="cx"> #include &quot;ThunkGenerators.h&quot;
</span><span class="cx"> #include &quot;TypedArrayController.h&quot;
</span><span class="cx"> #include &quot;VMEntryRecord.h&quot;
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> class CustomGetterSetter;
</span><span class="cx"> class ExecState;
</span><span class="cx"> class Exception;
</span><ins>+class ExceptionScope;
</ins><span class="cx"> class HandleStack;
</span><span class="cx"> class TypeProfiler;
</span><span class="cx"> class TypeProfilerLog;
</span><span class="lines">@@ -112,7 +113,6 @@
</span><span class="cx"> class RegExp;
</span><span class="cx"> #endif
</span><span class="cx"> class Symbol;
</span><del>-class ThrowScope;
</del><span class="cx"> class UnlinkedCodeBlock;
</span><span class="cx"> class UnlinkedEvalCodeBlock;
</span><span class="cx"> class UnlinkedFunctionExecutable;
</span><span class="lines">@@ -447,12 +447,10 @@
</span><span class="cx"> 
</span><span class="cx">     void restorePreviousException(Exception* exception) { setException(exception); }
</span><span class="cx"> 
</span><del>-    void clearException() { m_exception = nullptr; }
</del><span class="cx">     void clearLastException() { m_lastException = nullptr; }
</span><span class="cx"> 
</span><span class="cx">     ExecState** addressOfCallFrameForCatch() { return &amp;callFrameForCatch; }
</span><span class="cx"> 
</span><del>-    Exception* exception() const { return m_exception; }
</del><span class="cx">     JSCell** addressOfException() { return reinterpret_cast&lt;JSCell**&gt;(&amp;m_exception); }
</span><span class="cx"> 
</span><span class="cx">     Exception* lastException() const { return m_lastException; }
</span><span class="lines">@@ -648,6 +646,20 @@
</span><span class="cx">         m_exception = exception;
</span><span class="cx">         m_lastException = exception;
</span><span class="cx">     }
</span><ins>+    Exception* exception() const
+    {
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+        m_needExceptionCheck = false;
+#endif
+        return m_exception;
+    }
+    void clearException()
+    {
+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+        m_needExceptionCheck = false;
+#endif
+        m_exception = nullptr;
+    }
</ins><span class="cx"> 
</span><span class="cx"> #if !ENABLE(JIT)    
</span><span class="cx">     bool ensureStackCapacityForCLoop(Register* newTopOfStack);
</span><span class="lines">@@ -658,6 +670,10 @@
</span><span class="cx">     JS_EXPORT_PRIVATE JSValue throwException(ExecState*, JSValue);
</span><span class="cx">     JS_EXPORT_PRIVATE JSObject* throwException(ExecState*, JSObject*);
</span><span class="cx"> 
</span><ins>+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    void verifyExceptionCheckNeedIsSatisfied(unsigned depth, ExceptionEventLocation&amp;);
+#endif
+
</ins><span class="cx"> #if ENABLE(ASSEMBLER)
</span><span class="cx">     bool m_canUseAssembler;
</span><span class="cx"> #endif
</span><span class="lines">@@ -682,11 +698,14 @@
</span><span class="cx"> 
</span><span class="cx">     Exception* m_exception { nullptr };
</span><span class="cx">     Exception* m_lastException { nullptr };
</span><del>-#if ENABLE(THROW_SCOPE_VERIFICATION)
-    ThrowScope* m_topThrowScope { nullptr };
-    ThrowScopeLocation m_simulatedThrowPointLocation;
-    unsigned m_simulatedThrowPointDepth { 0 };
</del><ins>+#if ENABLE(EXCEPTION_SCOPE_VERIFICATION)
+    ExceptionScope* m_topExceptionScope { nullptr };
+    ExceptionEventLocation m_simulatedThrowPointLocation;
+    unsigned m_simulatedThrowPointRecursionDepth { 0 };
</ins><span class="cx">     mutable bool m_needExceptionCheck { false };
</span><ins>+
+    // Disabled temporarily until all known verification failures are fixed.
+    bool m_verifyExceptionEvents { false };
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool m_failNextNewCodeBlock { false };
</span><span class="lines">@@ -712,6 +731,10 @@
</span><span class="cx">     std::unique_ptr&lt;ShadowChicken&gt; m_shadowChicken;
</span><span class="cx">     std::unique_ptr&lt;BytecodeIntrinsicRegistry&gt; m_bytecodeIntrinsicRegistry;
</span><span class="cx"> 
</span><ins>+    // Friends for exception checking purpose only.
+    friend class Heap;
+    friend class CatchScope;
+    friend class ExceptionScope;
</ins><span class="cx">     friend class ThrowScope;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakMapConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = asInternalFunction(exec-&gt;callee())-&gt;globalObject();
</span><span class="cx">     Structure* weakMapStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), globalObject-&gt;weakMapStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     JSWeakMap* weakMap = JSWeakMap::create(exec, weakMapStructure);
</span><span class="cx">     JSValue iterable = exec-&gt;argument(0);
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">         return JSValue::encode(weakMap);
</span><span class="cx"> 
</span><span class="cx">     JSValue adderFunction = weakMap-&gt;JSObject::get(exec, exec-&gt;propertyNames().set);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     CallData adderFunctionCallData;
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">         return JSValue::encode(throwTypeError(exec, scope));
</span><span class="cx"> 
</span><span class="cx">     forEachInIterable(exec, iterable, [&amp;](VM&amp; vm, ExecState* exec, JSValue nextItem) {
</span><ins>+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         if (!nextItem.isObject()) {
</span><span class="cx">             throwTypeError(exec, scope);
</span><span class="cx">             return;
</span><span class="lines">@@ -82,11 +83,11 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         JSValue key = nextItem.get(exec, static_cast&lt;unsigned&gt;(0));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         JSValue value = nextItem.get(exec, static_cast&lt;unsigned&gt;(1));
</span><del>-        if (vm.exception())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         MarkedArgumentBuffer arguments;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeWeakSetConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/runtime/WeakSetConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject = asInternalFunction(exec-&gt;callee())-&gt;globalObject();
</span><span class="cx">     Structure* weakSetStructure = InternalFunction::createSubclassStructure(exec, exec-&gt;newTarget(), globalObject-&gt;weakSetStructure());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     JSWeakSet* weakSet = JSWeakSet::create(exec, weakSetStructure);
</span><span class="cx">     JSValue iterable = exec-&gt;argument(0);
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">         return JSValue::encode(weakSet);
</span><span class="cx"> 
</span><span class="cx">     JSValue adderFunction = weakSet-&gt;JSObject::get(exec, exec-&gt;propertyNames().add);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     CallData adderFunctionCallData;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretoolsJSDollarVMPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/JavaScriptCore/tools/JSDollarVMPrototype.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -307,9 +307,10 @@
</span><span class="cx"> 
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionPrint(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(exec-&gt;vm());
</ins><span class="cx">     for (unsigned i = 0; i &lt; exec-&gt;argumentCount(); ++i) {
</span><span class="cx">         String argStr = exec-&gt;uncheckedArgument(i).toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         dataLog(argStr);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WTF/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        * wtf/Platform.h:
+
</ins><span class="cx"> 2016-09-07  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Separate compile flag for ReadableStream and WritableStream
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WTF/wtf/Platform.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -918,8 +918,8 @@
</span><span class="cx"> #define ENABLE_MASM_PROBE 0
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#ifndef ENABLE_THROW_SCOPE_VERIFICATION
-#define ENABLE_THROW_SCOPE_VERIFICATION (!defined(NDEBUG))
</del><ins>+#ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION
+#define ENABLE_EXCEPTION_SCOPE_VERIFICATION (!defined(NDEBUG))
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,515 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        No new test because there is no behavior change in general except for 1 bug fix.
+        That bug is already caught by existing tests with the introduction of the CatchScope.
+
+        Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
+        a failed attempt to get the handleEvent callback is not handled.
+
+        * ForwardingHeaders/runtime/CatchScope.h: Added.
+        * Modules/encryptedmedia/CDMSessionClearKey.cpp:
+        (WebCore::CDMSessionClearKey::update):
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::putOrAdd):
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
+        * Modules/mediastream/SDPProcessor.cpp:
+        (WebCore::SDPProcessor::callScript):
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
+        (WebCore::QuickTimePluginReplacement::installReplacement):
+        * bindings/js/ArrayValue.cpp:
+        (WebCore::ArrayValue::get):
+        * bindings/js/Dictionary.cpp:
+        (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSApplePaySessionCustom.cpp:
+        (WebCore::JSApplePaySession::completeShippingMethodSelection):
+        (WebCore::JSApplePaySession::completeShippingContactSelection):
+        (WebCore::JSApplePaySession::completePaymentMethodSelection):
+        * bindings/js/JSAudioTrackCustom.cpp:
+        (WebCore::JSAudioTrack::setKind):
+        (WebCore::JSAudioTrack::setLanguage):
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::constructJSBlob):
+        * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+        (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
+        * bindings/js/JSCommandLineAPIHostCustom.cpp:
+        (WebCore::getJSListenerFunctions):
+        * bindings/js/JSCryptoAlgorithmDictionary.cpp:
+        (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
+        (WebCore::getHashAlgorithm):
+        (WebCore::createAesCbcParams):
+        (WebCore::createAesKeyGenParams):
+        (WebCore::createHmacParams):
+        (WebCore::createHmacKeyParams):
+        (WebCore::createRsaKeyGenParams):
+        (WebCore::createRsaOaepParams):
+        (WebCore::createRsaSsaParams):
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::getJSArrayFromJSON):
+        (WebCore::getStringFromJSON):
+        (WebCore::getBooleanFromJSON):
+        (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
+        (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
+        (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
+        (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
+        (WebCore::JSCryptoKeySerializationJWK::keyData):
+        (WebCore::buildJSONForRSAComponents):
+        (WebCore::addUsagesToJSON):
+        (WebCore::JSCryptoKeySerializationJWK::serialize):
+        * bindings/js/JSCustomElementInterface.cpp:
+        (WebCore::JSCustomElementInterface::constructElement):
+        (WebCore::constructCustomElementSynchronously):
+        (WebCore::JSCustomElementInterface::upgradeElement):
+        * bindings/js/JSCustomElementRegistryCustom.cpp:
+        (WebCore::getCustomElementCallback):
+        (WebCore::JSCustomElementRegistry::define):
+        (WebCore::whenDefinedPromise):
+        (WebCore::JSCustomElementRegistry::whenDefined):
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::valueToUSVString):
+        (WebCore::reportException):
+        (WebCore::reportCurrentException):
+        (WebCore::setDOMException):
+        (WebCore::hasIteratorMethod):
+        (WebCore::toSmallerInt):
+        (WebCore::toSmallerUInt):
+        (WebCore::toInt32EnforceRange):
+        (WebCore::toUInt32EnforceRange):
+        (WebCore::toInt64EnforceRange):
+        (WebCore::toUInt64EnforceRange):
+        (WebCore::throwNotSupportedError):
+        (WebCore::throwInvalidStateError):
+        (WebCore::throwSecurityError):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::toJSSequence):
+        (WebCore::toJS):
+        (WebCore::jsFrozenArray):
+        (WebCore::NativeValueTraits&lt;String&gt;::nativeValue):
+        (WebCore::NativeValueTraits&lt;unsigned&gt;::nativeValue):
+        (WebCore::NativeValueTraits&lt;float&gt;::nativeValue):
+        (WebCore::NativeValueTraits&lt;double&gt;::nativeValue):
+        (WebCore::toNativeArray):
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::makeThisTypeErrorForBuiltins):
+        (WebCore::makeGetterTypeErrorForBuiltins):
+        * bindings/js/JSDOMGlobalObjectTask.cpp:
+        * bindings/js/JSDOMIterator.h:
+        (WebCore::iteratorForEach):
+        * bindings/js/JSDOMPromise.cpp:
+        (WebCore::rejectPromiseWithExceptionIfAny):
+        * bindings/js/JSDOMPromise.h:
+        (WebCore::callPromiseFunction):
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::putDelegate):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowMicrotaskCallback::call):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::setLocation):
+        (WebCore::JSDOMWindow::open):
+        (WebCore::JSDOMWindow::showModalDialog):
+        (WebCore::handlePostMessage):
+        (WebCore::JSDOMWindow::setTimeout):
+        (WebCore::JSDOMWindow::setInterval):
+        * bindings/js/JSDataCueCustom.cpp:
+        (WebCore::constructJSDataCue):
+        * bindings/js/JSDeviceMotionEventCustom.cpp:
+        (WebCore::readAccelerationArgument):
+        (WebCore::readRotationRateArgument):
+        (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+        * bindings/js/JSDictionary.cpp:
+        (WebCore::JSDictionary::tryGetProperty):
+        (WebCore::JSDictionary::convertValue):
+        * bindings/js/JSDictionary.h:
+        (WebCore::JSDictionary::tryGetPropertyAndResult):
+        * bindings/js/JSDocumentCustom.cpp:
+        (WebCore::JSDocument::getCSSCanvasContext):
+        * bindings/js/JSEventListener.cpp:
+        (WebCore::JSEventListener::handleEvent):
+        * bindings/js/JSFileCustom.cpp:
+        (WebCore::constructJSFile):
+        * bindings/js/JSGeolocationCustom.cpp:
+        (WebCore::createPositionOptions):
+        (WebCore::JSGeolocation::getCurrentPosition):
+        (WebCore::JSGeolocation::watchPosition):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::callHTMLAllCollection):
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::get3DContextAttributes):
+        (WebCore::JSHTMLCanvasElement::getContext):
+        (WebCore::JSHTMLCanvasElement::probablySupportsContext):
+        * bindings/js/JSHTMLElementCustom.cpp:
+        (WebCore::constructJSHTMLElement):
+        * bindings/js/JSHistoryCustom.cpp:
+        (WebCore::JSHistory::pushState):
+        (WebCore::JSHistory::replaceState):
+        * bindings/js/JSIDBDatabaseCustom.cpp:
+        (WebCore::JSIDBDatabase::createObjectStore):
+        * bindings/js/JSLazyEventListener.cpp:
+        (WebCore::JSLazyEventListener::initializeJSFunction):
+        * bindings/js/JSMainThreadExecState.h:
+        (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
+        (WebCore::JSMainThreadExecState::~JSMainThreadExecState):
+        * bindings/js/JSMessageEventCustom.cpp:
+        (WebCore::handleInitMessageEvent):
+        * bindings/js/JSMessagePortCustom.cpp:
+        (WebCore::fillMessagePortArray):
+        * bindings/js/JSMessagePortCustom.h:
+        (WebCore::handlePostMessage):
+        * bindings/js/JSMockContentFilterSettingsCustom.cpp:
+        (WebCore::JSMockContentFilterSettings::setDecisionPoint):
+        (WebCore::toDecision):
+        (WebCore::JSMockContentFilterSettings::setDecision):
+        (WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
+        * bindings/js/JSNodeFilterCustom.cpp:
+        (WebCore::JSNodeFilter::acceptNode):
+        * bindings/js/JSNodeOrString.cpp:
+        (WebCore::toNodeOrStringVector):
+        * bindings/js/JSSQLTransactionCustom.cpp:
+        (WebCore::JSSQLTransaction::executeSql):
+        * bindings/js/JSSVGLengthCustom.cpp:
+        (WebCore::JSSVGLength::convertToSpecifiedUnits):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::getOwnPropertyNames):
+        (WebCore::JSStorage::putDelegate):
+        * bindings/js/JSTextTrackCustom.cpp:
+        (WebCore::JSTextTrack::setLanguage):
+        * bindings/js/JSVideoTrackCustom.cpp:
+        (WebCore::JSVideoTrack::setKind):
+        (WebCore::JSVideoTrack::setLanguage):
+        * bindings/js/JSWebGL2RenderingContextCustom.cpp:
+        (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
+        * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
+        (WebCore::getObjectParameter):
+        (WebCore::JSWebGLRenderingContextBase::getExtension):
+        (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
+        (WebCore::JSWebGLRenderingContextBase::getParameter):
+        (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
+        (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
+        (WebCore::toVector):
+        (WebCore::dataFunctionf):
+        (WebCore::dataFunctionMatrix):
+        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
+        (WebCore::createAlgorithmFromJSValue):
+        (WebCore::cryptoKeyFormatFromJSValue):
+        (WebCore::cryptoKeyUsagesFromJSValue):
+        (WebCore::JSWebKitSubtleCrypto::encrypt):
+        (WebCore::JSWebKitSubtleCrypto::decrypt):
+        (WebCore::JSWebKitSubtleCrypto::sign):
+        (WebCore::JSWebKitSubtleCrypto::verify):
+        (WebCore::JSWebKitSubtleCrypto::digest):
+        (WebCore::JSWebKitSubtleCrypto::generateKey):
+        (WebCore::importKey):
+        (WebCore::JSWebKitSubtleCrypto::importKey):
+        (WebCore::exportKey):
+        (WebCore::JSWebKitSubtleCrypto::exportKey):
+        (WebCore::JSWebKitSubtleCrypto::wrapKey):
+        (WebCore::JSWebKitSubtleCrypto::unwrapKey):
+        * bindings/js/JSWorkerCustom.cpp:
+        (WebCore::constructJSWorker):
+        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
+        (WebCore::JSWorkerGlobalScope::importScripts):
+        (WebCore::JSWorkerGlobalScope::setTimeout):
+        (WebCore::JSWorkerGlobalScope::setInterval):
+        * bindings/js/ReadableStreamDefaultController.cpp:
+        (WebCore::ReadableStreamDefaultController::invoke):
+        (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
+        * bindings/js/ReadableStreamDefaultController.h:
+        (WebCore::ReadableStreamDefaultController::enqueue):
+        * bindings/js/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::create):
+        * bindings/js/ScriptGlobalObject.cpp:
+        (WebCore::ScriptGlobalObject::set):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneBase::shouldTerminate):
+        (WebCore::CloneDeserializer::deserialize):
+        (WebCore::SerializedScriptValue::create):
+        (WebCore::SerializedScriptValue::deserialize):
+        * bindings/js/WorkerScriptController.cpp:
+        (WebCore::WorkerScriptController::evaluate):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryImplementationContent):
+        (GenerateImplementation):
+        (GenerateParametersCheck):
+        (GenerateImplementationFunctionCall):
+        (GenerateConstructorDefinition):
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+        (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        (WebCore::JSTestEventConstructorConstructor::construct):
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::jsTestEventTargetPrototypeFunctionItem):
+        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
+        (WebCore::setJSTestGlobalObjectRegularAttribute):
+        (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
+        (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
+        (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
+        (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
+        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
+        (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterfaceConstructor::construct):
+        (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
+        (WebCore::setJSTestInterfaceImplementsStr2):
+        (WebCore::setJSTestInterfaceImplementsStr3):
+        (WebCore::setJSTestInterfaceImplementsNode):
+        (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
+        (WebCore::setJSTestInterfaceSupplementalStr2):
+        (WebCore::setJSTestInterfaceSupplementalStr3):
+        (WebCore::setJSTestInterfaceSupplementalNode):
+        (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
+        (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+        (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
+        * bindings/scripts/test/JS/JSTestNode.cpp:
+        (WebCore::setJSTestNodeName):
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
+        (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
+        (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
+        (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::convertDictionary&lt;TestObj::Dictionary&gt;):
+        (WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldNotTolerateNull&gt;):
+        (WebCore::convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;):
+        (WebCore::convertDictionary&lt;AlternateDictionaryName&gt;):
+        (WebCore::setJSTestObjConstructorStaticStringAttr):
+        (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
+        (WebCore::setJSTestObjEnumAttr):
+        (WebCore::setJSTestObjByteAttr):
+        (WebCore::setJSTestObjOctetAttr):
+        (WebCore::setJSTestObjShortAttr):
+        (WebCore::setJSTestObjClampedShortAttr):
+        (WebCore::setJSTestObjEnforceRangeShortAttr):
+        (WebCore::setJSTestObjUnsignedShortAttr):
+        (WebCore::setJSTestObjLongAttr):
+        (WebCore::setJSTestObjLongLongAttr):
+        (WebCore::setJSTestObjUnsignedLongLongAttr):
+        (WebCore::setJSTestObjStringAttr):
+        (WebCore::setJSTestObjUsvstringAttr):
+        (WebCore::setJSTestObjTestObjAttr):
+        (WebCore::setJSTestObjTestNullableObjAttr):
+        (WebCore::setJSTestObjLenientTestObjAttr):
+        (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
+        (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
+        (WebCore::setJSTestObjImplementationEnumAttr):
+        (WebCore::setJSTestObjXMLObjAttr):
+        (WebCore::setJSTestObjCreate):
+        (WebCore::setJSTestObjReflectedStringAttr):
+        (WebCore::setJSTestObjReflectedUSVStringAttr):
+        (WebCore::setJSTestObjReflectedIntegralAttr):
+        (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
+        (WebCore::setJSTestObjReflectedBooleanAttr):
+        (WebCore::setJSTestObjReflectedURLAttr):
+        (WebCore::setJSTestObjReflectedUSVURLAttr):
+        (WebCore::setJSTestObjReflectedCustomIntegralAttr):
+        (WebCore::setJSTestObjReflectedCustomBooleanAttr):
+        (WebCore::setJSTestObjReflectedCustomURLAttr):
+        (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
+        (WebCore::setJSTestObjTypedArrayAttr):
+        (WebCore::setJSTestObjAttrWithGetterException):
+        (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
+        (WebCore::setJSTestObjAttrWithSetterException):
+        (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
+        (WebCore::setJSTestObjStringAttrWithGetterException):
+        (WebCore::setJSTestObjStringAttrWithSetterException):
+        (WebCore::setJSTestObjCustomAttr):
+        (WebCore::setJSTestObjOnfoo):
+        (WebCore::setJSTestObjOnwebkitfoo):
+        (WebCore::setJSTestObjWithScriptStateAttribute):
+        (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
+        (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
+        (WebCore::setJSTestObjWithScriptStateAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
+        (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
+        (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
+        (WebCore::setJSTestObjConditionalAttr1):
+        (WebCore::setJSTestObjConditionalAttr2):
+        (WebCore::setJSTestObjConditionalAttr3):
+        (WebCore::setJSTestObjConditionalAttr4Constructor):
+        (WebCore::setJSTestObjConditionalAttr5Constructor):
+        (WebCore::setJSTestObjConditionalAttr6Constructor):
+        (WebCore::setJSTestObjAnyAttribute):
+        (WebCore::setJSTestObjMutablePoint):
+        (WebCore::setJSTestObjImmutablePoint):
+        (WebCore::setJSTestObjStrawberry):
+        (WebCore::setJSTestObjId):
+        (WebCore::setJSTestObjReplaceableAttribute):
+        (WebCore::setJSTestObjNullableLongSettableAttribute):
+        (WebCore::setJSTestObjNullableStringSettableAttribute):
+        (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
+        (WebCore::setJSTestObjNullableStringValue):
+        (WebCore::setJSTestObjAttributeWithReservedEnumType):
+        (WebCore::setJSTestObjPutForwardsAttribute):
+        (WebCore::setJSTestObjPutForwardsNullableAttribute):
+        (WebCore::setJSTestObjStringifierAttribute):
+        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
+        (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
+        (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
+        (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
+        (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
+        (WebCore::jsTestObjPrototypeFunctionSerializedValue):
+        (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
+        (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
+        (WebCore::jsTestObjPrototypeFunctionAddEventListener):
+        (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
+        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
+        (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
+        (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
+        (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
+        (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
+        (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
+        (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
+        (WebCore::jsTestObjPrototypeFunctionGetElementById):
+        (WebCore::jsTestObjPrototypeFunctionConvert3):
+        (WebCore::jsTestObjPrototypeFunctionConvert4):
+        (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
+        (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
+        (WebCore::jsTestObjPrototypeFunctionAny):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
+        (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
+        (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
+        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
+        (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
+        (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        (WebCore::constructJSTestOverloadedConstructors1):
+        (WebCore::constructJSTestOverloadedConstructors2):
+        (WebCore::constructJSTestOverloadedConstructors4):
+        (WebCore::constructJSTestOverloadedConstructors5):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
+        (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
+        (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+        (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::setJSTestSerializedScriptValueInterfaceValue):
+        (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::JSTestTypedefsConstructor::construct):
+        (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
+        (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
+        (WebCore::setJSTestTypedefsAttrWithGetterException):
+        (WebCore::setJSTestTypedefsAttrWithSetterException):
+        (WebCore::setJSTestTypedefsStringAttrWithGetterException):
+        (WebCore::setJSTestTypedefsStringAttrWithSetterException):
+        (WebCore::jsTestTypedefsPrototypeFunctionFunc):
+        (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
+        (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
+        (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
+        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
+        (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
+        (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
+        * bridge/NP_jsobject.cpp:
+        (_NPN_InvokeDefault):
+        (_NPN_Invoke):
+        (_NPN_Evaluate):
+        (_NPN_GetProperty):
+        (_NPN_SetProperty):
+        (_NPN_RemoveProperty):
+        (_NPN_HasProperty):
+        (_NPN_HasMethod):
+        (_NPN_Enumerate):
+        (_NPN_Construct):
+        * bridge/c/c_instance.cpp:
+        (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
+        * bridge/objc/WebScriptObject.mm:
+        (WebCore::addExceptionToConsole):
+        (-[WebScriptObject callWebScriptMethod:withArguments:]):
+        (-[WebScriptObject evaluateWebScript:]):
+        (-[WebScriptObject setValue:forKey:]):
+        (-[WebScriptObject valueForKey:]):
+        (-[WebScriptObject removeWebScriptKey:]):
+        (-[WebScriptObject hasWebScriptKey:]):
+        (-[WebScriptObject webScriptValueAtIndex:]):
+        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
+        * contentextensions/ContentExtensionParser.cpp:
+        (WebCore::ContentExtensions::getDomainList):
+        (WebCore::ContentExtensions::getTypeFlags):
+        (WebCore::ContentExtensions::loadTrigger):
+        (WebCore::ContentExtensions::loadAction):
+        (WebCore::ContentExtensions::loadEncodedRules):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::controllerJSValue):
+        (WebCore::HTMLMediaElement::updateCaptionContainer):
+        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
+        (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
+        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
+        (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
+
</ins><span class="cx"> 2016-09-07  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix handling of negative radius in HTMLAreaElement's coords when in circle state
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersruntimeCatchScopeh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/runtime/CatchScope.h (0 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/runtime/CatchScope.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/runtime/CatchScope.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+#ifndef WebCore_FWD_CatchScope_h
+#define WebCore_FWD_CatchScope_h
+#include &lt;JavaScriptCore/CatchScope.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMSessionClearKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -111,12 +111,13 @@
</span><span class="cx"> 
</span><span class="cx">         VM&amp; vm = clearKeyVM();
</span><span class="cx">         JSLockHolder lock(vm);
</span><ins>+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         JSGlobalObject* globalObject = JSGlobalObject::create(vm, JSGlobalObject::createStructure(vm, jsNull()));
</span><span class="cx">         ExecState* exec = globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><span class="cx">         JSLockHolder locker(clearKeyVM());
</span><span class="cx">         JSValue keysDataObject = JSONParse(exec, rawKeysString);
</span><del>-        if (exec-&gt;hadException() || !keysDataObject) {
</del><ins>+        if (scope.exception() || !keysDataObject) {
</ins><span class="cx">             LOG(Media, &quot;CDMSessionClearKey::update(%p) - failed: invalid JSON&quot;, this);
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -236,6 +236,9 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;IDBRequest&gt; IDBObjectStore::putOrAdd(ExecState&amp; state, JSValue value, RefPtr&lt;IDBKey&gt; key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCodeWithMessage&amp; ec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     LOG(IndexedDB, &quot;IDBObjectStore::putOrAdd&quot;);
</span><span class="cx">     ASSERT(currentThread() == m_transaction-&gt;database().originThreadID());
</span><span class="cx"> 
</span><span class="lines">@@ -270,9 +273,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; serializedValue = SerializedScriptValue::create(&amp;state, value, nullptr, nullptr);
</span><del>-    if (state.hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         // Clear the DOM exception from the serializer so we can give a more targeted exception.
</span><del>-        state.clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">         ec.code = IDBDatabaseException::DataCloneError;
</span><span class="cx">         ec.message = ASCIILiteral(&quot;Failed to store record in an IDBObjectStore: An object could not be cloned.&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -859,7 +859,9 @@
</span><span class="cx">     // using steps to assign a key to a value using a key path.
</span><span class="cx">     ThreadSafeDataBuffer injectedRecordValue;
</span><span class="cx">     if (usedKeyIsGenerated &amp;&amp; !objectStoreInfo-&gt;keyPath().isNull()) {
</span><del>-        JSLockHolder locker(databaseThreadVM());
</del><ins>+        VM&amp; vm = databaseThreadVM();
+        JSLockHolder locker(vm);
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">         auto value = deserializeIDBValueToJSValue(databaseThreadExecState(), originalRecordValue.data());
</span><span class="cx">         if (value.isUndefined()) {
</span><span class="lines">@@ -873,7 +875,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         auto serializedValue = SerializedScriptValue::create(&amp;databaseThreadExecState(), value, nullptr, nullptr);
</span><del>-        if (databaseThreadExecState().hadException()) {
</del><ins>+        if (UNLIKELY(scope.exception())) {
</ins><span class="cx">             postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral(&quot;Unable to serialize record value after injecting record key&quot;)), usedKey));
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamSDPProcessorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/Modules/mediastream/SDPProcessor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2015, 2016 Ericsson AB. All rights reserved.
</span><ins>+ * Copyright (C) 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -500,15 +501,17 @@
</span><span class="cx"> 
</span><span class="cx">     ScriptController&amp; scriptController = document-&gt;frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(*m_isolatedWorld));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     JSC::JSValue probeFunctionValue = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;generate&quot;));
</span><span class="cx">     if (!probeFunctionValue.isFunction()) {
</span><span class="cx">         URL scriptURL;
</span><span class="cx">         scriptController.evaluateInWorld(ScriptSourceCode(SDPProcessorScriptResource::scriptString(), scriptURL), *m_isolatedWorld);
</span><del>-        if (exec-&gt;hadException()) {
-            exec-&gt;clearException();
</del><ins>+        if (UNLIKELY(scope.exception())) {
+            scope.clearException();
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -527,9 +530,9 @@
</span><span class="cx">     argList.append(JSC::jsString(exec, argument));
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue result = JSC::call(exec, function, callType, callData, globalObject, argList);
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         LOG_ERROR(&quot;SDPProcessor script threw in function %s&quot;, functionName.ascii().data());
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -160,8 +160,10 @@
</span><span class="cx">     DOMWrapperWorld&amp; world = isolatedWorld();
</span><span class="cx">     ScriptController&amp; scriptController = m_parentElement-&gt;document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx">     
</span><span class="cx">     JSC::JSValue replacementFunction = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;createPluginReplacement&quot;));
</span><span class="cx">     if (replacementFunction.isFunction())
</span><span class="lines">@@ -168,9 +170,9 @@
</span><span class="cx">         return true;
</span><span class="cx">     
</span><span class="cx">     scriptController.evaluateInWorld(ScriptSourceCode(quickTimePluginReplacementScript()), world);
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         LOG(Plugins, &quot;%p - Exception when evaluating QuickTime plugin replacement script&quot;, this);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -188,15 +190,17 @@
</span><span class="cx">     DOMWrapperWorld&amp; world = isolatedWorld();
</span><span class="cx">     ScriptController&amp; scriptController = m_parentElement-&gt;document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
-    
</del><ins>+
</ins><span class="cx">     // Lookup the &quot;createPluginReplacement&quot; function.
</span><span class="cx">     JSC::JSValue replacementFunction = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;createPluginReplacement&quot;));
</span><span class="cx">     if (replacementFunction.isUndefinedOrNull())
</span><span class="cx">         return false;
</span><span class="cx">     JSC::JSObject* replacementObject = replacementFunction.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSC::CallData callData;
</span><span class="cx">     JSC::CallType callType = replacementObject-&gt;methodTable()-&gt;getCallData(replacementObject, callData);
</span><span class="cx">     if (callType == JSC::CallType::None)
</span><span class="lines">@@ -209,32 +213,32 @@
</span><span class="cx">     argList.append(toJS&lt;String&gt;(exec, globalObject, m_names));
</span><span class="cx">     argList.append(toJS&lt;String&gt;(exec, globalObject, m_values));
</span><span class="cx">     JSC::JSValue replacement = call(exec, replacementObject, callType, callData, globalObject, argList);
</span><del>-    if (exec-&gt;hadException()) {
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Get the &lt;video&gt; created to replace the plug-in.
</span><span class="cx">     JSC::JSValue value = replacement.get(exec, JSC::Identifier::fromString(exec, &quot;video&quot;));
</span><del>-    if (!exec-&gt;hadException() &amp;&amp; !value.isUndefinedOrNull())
</del><ins>+    if (!scope.exception() &amp;&amp; !value.isUndefinedOrNull())
</ins><span class="cx">         m_mediaElement = JSHTMLVideoElement::toWrapped(value);
</span><span class="cx"> 
</span><span class="cx">     if (!m_mediaElement) {
</span><span class="cx">         LOG(Plugins, &quot;%p - Failed to find &lt;video&gt; element created by QuickTime plugin replacement script.&quot;, this);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Get the scripting interface.
</span><span class="cx">     value = replacement.get(exec, JSC::Identifier::fromString(exec, &quot;scriptObject&quot;));
</span><del>-    if (!exec-&gt;hadException() &amp;&amp; !value.isUndefinedOrNull()) {
</del><ins>+    if (!scope.exception() &amp;&amp; !value.isUndefinedOrNull()) {
</ins><span class="cx">         m_scriptObject = value.toObject(exec);
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_scriptObject) {
</span><span class="cx">         LOG(Plugins, &quot;%p - Failed to find script object created by QuickTime plugin replacement.&quot;, this);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsArrayValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ArrayValue.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ArrayValue.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/ArrayValue.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -82,6 +82,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool ArrayValue::get(size_t index, String&amp; value) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (isUndefinedOrNull())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -90,7 +93,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     value = indexedValue.toWTFString(m_exec);
</span><del>-    if (m_exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/Dictionary.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/Dictionary.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/Dictionary.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -61,6 +61,8 @@
</span><span class="cx"> 
</span><span class="cx">     JSObject* object =  m_dictionary.initializerObject();
</span><span class="cx">     ExecState* exec = m_dictionary.execState();
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     PropertyNameArray propertyNames(exec, PropertyNameMode::Strings);
</span><span class="cx">     JSObject::getOwnPropertyNames(object, exec, propertyNames, EnumerationMode());
</span><span class="lines">@@ -69,10 +71,10 @@
</span><span class="cx">         if (stringKey.isEmpty())
</span><span class="cx">             continue;
</span><span class="cx">         JSValue value = object-&gt;get(exec, *it);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             continue;
</span><span class="cx">         String stringValue = value.toString(exec)-&gt;value(exec);
</span><del>-        if (!exec-&gt;hadException())
</del><ins>+        if (LIKELY(!scope.exception()))
</ins><span class="cx">             map.set(stringKey, stringValue);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -90,6 +90,7 @@
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = state.vm();
</span><span class="cx">     Locker&lt;JSLock&gt; locker(vm.apiLock());
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     switch (key-&gt;type()) {
</span><span class="cx">     case KeyType::Array: {
</span><span class="lines">@@ -96,7 +97,7 @@
</span><span class="cx">         auto&amp; inArray = key-&gt;array();
</span><span class="cx">         unsigned size = inArray.size();
</span><span class="cx">         auto outArray = constructEmptyArray(&amp;state, 0, &amp;globalObject, size);
</span><del>-        if (UNLIKELY(vm.exception()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         for (size_t i = 0; i &lt; size; ++i)
</span><span class="cx">             outArray-&gt;putDirectIndex(&amp;state, i, toJS(state, globalObject, inArray.at(i).get()));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSApplePaySessionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -55,15 +55,15 @@
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     uint16_t status = convert&lt;uint16_t&gt;(state, state.argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     Dictionary newTotal = { &amp;state, state.argument(1) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ArrayValue newLineItems { &amp;state, state.argument(2) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     impl.completeShippingMethodSelection(status, newTotal, newLineItems, ec);
</span><span class="cx">     setDOMException(&amp;state, ec);
</span><span class="lines">@@ -88,19 +88,19 @@
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     uint16_t status = convert&lt;uint16_t&gt;(state, state.argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ArrayValue newShippingMethods { &amp;state, state.argument(1) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     Dictionary newTotal = { &amp;state, state.argument(2) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ArrayValue newLineItems { &amp;state, state.argument(3) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     impl.completeShippingContactSelection(status, newShippingMethods, newTotal, newLineItems, ec);
</span><span class="cx">     setDOMException(&amp;state, ec);
</span><span class="lines">@@ -125,11 +125,11 @@
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     Dictionary newTotal = { &amp;state, state.argument(0) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ArrayValue newLineItems { &amp;state, state.argument(1) };
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     impl.completePaymentMethodSelection(newTotal, newLineItems, ec);
</span><span class="cx">     setDOMException(&amp;state, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSAudioTrackCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSAudioTrackCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -43,8 +43,11 @@
</span><span class="cx"> void JSAudioTrack::setKind(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto&amp; string = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     wrapped().setKind(string);
</span><span class="cx"> #else
</span><span class="lines">@@ -56,8 +59,11 @@
</span><span class="cx"> void JSAudioTrack::setLanguage(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto&amp; string = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     wrapped().setLanguage(string);
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned blobPartsLength = 0;
</span><span class="cx">     JSObject* blobParts = toJSSequence(exec, exec.uncheckedArgument(0), blobPartsLength);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(blobParts);
</span><span class="cx"> 
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Attempt to get the endings property and validate it.
</span><span class="cx">         bool containsEndings = dictionary.get(&quot;endings&quot;, endings);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (containsEndings) {
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Attempt to get the type property.
</span><span class="cx">         dictionary.get(&quot;type&quot;, type);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; blobPartsLength; ++i) {
</span><span class="cx">         JSValue item = blobParts-&gt;get(&amp;exec, i);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (ArrayBuffer* arrayBuffer = toArrayBuffer(item))
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">             blobBuilder.append(blob);
</span><span class="cx">         else {
</span><span class="cx">             String string = item.toWTFString(&amp;exec);
</span><del>-            if (exec.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             blobBuilder.append(string, endings);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCSSStyleDeclarationCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     String propertyName = state.uncheckedArgument(0).toWTFString(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValue&gt; cssValue = wrapped().getPropertyCSSValue(propertyName);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -68,8 +68,9 @@
</span><span class="cx"> static JSArray* getJSListenerFunctions(ExecState&amp; state, Document* document, const EventListenerInfo&amp; listenerInfo)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state.vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* result = constructEmptyArray(&amp;state, nullptr);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     size_t handlersCount = listenerInfo.eventListenerVector.size();
</span><span class="cx">     for (size_t i = 0, outputIndex = 0; i &lt; handlersCount; ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoAlgorithmDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCryptoAlgorithmDictionary.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!algorithmName.containsOnlyASCII()) {
</span><span class="lines">@@ -106,12 +106,14 @@
</span><span class="cx">     // FXIME: Teach JSDictionary how to return JSValues, and use that to get hash element value.
</span><span class="cx"> 
</span><span class="cx">     ExecState* exec = dictionary.execState();
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSObject* object = dictionary.initializerObject();
</span><span class="cx"> 
</span><span class="cx">     Identifier identifier = Identifier::fromString(exec, &quot;hash&quot;);
</span><span class="cx"> 
</span><span class="cx">     JSValue hash = getProperty(exec, object, &quot;hash&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (hash.isUndefinedOrNull()) {
</span><span class="lines">@@ -134,16 +136,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSValue iv = getProperty(exec, value.getObject(), &quot;iv&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmAesCbcParams);
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData ivData;
</span><del>-    if (!cryptoOperationDataFromJSValue(exec, iv, ivData)) {
-        ASSERT(exec-&gt;hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(exec, iv, ivData);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     if (ivData.second != 16) {
</span><span class="cx">         throwException(exec, scope, createError(exec, &quot;AES-CBC initialization data must be 16 bytes&quot;));
</span><span class="lines">@@ -168,7 +170,7 @@
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmAesKeyGenParams);
</span><span class="cx"> 
</span><span class="cx">     JSValue lengthValue = getProperty(&amp;state, value.getObject(), &quot;length&quot;);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     result-&gt;length = convert&lt;uint16_t&gt;(state, lengthValue, EnforceRange);
</span><span class="lines">@@ -189,10 +191,10 @@
</span><span class="cx">     JSDictionary jsDictionary(&amp;state, value.getObject());
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmHmacParams);
</span><span class="cx"> 
</span><del>-    if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required);
+    ASSERT_UNUSED(scope, scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span><span class="lines">@@ -210,13 +212,13 @@
</span><span class="cx">     JSDictionary jsDictionary(&amp;state, value.getObject());
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmHmacKeyParams);
</span><span class="cx"> 
</span><del>-    if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     result-&gt;hasLength = jsDictionary.get(&quot;length&quot;, result-&gt;length);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="lines">@@ -236,16 +238,16 @@
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmRsaKeyGenParams);
</span><span class="cx"> 
</span><span class="cx">     JSValue modulusLengthValue = getProperty(&amp;state, value.getObject(), &quot;modulusLength&quot;);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Why no EnforceRange? Filed as &lt;https://www.w3.org/Bugs/Public/show_bug.cgi?id=23779&gt;.
</span><span class="cx">     result-&gt;modulusLength = convert&lt;uint32_t&gt;(state, modulusLengthValue, NormalConversion);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSValue publicExponentValue = getProperty(&amp;state, value.getObject(), &quot;publicExponent&quot;);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Uint8Array&gt; publicExponentArray = toUint8Array(publicExponentValue);
</span><span class="lines">@@ -279,13 +281,13 @@
</span><span class="cx">     JSDictionary jsDictionary(exec, value.getObject());
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmRsaOaepParams);
</span><span class="cx"> 
</span><del>-    if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
-        ASSERT(exec-&gt;hadException());
</del><ins>+    auto success = getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSValue labelValue = getProperty(exec, value.getObject(), &quot;label&quot;);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     result-&gt;hasLabel = !labelValue.isUndefinedOrNull();
</span><span class="lines">@@ -293,10 +295,10 @@
</span><span class="cx">         return WTFMove(result);
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData labelData;
</span><del>-    if (!cryptoOperationDataFromJSValue(exec, labelValue, labelData)) {
-        ASSERT(exec-&gt;hadException());
</del><ins>+    success = cryptoOperationDataFromJSValue(exec, labelValue, labelData);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     result-&gt;label.append(labelData.first, labelData.second);
</span><span class="cx"> 
</span><span class="lines">@@ -316,10 +318,10 @@
</span><span class="cx">     JSDictionary jsDictionary(&amp;state, value.getObject());
</span><span class="cx">     auto result = adoptRef(*new CryptoAlgorithmRsaSsaParams);
</span><span class="cx"> 
</span><del>-    if (!getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = getHashAlgorithm(jsDictionary, result-&gt;hash, HashRequirement::Required);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     return WTFMove(result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSValue value = slot.getValue(exec, identifier);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     if (!isJSArray(value)) {
</span><span class="cx">         throwTypeError(exec, scope, String::format(&quot;Expected an array for \&quot;%s\&quot; JSON key&quot;,  key));
</span><span class="cx">         return false;
</span><span class="lines">@@ -85,10 +85,10 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSValue jsValue = slot.getValue(exec, identifier);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     if (!jsValue.getString(exec, result)) {
</span><span class="cx">         // Can get an out of memory exception.
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         throwTypeError(exec, scope, String::format(&quot;Expected a string value for \&quot;%s\&quot; JSON key&quot;,  key));
</span><span class="cx">         return false;
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     JSValue jsValue = slot.getValue(exec, identifier);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     if (!jsValue.isBoolean()) {
</span><span class="cx">         throwTypeError(exec, scope, String::format(&quot;Expected a boolean value for \&quot;%s\&quot; JSON key&quot;,  key));
</span><span class="cx">         return false;
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue jsonValue = JSONParse(exec, jsonString);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!jsonValue || !jsonValue.isObject()) {
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">             JSValue jsValue = keyOps-&gt;getIndex(m_exec, i);
</span><span class="cx">             String operation;
</span><span class="cx">             if (!jsValue.getString(m_exec, operation)) {
</span><del>-                if (!m_exec-&gt;hadException())
</del><ins>+                if (!scope.exception())
</ins><span class="cx">                     throwTypeError(m_exec, scope, ASCIILiteral(&quot;JWK key_ops attribute could not be processed&quot;));
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         String jwkUseString;
</span><span class="lines">@@ -391,7 +391,7 @@
</span><span class="cx"> 
</span><span class="cx">     String keyBase64URL;
</span><span class="cx">     if (!getStringFromJSON(m_exec, m_json.get(), &quot;k&quot;, keyBase64URL)) {
</span><del>-        if (!m_exec-&gt;hadException())
</del><ins>+        if (!scope.exception())
</ins><span class="cx">             throwTypeError(m_exec, scope, ASCIILiteral(&quot;Secret key data is not present is JWK&quot;));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx">     Vector&lt;uint8_t&gt; privateExponent;
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;n&quot;, modulus)) {
</span><del>-        if (!m_exec-&gt;hadException())
</del><ins>+        if (!scope.exception())
</ins><span class="cx">             throwTypeError(m_exec, scope, ASCIILiteral(&quot;Required JWK \&quot;n\&quot; member is missing&quot;));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -431,13 +431,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;e&quot;, exponent)) {
</span><del>-        if (!m_exec-&gt;hadException())
</del><ins>+        if (!scope.exception())
</ins><span class="cx">             throwTypeError(m_exec, scope, ASCIILiteral(&quot;Required JWK \&quot;e\&quot; member is missing&quot;));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;d&quot;, modulus)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPublic(modulus, exponent);
</span><span class="cx">     }
</span><span class="lines">@@ -446,31 +446,31 @@
</span><span class="cx">     CryptoKeyDataRSAComponents::PrimeInfo secondPrimeInfo;
</span><span class="cx">     Vector&lt;CryptoKeyDataRSAComponents::PrimeInfo&gt; otherPrimeInfos;
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;p&quot;, firstPrimeInfo.primeFactor)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;dp&quot;, firstPrimeInfo.factorCRTExponent)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;q&quot;, secondPrimeInfo.primeFactor)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;dq&quot;, secondPrimeInfo.factorCRTExponent)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!getBigIntegerVectorFromJSON(m_exec, m_json.get(), &quot;qi&quot;, secondPrimeInfo.factorCRTCoefficient)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivate(modulus, exponent, privateExponent);
</span><span class="cx">     }
</span><span class="lines">@@ -477,7 +477,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSArray* otherPrimeInfoJSArray;
</span><span class="cx">     if (!getJSArrayFromJSON(m_exec, m_json.get(), &quot;oth&quot;, otherPrimeInfoJSArray)) {
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (scope.exception())
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(modulus, exponent, privateExponent, firstPrimeInfo, secondPrimeInfo, otherPrimeInfos);
</span><span class="cx">     }
</span><span class="lines">@@ -485,7 +485,7 @@
</span><span class="cx">     for (size_t i = 0; i &lt; otherPrimeInfoJSArray-&gt;length(); ++i) {
</span><span class="cx">         CryptoKeyDataRSAComponents::PrimeInfo info;
</span><span class="cx">         JSValue element = otherPrimeInfoJSArray-&gt;getIndex(m_exec, i);
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         if (!element.isObject()) {
</span><span class="cx">             throwTypeError(m_exec, scope, ASCIILiteral(&quot;JWK \&quot;oth\&quot; array member is not an object&quot;));
</span><span class="lines">@@ -492,17 +492,17 @@
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">         if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), &quot;r&quot;, info.primeFactor)) {
</span><del>-            if (!m_exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwTypeError(m_exec, scope, ASCIILiteral(&quot;Cannot get prime factor for a prime in \&quot;oth\&quot; dictionary&quot;));
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">         if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), &quot;d&quot;, info.factorCRTExponent)) {
</span><del>-            if (!m_exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwTypeError(m_exec, scope, ASCIILiteral(&quot;Cannot get factor CRT exponent for a prime in \&quot;oth\&quot; dictionary&quot;));
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">         if (!getBigIntegerVectorFromJSON(m_exec, asObject(element), &quot;t&quot;, info.factorCRTCoefficient)) {
</span><del>-            if (!m_exec-&gt;hadException())
</del><ins>+            if (!scope.exception())
</ins><span class="cx">                 throwTypeError(m_exec, scope, ASCIILiteral(&quot;Cannot get factor CRT coefficient for a prime in \&quot;oth\&quot; dictionary&quot;));
</span><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="lines">@@ -519,7 +519,7 @@
</span><span class="cx"> 
</span><span class="cx">     String jwkKeyType;
</span><span class="cx">     if (!getStringFromJSON(m_exec, m_json.get(), &quot;kty&quot;, jwkKeyType)) {
</span><del>-        if (!m_exec-&gt;hadException())
</del><ins>+        if (!scope.exception())
</ins><span class="cx">             throwTypeError(m_exec, scope, ASCIILiteral(&quot;Required JWK \&quot;kty\&quot; member is missing&quot;));
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -549,6 +549,9 @@
</span><span class="cx"> 
</span><span class="cx"> static void buildJSONForRSAComponents(JSC::ExecState* exec, const CryptoKeyDataRSAComponents&amp; data, JSC::JSObject* result)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     addToJSON(exec, result, &quot;kty&quot;, &quot;RSA&quot;);
</span><span class="cx">     addToJSON(exec, result, &quot;n&quot;, base64URLEncode(data.modulus()));
</span><span class="cx">     addToJSON(exec, result, &quot;e&quot;, base64URLEncode(data.exponent()));
</span><span class="lines">@@ -570,9 +573,8 @@
</span><span class="cx">     if (data.otherPrimeInfos().isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    VM&amp; vm = exec-&gt;vm();
</del><span class="cx">     JSArray* oth = constructEmptyArray(exec, 0, exec-&gt;lexicalGlobalObject(), data.otherPrimeInfos().size());
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     for (size_t i = 0, size = data.otherPrimeInfos().size(); i &lt; size; ++i) {
</span><span class="cx">         JSObject* jsPrimeInfo = constructEmptyObject(exec);
</span><span class="lines">@@ -698,8 +700,9 @@
</span><span class="cx"> static void addUsagesToJSON(ExecState* exec, JSObject* json, CryptoKeyUsage usages)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><ins>+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSArray* keyOps = constructEmptyArray(exec, 0, exec-&gt;lexicalGlobalObject(), 0);
</span><del>-    if (UNLIKELY(vm.exception()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     unsigned index = 0;
</span><span class="lines">@@ -738,13 +741,13 @@
</span><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><span class="cx"> 
</span><span class="cx">     addJWKAlgorithmToJSON(exec, result, key);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     addBoolToJSON(exec, result, &quot;ext&quot;, key.extractable());
</span><span class="cx"> 
</span><span class="cx">     addUsagesToJSON(exec, result, key.usagesBitmap());
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     if (is&lt;CryptoKeyDataOctetSequence&gt;(*keyData))
</span><span class="lines">@@ -755,7 +758,7 @@
</span><span class="cx">         throwTypeError(exec, scope, ASCIILiteral(&quot;Key doesn't support exportKey&quot;));
</span><span class="cx">         return String();
</span><span class="cx">     }
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return String();
</span><span class="cx"> 
</span><span class="cx">     return JSONStringify(exec, result, 0);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomElementInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCustomElementInterface.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx">     VM&amp; vm = m_isolatedWorld-&gt;vm();
</span><span class="cx">     JSLockHolder lock(vm);
</span><ins>+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     if (!m_constructor)
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -79,11 +80,11 @@
</span><span class="cx"> 
</span><span class="cx">     auto&amp; state = *context-&gt;execState();
</span><span class="cx">     RefPtr&lt;Element&gt; element = constructCustomElementSynchronously(downcast&lt;Document&gt;(*context), vm, state, m_constructor.get(), localName);
</span><ins>+    ASSERT(!!scope.exception() == !element);
</ins><span class="cx">     if (!element) {
</span><del>-        auto* exception = vm.exception();
-        ASSERT(exception);
</del><span class="cx">         if (shouldClearException == ShouldClearException::Clear) {
</span><del>-            state.clearException();
</del><ins>+            auto* exception = scope.exception();
+            scope.clearException();
</ins><span class="cx">             reportException(&amp;state, exception);
</span><span class="cx">         }
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -110,7 +111,7 @@
</span><span class="cx">     InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionConstruct(&amp;document, constructType, constructData);
</span><span class="cx">     JSValue newElement = construct(&amp;state, constructor, constructType, constructData, args);
</span><span class="cx">     InspectorInstrumentation::didCallFunction(cookie, &amp;document);
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!newElement.isEmpty());
</span><span class="lines">@@ -166,7 +167,7 @@
</span><span class="cx">     ASSERT(context-&gt;isDocument());
</span><span class="cx">     JSDOMGlobalObject* globalObject = toJSDOMGlobalObject(context, *m_isolatedWorld);
</span><span class="cx">     ExecState* state = globalObject-&gt;globalExec();
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ConstructData constructData;
</span><span class="lines">@@ -185,7 +186,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_constructionStack.removeLast();
</span><span class="cx"> 
</span><del>-    if (state-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         element.setIsFailedCustomElement(*this);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomElementRegistryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     JSValue callback = prototype.get(&amp;state, id);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     if (callback.isUndefined())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     AtomicString localName(state.uncheckedArgument(0).toString(&amp;state)-&gt;toAtomicString(&amp;state));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     JSValue constructorValue = state.uncheckedArgument(1);
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSValue prototypeValue = constructor-&gt;get(&amp;state, vm.propertyNames-&gt;prototype);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     if (!prototypeValue.isObject())
</span><span class="cx">         return throwTypeError(&amp;state, scope, ASCIILiteral(&quot;Custom element constructor's prototype must be an object&quot;));
</span><span class="lines">@@ -129,25 +129,25 @@
</span><span class="cx"> 
</span><span class="cx">     if (auto* connectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&amp;vm, &quot;connectedCallback&quot;)))
</span><span class="cx">         elementInterface-&gt;setConnectedCallback(connectedCallback);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (auto* disconnectedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&amp;vm, &quot;disconnectedCallback&quot;)))
</span><span class="cx">         elementInterface-&gt;setDisconnectedCallback(disconnectedCallback);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (auto* adoptedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&amp;vm, &quot;adoptedCallback&quot;)))
</span><span class="cx">         elementInterface-&gt;setAdoptedCallback(adoptedCallback);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto* attributeChangedCallback = getCustomElementCallback(state, prototypeObject, Identifier::fromString(&amp;vm, &quot;attributeChangedCallback&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     if (attributeChangedCallback) {
</span><span class="cx">         auto value = convertOptional&lt;Vector&lt;String&gt;&gt;(state, constructor-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;observedAttributes&quot;)));
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         if (value)
</span><span class="cx">             elementInterface-&gt;setAttributeChangedCallback(attributeChangedCallback, *value);
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     AtomicString localName(state.uncheckedArgument(0).toString(&amp;state)-&gt;toAtomicString(&amp;state));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!validateCustomElementNameAndThrowIfNeeded(state, localName))
</span><span class="lines">@@ -191,13 +191,15 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSCustomElementRegistry::whenDefined(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    auto scope = DECLARE_CATCH_SCOPE(state.vm());
+
</ins><span class="cx">     JSDOMGlobalObject&amp; globalObject = *jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject());
</span><span class="cx">     auto&amp; promiseDeferred = *JSPromiseDeferred::create(&amp;state, &amp;globalObject);
</span><span class="cx">     JSValue promise = whenDefinedPromise(state, globalObject, wrapped());
</span><span class="cx"> 
</span><del>-    if (state.hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         rejectPromiseWithExceptionIfAny(state, globalObject, promiseDeferred);
</span><del>-        ASSERT(!state.hadException());
</del><ins>+        ASSERT(!scope.exception());
</ins><span class="cx">         return promiseDeferred.promise();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -119,8 +119,11 @@
</span><span class="cx"> 
</span><span class="cx"> String valueToUSVString(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     String string = value.toWTFString(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return { };
</span><span class="cx">     StringView view { string };
</span><span class="cx"> 
</span><span class="lines">@@ -187,10 +190,11 @@
</span><span class="cx"> 
</span><span class="cx"> void reportException(ExecState* exec, JSValue exceptionValue, CachedScript* cachedScript)
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT(exec-&gt;vm().currentThreadIsHoldingAPILock());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    RELEASE_ASSERT(vm.currentThreadIsHoldingAPILock());
</ins><span class="cx">     Exception* exception = jsDynamicCast&lt;Exception*&gt;(exceptionValue);
</span><span class="cx">     if (!exception) {
</span><del>-        exception = exec-&gt;lastException();
</del><ins>+        exception = vm.lastException();
</ins><span class="cx">         if (!exception)
</span><span class="cx">             exception = Exception::create(exec-&gt;vm(), exceptionValue, Exception::DoNotCaptureStack);
</span><span class="cx">     }
</span><span class="lines">@@ -200,7 +204,10 @@
</span><span class="cx"> 
</span><span class="cx"> void reportException(ExecState* exec, Exception* exception, CachedScript* cachedScript, ExceptionDetails* exceptionDetails)
</span><span class="cx"> {
</span><del>-    RELEASE_ASSERT(exec-&gt;vm().currentThreadIsHoldingAPILock());
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
+    RELEASE_ASSERT(vm.currentThreadIsHoldingAPILock());
</ins><span class="cx">     if (isTerminatedExecutionException(exception))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -207,8 +214,8 @@
</span><span class="cx">     ErrorHandlingScope errorScope(exec-&gt;vm());
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;ScriptCallStack&gt; callStack(createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture));
</span><del>-    exec-&gt;clearException();
-    exec-&gt;clearLastException();
</del><ins>+    scope.clearException();
+    vm.clearLastException();
</ins><span class="cx"> 
</span><span class="cx">     JSDOMGlobalObject* globalObject = jsCast&lt;JSDOMGlobalObject*&gt;(exec-&gt;lexicalGlobalObject());
</span><span class="cx">     if (JSDOMWindow* window = jsDynamicCast&lt;JSDOMWindow*&gt;(globalObject)) {
</span><span class="lines">@@ -239,8 +246,8 @@
</span><span class="cx"> 
</span><span class="cx">         // We need to clear any new exception that may be thrown in the toString() call above.
</span><span class="cx">         // reportException() is not supposed to be making new exceptions.
</span><del>-        exec-&gt;clearException();
-        exec-&gt;clearLastException();
</del><ins>+        scope.clearException();
+        vm.clearLastException();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext = globalObject-&gt;scriptExecutionContext();
</span><span class="lines">@@ -256,8 +263,10 @@
</span><span class="cx"> 
</span><span class="cx"> void reportCurrentException(ExecState* exec)
</span><span class="cx"> {
</span><del>-    Exception* exception = exec-&gt;exception();
-    exec-&gt;clearException();
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    Exception* exception = scope.exception();
+    scope.clearException();
</ins><span class="cx">     reportException(exec, exception);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -341,7 +350,7 @@
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    if (!ec || exec-&gt;hadException())
</del><ins>+    if (!ec || scope.exception())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     throwException(exec, scope, createDOMException(exec, ec));
</span><span class="lines">@@ -352,7 +361,7 @@
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><del>-    if (!ec.code || exec-&gt;hadException())
</del><ins>+    if (!ec.code || scope.exception())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     throwException(exec, scope, createDOMException(exec, ec.code, ec.message));
</span><span class="lines">@@ -362,15 +371,17 @@
</span><span class="cx"> 
</span><span class="cx"> bool hasIteratorMethod(JSC::ExecState&amp; state, JSC::JSValue value)
</span><span class="cx"> {
</span><ins>+    auto&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!value.isObject())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    auto&amp; vm = state.vm();
</del><span class="cx">     JSObject* object = JSC::asObject(value);
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType;
</span><span class="cx">     JSValue applyMethod = object-&gt;getMethod(&amp;state, callData, callType, vm.propertyNames-&gt;iteratorSymbol, ASCIILiteral(&quot;Symbol.iterator property should be callable&quot;));
</span><del>-    if (vm.exception())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return !applyMethod.isUndefined();
</span><span class="lines">@@ -509,7 +520,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     switch (configuration) {
</span><span class="lines">@@ -556,7 +567,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     switch (configuration) {
</span><span class="lines">@@ -642,11 +653,14 @@
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-long
</span><span class="cx"> int32_t toInt32EnforceRange(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (value.isInt32())
</span><span class="cx">         return value.asInt32();
</span><span class="cx"> 
</span><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     return enforceRange(state, x, kMinInt32, kMaxInt32);
</span><span class="cx"> }
</span><span class="lines">@@ -672,11 +686,14 @@
</span><span class="cx"> // http://www.w3.org/TR/WebIDL/#es-unsigned-long
</span><span class="cx"> uint32_t toUInt32EnforceRange(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (value.isUInt32())
</span><span class="cx">         return value.asUInt32();
</span><span class="cx"> 
</span><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     return enforceRange(state, x, 0, kMaxUInt32);
</span><span class="cx"> }
</span><span class="lines">@@ -683,8 +700,11 @@
</span><span class="cx"> 
</span><span class="cx"> int64_t toInt64EnforceRange(ExecState&amp; state, JSC::JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     return enforceRange(state, x, -kJSMaxInteger, kJSMaxInteger);
</span><span class="cx"> }
</span><span class="lines">@@ -691,8 +711,11 @@
</span><span class="cx"> 
</span><span class="cx"> uint64_t toUInt64EnforceRange(ExecState&amp; state, JSC::JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     double x = value.toNumber(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return 0;
</span><span class="cx">     return enforceRange(state, x, 0, kJSMaxInteger);
</span><span class="cx"> }
</span><span class="lines">@@ -856,7 +879,7 @@
</span><span class="cx"> 
</span><span class="cx"> void throwNotSupportedError(JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope, const char* message)
</span><span class="cx"> {
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     String messageString(message);
</span><span class="cx">     throwException(&amp;state, scope, createDOMException(&amp;state, NOT_SUPPORTED_ERR, &amp;messageString));
</span><span class="cx"> }
</span><span class="lines">@@ -863,7 +886,7 @@
</span><span class="cx"> 
</span><span class="cx"> void throwInvalidStateError(JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope, const char* message)
</span><span class="cx"> {
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     String messageString(message);
</span><span class="cx">     throwException(&amp;state, scope, createDOMException(&amp;state, INVALID_STATE_ERR, &amp;messageString));
</span><span class="cx"> }
</span><span class="lines">@@ -870,7 +893,7 @@
</span><span class="cx"> 
</span><span class="cx"> void throwSecurityError(JSC::ExecState&amp; state, JSC::ThrowScope&amp; scope, const String&amp; message)
</span><span class="cx"> {
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     throwException(&amp;state, scope, createDOMException(&amp;state, SECURITY_ERR, message));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -552,7 +552,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue lengthValue = object-&gt;get(&amp;exec, exec.propertyNames().length);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (lengthValue.isUndefinedOrNull()) {
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     length = lengthValue.toUInt32(&amp;exec);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return object;
</span><span class="lines">@@ -604,8 +604,11 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector&lt;T&gt;&amp; vector)
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsUndefined();
</span><span class="cx">     for (size_t i = 0; i &lt; vector.size(); ++i)
</span><span class="cx">         array-&gt;putDirectIndex(exec, i, toJS(exec, globalObject, vector[i]));
</span><span class="lines">@@ -614,8 +617,11 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt; inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector&lt;RefPtr&lt;T&gt;&gt;&amp; vector)
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsUndefined();
</span><span class="cx">     for (size_t i = 0; i &lt; vector.size(); ++i)
</span><span class="cx">         array-&gt;putDirectIndex(exec, i, toJS(exec, globalObject, vector[i].get()));
</span><span class="lines">@@ -699,14 +705,17 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T, size_t inlineCapacity&gt; JSC::JSValue jsFrozenArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector&lt;T, inlineCapacity&gt;&amp; vector)
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSC::MarkedArgumentBuffer list;
</span><span class="cx">     for (auto&amp; element : vector) {
</span><span class="cx">         list.append(JSValueTraits&lt;T&gt;::arrayJSValue(exec, globalObject, element));
</span><del>-        if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSC::jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     auto* array = JSC::constructArray(exec, nullptr, globalObject, list);
</span><del>-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsUndefined();
</span><span class="cx">     return JSC::objectConstructorFreeze(exec, array);
</span><span class="cx"> }
</span><span class="lines">@@ -745,8 +754,10 @@
</span><span class="cx"> template&lt;&gt; struct NativeValueTraits&lt;String&gt; {
</span><span class="cx">     static inline bool nativeValue(JSC::ExecState&amp; exec, JSC::JSValue jsValue, String&amp; indexedValue)
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = exec.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         indexedValue = jsValue.toWTFString(&amp;exec);
</span><del>-        return !exec.hadException();
</del><ins>+        return !scope.exception();
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -753,8 +764,10 @@
</span><span class="cx"> template&lt;&gt; struct NativeValueTraits&lt;unsigned&gt; {
</span><span class="cx">     static inline bool nativeValue(JSC::ExecState&amp; exec, JSC::JSValue jsValue, unsigned&amp; indexedValue)
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = exec.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         indexedValue = jsValue.toUInt32(&amp;exec);
</span><del>-        return !exec.hadException();
</del><ins>+        return !scope.exception();
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -761,8 +774,10 @@
</span><span class="cx"> template&lt;&gt; struct NativeValueTraits&lt;float&gt; {
</span><span class="cx">     static inline bool nativeValue(JSC::ExecState&amp; exec, JSC::JSValue jsValue, float&amp; indexedValue)
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = exec.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         indexedValue = jsValue.toFloat(&amp;exec);
</span><del>-        return !exec.hadException();
</del><ins>+        return !scope.exception();
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -769,8 +784,10 @@
</span><span class="cx"> template&lt;&gt; struct NativeValueTraits&lt;double&gt; {
</span><span class="cx">     static inline bool nativeValue(JSC::ExecState&amp; exec, JSC::JSValue jsValue, double&amp; indexedValue)
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = exec.vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         indexedValue = jsValue.toNumber(&amp;exec);
</span><del>-        return !exec.hadException();
</del><ins>+        return !scope.exception();
</ins><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -807,11 +824,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;T&gt; result;
</span><del>-    forEachInIterable(&amp;exec, value, [&amp;result](JSC::VM&amp;, JSC::ExecState* state, JSC::JSValue jsValue) {
</del><ins>+    forEachInIterable(&amp;exec, value, [&amp;result](JSC::VM&amp; vm, JSC::ExecState* state, JSC::JSValue jsValue) {
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         T convertedValue;
</span><del>-        if (!NativeValueTraits&lt;T&gt;::nativeValue(*state, jsValue, convertedValue))
</del><ins>+        bool success = NativeValueTraits&lt;T&gt;::nativeValue(*state, jsValue, convertedValue);
+        ASSERT_UNUSED(scope, scope.exception() || success);
+        if (!success)
</ins><span class="cx">             return;
</span><del>-        ASSERT(!state-&gt;hadException());
</del><span class="cx">         result.append(convertedValue);
</span><span class="cx">     });
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -75,11 +75,13 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(execState);
</span><span class="cx">     ASSERT(execState-&gt;argumentCount() == 2);
</span><ins>+    VM&amp; vm = execState-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     auto interfaceName = execState-&gt;uncheckedArgument(0).getString(execState);
</span><del>-    ASSERT(!execState-&gt;hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     auto functionName = execState-&gt;uncheckedArgument(1).getString(execState);
</span><del>-    ASSERT(!execState-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     return JSValue::encode(createTypeError(execState, makeThisTypeErrorMessage(interfaceName.utf8().data(), functionName.utf8().data())));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -87,11 +89,13 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(execState);
</span><span class="cx">     ASSERT(execState-&gt;argumentCount() == 2);
</span><ins>+    VM&amp; vm = execState-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     auto interfaceName = execState-&gt;uncheckedArgument(0).getString(execState);
</span><del>-    ASSERT(!execState-&gt;hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     auto attributeName = execState-&gt;uncheckedArgument(1).getString(execState);
</span><del>-    ASSERT(!execState-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     return JSValue::encode(createTypeError(execState, makeGetterTypeErrorMessage(interfaceName.utf8().data(), attributeName.utf8().data())));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMGlobalObjectTaskcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -49,7 +49,9 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         Ref&lt;JSGlobalObjectCallback&gt; protectedThis(*this);
</span><del>-        JSLockHolder lock(m_globalObject-&gt;vm());
</del><ins>+        VM&amp; vm = m_globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">         ExecState* exec = m_globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><span class="lines">@@ -64,7 +66,7 @@
</span><span class="cx">             JSMainThreadExecState::runTask(exec, m_task);
</span><span class="cx">         else
</span><span class="cx">             m_task-&gt;run(exec);
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMIterator.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMIterator.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx">         appendForEachArguments(state, wrapper-&gt;globalObject(), arguments, value);
</span><span class="cx">         arguments.append(wrapper);
</span><span class="cx">         JSC::call(&amp;state, callback, callType, callData, thisValue, arguments);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx">     return JSC::JSValue::encode(JSC::jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMPromisecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -100,11 +100,14 @@
</span><span class="cx"> 
</span><span class="cx"> void rejectPromiseWithExceptionIfAny(JSC::ExecState&amp; state, JSDOMGlobalObject&amp; globalObject, JSPromiseDeferred&amp; promiseDeferred)
</span><span class="cx"> {
</span><del>-    if (!state.hadException())
</del><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
+    if (!scope.exception())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    JSValue error = state.exception()-&gt;value();
-    state.clearException();
</del><ins>+    JSValue error = scope.exception()-&gt;value();
+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     DeferredWrapper::create(&amp;state, &amp;globalObject, &amp;promiseDeferred)-&gt;reject(error);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMPromiseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMPromise.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMPromise.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMPromise.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -158,12 +158,15 @@
</span><span class="cx"> 
</span><span class="cx"> inline JSC::JSValue callPromiseFunction(JSC::ExecState&amp; state, JSC::EncodedJSValue promiseFunction(JSC::ExecState*, JSC::JSPromiseDeferred*))
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = state.vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     JSDOMGlobalObject&amp; globalObject = *JSC::jsCast&lt;JSDOMGlobalObject*&gt;(state.lexicalGlobalObject());
</span><span class="cx">     JSC::JSPromiseDeferred&amp; promiseDeferred = *JSC::JSPromiseDeferred::create(&amp;state, &amp;globalObject);
</span><span class="cx">     promiseFunction(&amp;state, &amp;promiseDeferred);
</span><span class="cx"> 
</span><span class="cx">     rejectPromiseWithExceptionIfAny(state, globalObject, promiseDeferred);
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     return promiseDeferred.promise();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMStringMapCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -75,11 +75,14 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSDOMStringMap::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp;, bool&amp; putResult)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (propertyName.isSymbol())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     String stringValue = value.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -197,13 +197,15 @@
</span><span class="cx">     void call()
</span><span class="cx">     {
</span><span class="cx">         Ref&lt;JSDOMWindowMicrotaskCallback&gt; protectedThis(*this);
</span><del>-        JSLockHolder lock(m_globalObject-&gt;vm());
</del><ins>+        VM&amp; vm = m_globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">         ExecState* exec = m_globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><span class="cx">         JSMainThreadExecState::runTask(exec, m_task);
</span><span class="cx"> 
</span><del>-        ASSERT(!exec-&gt;hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -369,6 +369,9 @@
</span><span class="cx"> 
</span><span class="cx"> void JSDOMWindow::setLocation(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><span class="cx">     // To avoid breaking old widgets, make &quot;var location =&quot; in a top-level frame create
</span><span class="cx">     // a property named &quot;location&quot; instead of performing a navigation (&lt;rdar://problem/5688039&gt;).
</span><span class="lines">@@ -382,7 +385,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     String locationString = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (Location* location = wrapped().location())
</span><span class="lines">@@ -406,15 +409,18 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSDOMWindow::open(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     String urlString = valueToUSVStringWithUndefinedOrNullCheck(&amp;state, state.argument(0));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     JSValue targetValue = state.argument(1);
</span><span class="cx">     AtomicString target = targetValue.isUndefinedOrNull() ? AtomicString(&quot;_blank&quot;, AtomicString::ConstructFromLiteral) : targetValue.toString(&amp;state)-&gt;toAtomicString(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     String windowFeaturesString = valueToStringWithUndefinedOrNullCheck(&amp;state, state.argument(2));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DOMWindow&gt; openedWindow = wrapped().open(urlString, target, windowFeaturesString, activeDOMWindow(&amp;state), firstDOMWindow(&amp;state));
</span><span class="lines">@@ -470,10 +476,10 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     String urlString = valueToStringWithUndefinedOrNullCheck(&amp;state, state.argument(0));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     String dialogFeaturesString = valueToStringWithUndefinedOrNullCheck(&amp;state, state.argument(2));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     DialogHandler handler(state);
</span><span class="lines">@@ -511,16 +517,16 @@
</span><span class="cx">         }
</span><span class="cx">         fillMessagePortArray(state, state.argument(transferablesArgIndex), messagePorts, arrayBuffers);
</span><span class="cx">     }
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto message = SerializedScriptValue::create(&amp;state, state.uncheckedArgument(0), &amp;messagePorts, &amp;arrayBuffers);
</span><span class="cx"> 
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     String targetOrigin = valueToUSVStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(targetOriginArgIndex));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -545,7 +551,7 @@
</span><span class="cx"> 
</span><span class="cx">     ContentSecurityPolicy* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
</span><span class="cx">     std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!action)
</span><span class="lines">@@ -570,7 +576,7 @@
</span><span class="cx"> 
</span><span class="cx">     ContentSecurityPolicy* contentSecurityPolicy = wrapped().document() ? wrapped().document()-&gt;contentSecurityPolicy() : nullptr;
</span><span class="cx">     std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), contentSecurityPolicy);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     int delay = state.argument(1).toInt32(&amp;state);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDataCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -58,11 +58,11 @@
</span><span class="cx">         return throwVMError(&amp;exec, scope, createNotEnoughArgumentsError(&amp;exec));
</span><span class="cx"> 
</span><span class="cx">     double startTime(exec.uncheckedArgument(0).toNumber(&amp;exec));
</span><del>-    if (UNLIKELY(exec.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     double endTime(exec.uncheckedArgument(1).toNumber(&amp;exec));
</span><del>-    if (UNLIKELY(exec.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">     if (valueArgument.isCell() &amp;&amp; valueArgument.asCell()-&gt;inherits(std::remove_pointer&lt;JSArrayBuffer*&gt;::type::info())) {
</span><span class="cx"> 
</span><span class="cx">         ArrayBuffer* data = toArrayBuffer(valueArgument);
</span><del>-        if (UNLIKELY(exec.hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (UNLIKELY(!data)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDeviceMotionEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -47,32 +47,35 @@
</span><span class="cx">     if (value.isUndefinedOrNull())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Given the above test, this will always yield an object.
</span><span class="cx">     JSObject* object = value.toObject(&amp;state);
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     JSValue xValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;x&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideX = !xValue.isUndefinedOrNull();
</span><span class="cx">     double x = xValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSValue yValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;y&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideY = !yValue.isUndefinedOrNull();
</span><span class="cx">     double y = yValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSValue zValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;z&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideZ = !zValue.isUndefinedOrNull();
</span><span class="cx">     double z = zValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (!canProvideX &amp;&amp; !canProvideY &amp;&amp; !canProvideZ)
</span><span class="lines">@@ -86,32 +89,35 @@
</span><span class="cx">     if (value.isUndefinedOrNull())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Given the above test, this will always yield an object.
</span><span class="cx">     JSObject* object = value.toObject(&amp;state);
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     JSValue alphaValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;alpha&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideAlpha = !alphaValue.isUndefinedOrNull();
</span><span class="cx">     double alpha = alphaValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSValue betaValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;beta&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideBeta = !betaValue.isUndefinedOrNull();
</span><span class="cx">     double beta = betaValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSValue gammaValue = object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;gamma&quot;));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx">     bool canProvideGamma = !gammaValue.isUndefinedOrNull();
</span><span class="cx">     double gamma = gammaValue.toNumber(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (!canProvideAlpha &amp;&amp; !canProvideBeta &amp;&amp; !canProvideGamma)
</span><span class="lines">@@ -172,6 +178,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSDeviceMotionEvent::initDeviceMotionEvent(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     const String type = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
</span><span class="cx">     bool bubbles = state.argument(1).toBoolean(&amp;state);
</span><span class="cx">     bool cancelable = state.argument(2).toBoolean(&amp;state);
</span><span class="lines">@@ -179,15 +188,15 @@
</span><span class="cx">     // If any of the parameters are null or undefined, mark them as not provided.
</span><span class="cx">     // Otherwise, use the standard JavaScript conversion.
</span><span class="cx">     RefPtr&lt;DeviceMotionData::Acceleration&gt; acceleration = readAccelerationArgument(state.argument(3), state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DeviceMotionData::Acceleration&gt; accelerationIncludingGravity = readAccelerationArgument(state.argument(4), state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DeviceMotionData::RotationRate&gt; rotationRate = readRotationRateArgument(state.argument(5), state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     bool intervalProvided = !state.argument(6).isUndefinedOrNull();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx"> 
</span><span class="cx"> JSDictionary::GetPropertyResult JSDictionary::tryGetProperty(const char* propertyName, JSValue&amp; finalResult) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     ASSERT(isValid());
</span><span class="cx">     Identifier identifier = Identifier::fromString(m_exec, propertyName);
</span><span class="cx">     bool propertyFound = m_initializerObject.get()-&gt;getPropertySlot(m_exec, identifier, [&amp;] (bool propertyFound, PropertySlot&amp; slot) -&gt; bool {
</span><span class="lines">@@ -86,7 +88,7 @@
</span><span class="cx">         finalResult = slot.getValue(m_exec, identifier);
</span><span class="cx">         return true;
</span><span class="cx">     });
</span><del>-    if (m_exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return ExceptionThrown;
</span><span class="cx">     return propertyFound ? PropertyFound : NoPropertyFound;
</span><span class="cx"> }
</span><span class="lines">@@ -151,17 +153,20 @@
</span><span class="cx"> void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector&lt;String&gt;&amp; result)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(exec);
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (value.isUndefinedOrNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     unsigned length = 0;
</span><span class="cx">     JSObject* object = toJSSequence(*exec, value, length);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0 ; i &lt; length; ++i) {
</span><span class="cx">         JSValue itemValue = object-&gt;get(exec, i);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         result.append(itemValue.toString(exec)-&gt;value(exec));
</span><span class="cx">     }
</span><span class="lines">@@ -221,6 +226,9 @@
</span><span class="cx"> void JSDictionary::convertValue(ExecState* exec, JSValue value, HashSet&lt;AtomicString&gt;&amp; result)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(exec);
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     result.clear();
</span><span class="cx"> 
</span><span class="cx">     if (value.isUndefinedOrNull())
</span><span class="lines">@@ -228,12 +236,12 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned length = 0;
</span><span class="cx">     JSObject* object = toJSSequence(*exec, value, length);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0 ; i &lt; length; ++i) {
</span><span class="cx">         JSValue itemValue = object-&gt;get(exec, i);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         result.add(itemValue.toString(exec)-&gt;value(exec));
</span><span class="cx">     }
</span><span class="lines">@@ -297,17 +305,20 @@
</span><span class="cx"> void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector&lt;RefPtr&lt;MediaStream&gt;&gt;&amp; result)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(exec);
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (value.isUndefinedOrNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     unsigned length = 0;
</span><span class="cx">     JSObject* object = toJSSequence(*exec, value, length);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0 ; i &lt; length; ++i) {
</span><span class="cx">         JSValue itemValue = object-&gt;get(exec, i);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         auto stream = JSMediaStream::toWrapped(itemValue);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -203,6 +203,9 @@
</span><span class="cx"> template &lt;typename T, typename Result&gt;
</span><span class="cx"> JSDictionary::GetPropertyResult JSDictionary::tryGetPropertyAndResult(const char* propertyName, T* context, void (*setter)(T* context, const Result&amp;)) const
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSC::JSValue value;
</span><span class="cx">     GetPropertyResult getPropertyResult = tryGetProperty(propertyName, value);
</span><span class="cx">     switch (getPropertyResult) {
</span><span class="lines">@@ -212,7 +215,7 @@
</span><span class="cx">         Result result;
</span><span class="cx">         convertValue(m_exec, value, result);
</span><span class="cx"> 
</span><del>-        if (m_exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return ExceptionThrown;
</span><span class="cx"> 
</span><span class="cx">         setter(context, result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDocumentCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSDocumentCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -153,16 +153,16 @@
</span><span class="cx">     if (UNLIKELY(state.argumentCount() &lt; 4))
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx">     auto contextId = state.uncheckedArgument(0).toWTFString(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto name = state.uncheckedArgument(1).toWTFString(&amp;state);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto width = convert&lt;int32_t&gt;(state, state.uncheckedArgument(2), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     auto height = convert&lt;int32_t&gt;(state, state.uncheckedArgument(3), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto* context = wrapped().getCSSCanvasContext(WTFMove(contextId), WTFMove(name), WTFMove(width), WTFMove(height));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSEventListener.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSEventListener.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -79,7 +79,12 @@
</span><span class="cx">     if (!scriptExecutionContext || scriptExecutionContext-&gt;isJSExecutionForbidden())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(scriptExecutionContext-&gt;vm());
</del><ins>+    VM&amp; vm = scriptExecutionContext-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    // See https://dom.spec.whatwg.org/#dispatching-events spec on calling handleEvent.
+    // &quot;If this throws an exception, report the exception.&quot; It should not propagate the
+    // exception.
</ins><span class="cx"> 
</span><span class="cx">     JSObject* jsFunction = this-&gt;jsFunction(scriptExecutionContext);
</span><span class="cx">     if (!jsFunction)
</span><span class="lines">@@ -109,6 +114,14 @@
</span><span class="cx">     // If jsFunction is not actually a function, see if it implements the EventListener interface and use that
</span><span class="cx">     if (callType == CallType::None) {
</span><span class="cx">         handleEventFunction = jsFunction-&gt;get(exec, Identifier::fromString(exec, &quot;handleEvent&quot;));
</span><ins>+        if (UNLIKELY(scope.exception())) {
+            Exception* exception = scope.exception();
+            scope.clearException();
+
+            event-&gt;target()-&gt;uncaughtExceptionInEventHandler();
+            reportException(exec, exception);
+            return;
+        }
</ins><span class="cx">         callType = getCallData(handleEventFunction, callData);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -121,7 +134,6 @@
</span><span class="cx">         Event* savedEvent = globalObject-&gt;currentEvent();
</span><span class="cx">         globalObject-&gt;setCurrentEvent(event);
</span><span class="cx"> 
</span><del>-        VM&amp; vm = globalObject-&gt;vm();
</del><span class="cx">         VMEntryScope entryScope(vm, vm.entryScope ? vm.entryScope-&gt;globalObject() : globalObject);
</span><span class="cx"> 
</span><span class="cx">         InspectorInstrumentationCookie cookie = JSMainThreadExecState::instrumentFunctionCall(scriptExecutionContext, callType, callData);
</span><span class="lines">@@ -138,7 +150,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (is&lt;WorkerGlobalScope&gt;(*scriptExecutionContext)) {
</span><span class="cx">             auto scriptController = downcast&lt;WorkerGlobalScope&gt;(*scriptExecutionContext).script();
</span><del>-            bool terminatorCausedException = (exec-&gt;hadException() &amp;&amp; isTerminatedExecutionException(exec-&gt;exception()));
</del><ins>+            bool terminatorCausedException = (scope.exception() &amp;&amp; isTerminatedExecutionException(scope.exception()));
</ins><span class="cx">             if (terminatorCausedException || scriptController-&gt;isTerminatingExecution())
</span><span class="cx">                 scriptController-&gt;forbidExecution();
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned blobPartsLength = 0;
</span><span class="cx">     JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(blobParts);
</span><span class="cx"> 
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">         return throwArgumentTypeError(exec, scope, 1, &quot;filename&quot;, &quot;File&quot;, nullptr, &quot;DOMString&quot;);
</span><span class="cx"> 
</span><span class="cx">     String filename = arg.toWTFString(&amp;exec).replace('/', ':');
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     String normalizedType;
</span><span class="lines">@@ -87,7 +87,7 @@
</span><span class="cx">         // Attempt to get the type property.
</span><span class="cx">         String type;
</span><span class="cx">         dictionary.get(&quot;type&quot;, type);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         normalizedType = Blob::normalizedContentType(type);
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx">         // Only try to parse the lastModified date if there was not an invalid type argument.
</span><span class="cx">         if (type.isEmpty() ||  !normalizedType.isEmpty()) {
</span><span class="cx">             dictionary.get(&quot;lastModified&quot;, lastModified);
</span><del>-            if (exec.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; blobPartsLength; ++i) {
</span><span class="cx">         JSValue item = blobParts-&gt;get(&amp;exec, i);
</span><del>-        if (exec.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (ArrayBuffer* arrayBuffer = toArrayBuffer(item))
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">             blobBuilder.append(blob);
</span><span class="cx">         else {
</span><span class="cx">             String string = item.toWTFString(&amp;exec);
</span><del>-            if (exec.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             blobBuilder.append(string, ASCIILiteral(&quot;transparent&quot;));
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSGeolocationCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -71,6 +71,9 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;PositionOptions&gt; createPositionOptions(ExecState* exec, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Create default options.
</span><span class="cx">     auto options = PositionOptions::create();
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Given the above test, this will always yield an object.
</span><span class="cx">     JSObject* object = value.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     // Create the dictionary wrapper from the initializer object.
</span><span class="cx">     JSDictionary dictionary(exec, object);
</span><span class="lines">@@ -99,19 +102,22 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSGeolocation::getCurrentPosition(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions
</span><span class="cx"> 
</span><span class="cx">     auto positionCallback = createFunctionOnlyCallback&lt;JSPositionCallback&gt;(&amp;state, globalObject(), state.argument(0));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     ASSERT(positionCallback);
</span><span class="cx"> 
</span><span class="cx">     auto positionErrorCallback = createFunctionOnlyCallback&lt;JSPositionErrorCallback&gt;(&amp;state, globalObject(), state.argument(1), CallbackAllowUndefined | CallbackAllowNull);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto positionOptions = createPositionOptions(&amp;state, state.argument(2));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     ASSERT(positionOptions);
</span><span class="cx"> 
</span><span class="lines">@@ -121,19 +127,22 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSGeolocation::watchPosition(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Arguments: PositionCallback, (optional)PositionErrorCallback, (optional)PositionOptions
</span><span class="cx"> 
</span><span class="cx">     auto positionCallback = createFunctionOnlyCallback&lt;JSPositionCallback&gt;(&amp;state, globalObject(), state.argument(0));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     ASSERT(positionCallback);
</span><span class="cx"> 
</span><span class="cx">     auto positionErrorCallback = createFunctionOnlyCallback&lt;JSPositionErrorCallback&gt;(&amp;state, globalObject(), state.argument(1), CallbackAllowUndefined | CallbackAllowNull);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     auto positionOptions = createPositionOptions(&amp;state, state.argument(2));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     ASSERT(positionOptions);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLAllCollectionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -53,6 +53,9 @@
</span><span class="cx"> // HTMLAllCollections are strange objects, they support both get and call.
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL callHTMLAllCollection(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (exec-&gt;argumentCount() &lt; 1)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +68,7 @@
</span><span class="cx">     if (exec-&gt;argumentCount() == 1) {
</span><span class="cx">         // Support for document.all(&lt;index&gt;) etc.
</span><span class="cx">         String string = exec-&gt;argument(0).toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (Optional&lt;uint32_t&gt; index = parseIndex(*string.impl()))
</span><span class="cx">             return JSValue::encode(toJS(exec, jsCollection-&gt;globalObject(), collection.item(index.value())));
</span><span class="lines">@@ -76,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     // The second arg, if set, is the index of the item we want
</span><span class="cx">     String string = exec-&gt;argument(0).toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (Optional&lt;uint32_t&gt; index = parseIndex(*exec-&gt;argument(1).toWTFString(exec).impl())) {
</span><span class="cx">         if (auto* item = collection.namedItemWithIndex(string, index.value()))
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLCanvasElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -46,12 +46,15 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx"> static void get3DContextAttributes(ExecState&amp; state, RefPtr&lt;CanvasContextAttributes&gt;&amp; attrs)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue initializerValue = state.argument(1);
</span><span class="cx">     if (initializerValue.isUndefinedOrNull())
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="cx">     JSObject* initializerObject = initializerValue.toObject(&amp;state);
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     JSDictionary dictionary(&amp;state, initializerObject);
</span><span class="cx">     
</span><span class="cx">     GraphicsContext3D::Attributes graphicsAttrs;
</span><span class="lines">@@ -83,7 +86,7 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     if (HTMLCanvasElement::is3dType(contextId)) {
</span><span class="cx">         get3DContextAttributes(state, attrs);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     if (!elementInterface-&gt;isUpgradingElement()) {
</span><span class="cx">         Structure* baseStructure = getDOMStructure&lt;JSHTMLElement&gt;(vm, *globalObject);
</span><span class="cx">         auto* newElementStructure = InternalFunction::createSubclassStructure(&amp;exec, newTargetValue, baseStructure);
</span><del>-        if (UNLIKELY(exec.hadException()))
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         Ref&lt;HTMLElement&gt; element = HTMLElement::create(elementInterface-&gt;name(), document);
</span><span class="lines">@@ -98,12 +98,12 @@
</span><span class="cx">     ASSERT(elementWrapperValue.isObject());
</span><span class="cx"> 
</span><span class="cx">     JSValue newPrototype = newTarget-&gt;get(&amp;exec, vm.propertyNames-&gt;prototype);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSObject* elementWrapperObject = asObject(elementWrapperValue);
</span><span class="cx">     JSObject::setPrototype(elementWrapperObject, &amp;exec, newPrototype, true /* shouldThrowIfCantSet */);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     elementInterface-&gt;didUpgradeLastElementInConstructionStack();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHistoryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -63,18 +63,18 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto historyState = SerializedScriptValue::create(&amp;state, state.uncheckedArgument(0), 0, 0);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: title should not be nullable.
</span><span class="cx">     String title = valueToStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(1));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     String url;
</span><span class="cx">     if (argCount &gt; 2) {
</span><span class="cx">         url = valueToUSVStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(2));
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -97,18 +97,18 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto historyState = SerializedScriptValue::create(&amp;state, state.uncheckedArgument(0), 0, 0);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: title should not be nullable.
</span><span class="cx">     String title = valueToStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(1));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     String url;
</span><span class="cx">     if (argCount &gt; 2) {
</span><span class="cx">         url = valueToUSVStringWithUndefinedOrNullCheck(&amp;state, state.uncheckedArgument(2));
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSIDBDatabaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     String name = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     JSValue optionsValue = state.argument(1);
</span><span class="lines">@@ -66,17 +66,17 @@
</span><span class="cx">     bool autoIncrement = false;
</span><span class="cx">     if (!optionsValue.isUndefinedOrNull()) {
</span><span class="cx">         JSValue keyPathValue = optionsValue.get(&amp;state, Identifier::fromString(&amp;state, &quot;keyPath&quot;));
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">         if (!keyPathValue.isUndefinedOrNull()) {
</span><span class="cx">             keyPath = idbKeyPathFromValue(state, keyPathValue);
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         autoIncrement = optionsValue.get(&amp;state, Identifier::fromString(&amp;state, &quot;autoIncrement&quot;)).toBoolean(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSLazyEventListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSLazyEventListener.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -98,6 +98,9 @@
</span><span class="cx">     if (!globalObject)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     ExecState* exec = globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><span class="cx">     MarkedArgumentBuffer args;
</span><span class="lines">@@ -112,9 +115,9 @@
</span><span class="cx">         exec, exec-&gt;lexicalGlobalObject(), args, Identifier::fromString(exec, m_functionName),
</span><span class="cx">         m_sourceURL, m_sourcePosition, overrideLineNumber);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         reportCurrentException(exec);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -123,14 +126,13 @@
</span><span class="cx">     if (m_originalNode) {
</span><span class="cx">         if (!wrapper()) {
</span><span class="cx">             // Ensure that 'node' has a JavaScript wrapper to mark the event listener we're creating.
</span><del>-            JSLockHolder lock(exec);
</del><span class="cx">             // FIXME: Should pass the global object associated with the node
</span><del>-            setWrapper(exec-&gt;vm(), asObject(toJS(exec, globalObject, *m_originalNode)));
</del><ins>+            setWrapper(vm, asObject(toJS(exec, globalObject, *m_originalNode)));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Add the event's home element to the scope
</span><span class="cx">         // (and the document, and the form - see JSHTMLElement::eventHandlerScope)
</span><del>-        listenerAsFunction-&gt;setScope(exec-&gt;vm(), jsCast&lt;JSNode*&gt;(wrapper())-&gt;pushEventHandlerScope(exec, listenerAsFunction-&gt;scope()));
</del><ins>+        listenerAsFunction-&gt;setScope(vm, jsCast&lt;JSNode*&gt;(wrapper())-&gt;pushEventHandlerScope(exec, listenerAsFunction-&gt;scope()));
</ins><span class="cx">     }
</span><span class="cx">     return jsFunction;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMainThreadExecStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -107,11 +107,14 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue linkAndEvaluateModule(JSC::ExecState* exec, const JSC::Identifier&amp; moduleKey, JSC::JSValue initiator, NakedPtr&lt;JSC::Exception&gt;&amp; returnedException)
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = exec-&gt;vm();
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+    
</ins><span class="cx">         JSMainThreadExecState currentState(exec);
</span><span class="cx">         JSC::JSValue returnValue = JSC::linkAndEvaluateModule(exec, moduleKey, initiator);
</span><del>-        if (exec-&gt;hadException()) {
-            returnedException = exec-&gt;vm().exception();
-            exec-&gt;clearException();
</del><ins>+        if (UNLIKELY(scope.exception())) {
+            returnedException = scope.exception();
+            scope.clearException();
</ins><span class="cx">             return JSC::jsUndefined();
</span><span class="cx">         }
</span><span class="cx">         return returnValue;
</span><span class="lines">@@ -131,8 +134,10 @@
</span><span class="cx"> 
</span><span class="cx">     ~JSMainThreadExecState()
</span><span class="cx">     {
</span><ins>+        JSC::VM&amp; vm = s_mainThreadState-&gt;vm();
+        auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">         ASSERT(isMainThread());
</span><del>-        ASSERT(!s_mainThreadState-&gt;hadException());
</del><ins>+        ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx"> 
</span><span class="cx">         bool didExitJavaScript = s_mainThreadState &amp;&amp; !m_previousState;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessageEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -104,6 +104,9 @@
</span><span class="cx"> 
</span><span class="cx"> static JSC::JSValue handleInitMessageEvent(JSMessageEvent* jsEvent, JSC::ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     const String&amp; typeArg = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
</span><span class="cx">     bool canBubbleArg = state.argument(1).toBoolean(&amp;state);
</span><span class="cx">     bool cancelableArg = state.argument(2).toBoolean(&amp;state);
</span><span class="lines">@@ -116,16 +119,16 @@
</span><span class="cx">         messagePorts = std::make_unique&lt;MessagePortArray&gt;();
</span><span class="cx">         arrayBuffers = std::make_unique&lt;ArrayBufferArray&gt;();
</span><span class="cx">         fillMessagePortArray(state, state.argument(7), *messagePorts, *arrayBuffers);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><del>-    Deprecated::ScriptValue dataArg(state.vm(), state.argument(3));
-    if (state.hadException())
</del><ins>+    Deprecated::ScriptValue dataArg(vm, state.argument(3));
+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     MessageEvent&amp; event = jsEvent-&gt;wrapped();
</span><span class="cx">     event.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, sourceArg, WTFMove(messagePorts));
</span><del>-    jsEvent-&gt;m_data.set(state.vm(), jsEvent, dataArg.jsValue());
</del><ins>+    jsEvent-&gt;m_data.set(vm, jsEvent, dataArg.jsValue());
</ins><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessagePortCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -73,12 +73,12 @@
</span><span class="cx">     // Validation of sequence types, per WebIDL spec 4.1.13.
</span><span class="cx">     unsigned length = 0;
</span><span class="cx">     JSObject* object = toJSSequence(state, value, length);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0 ; i &lt; length; ++i) {
</span><span class="cx">         JSValue value = object-&gt;get(&amp;state, i);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         // Validation of non-null objects, per HTML5 spec 10.3.3.
</span><span class="cx">         if (value.isUndefinedOrNull()) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessagePortCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">         ArrayBufferArray arrayBufferArray;
</span><span class="cx">         fillMessagePortArray(state, state.argument(1), portArray, arrayBufferArray);
</span><span class="cx">         auto message = SerializedScriptValue::create(&amp;state, state.uncheckedArgument(0), &amp;portArray, &amp;arrayBufferArray);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return JSC::jsUndefined();
</span><span class="cx"> 
</span><span class="cx">         ExceptionCode ec = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMockContentFilterSettingsCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     uint8_t nativeValue { convert&lt;uint8_t&gt;(state, value, EnforceRange) };
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     DecisionPoint decisionPoint { static_cast&lt;DecisionPoint&gt;(nativeValue) };
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     uint8_t nativeValue { convert&lt;uint8_t&gt;(state, value, EnforceRange) };
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return Decision::Allow;
</span><span class="cx"> 
</span><span class="cx">     Decision decision { static_cast&lt;Decision&gt;(nativeValue) };
</span><span class="lines">@@ -119,8 +119,11 @@
</span><span class="cx"> 
</span><span class="cx"> void JSMockContentFilterSettings::setDecision(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     Decision decision { toDecision(state, value) };
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     wrapped().setDecision(decision);
</span><span class="lines">@@ -133,8 +136,11 @@
</span><span class="cx"> 
</span><span class="cx"> void JSMockContentFilterSettings::setUnblockRequestDecision(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     Decision unblockRequestDecision { toDecision(state, value) };
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     wrapped().setUnblockRequestDecision(unblockRequestDecision);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeFilterCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -49,11 +49,12 @@
</span><span class="cx">     ExecState* state = m_data-&gt;globalObject()-&gt;globalExec();
</span><span class="cx">     MarkedArgumentBuffer args;
</span><span class="cx">     args.append(toJS(state, m_data-&gt;globalObject(), node));
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return NodeFilter::FILTER_REJECT;
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; returnedException;
</span><span class="cx">     JSValue value = m_data-&gt;invokeCallback(args, JSCallbackData::CallbackType::FunctionOrObject, Identifier::fromString(state, &quot;acceptNode&quot;), returnedException);
</span><ins>+    ASSERT(!scope.exception() || returnedException);
</ins><span class="cx">     if (returnedException) {
</span><span class="cx">         // Rethrow exception.
</span><span class="cx">         throwException(state, scope, returnedException);
</span><span class="lines">@@ -62,7 +63,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     uint16_t result = convert&lt;uint16_t&gt;(*state, value, NormalConversion);
</span><del>-    if (state-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return NodeFilter::FILTER_REJECT;
</span><span class="cx"> 
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNodeOrStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSNodeOrString.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/JSString.h&gt;
</span><ins>+#include &lt;JavaScriptCore/ThrowScope.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="lines">@@ -35,6 +36,9 @@
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt; toNodeOrStringVector(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     size_t argumentCount = state.argumentCount();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;std::experimental::variant&lt;Ref&lt;Node&gt;, String&gt;&gt; result;
</span><span class="lines">@@ -46,7 +50,7 @@
</span><span class="cx">             result.uncheckedAppend(node-&gt;wrapped());
</span><span class="cx">         else {
</span><span class="cx">             String string = value.toWTFString(&amp;state);
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return { };
</span><span class="cx">             result.uncheckedAppend(string);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSQLTransactionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -44,6 +44,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSSQLTransaction::executeSql(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!state.argumentCount()) {
</span><span class="cx">         setDOMException(&amp;state, SYNTAX_ERR);
</span><span class="cx">         return jsUndefined();
</span><span class="lines">@@ -50,7 +53,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     String sqlStatement = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     // Now assemble the list of SQL arguments
</span><span class="lines">@@ -63,15 +66,15 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         JSValue lengthValue = object-&gt;get(&amp;state, state.propertyNames().length);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">         unsigned length = lengthValue.toUInt32(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">         for (unsigned i = 0 ; i &lt; length; ++i) {
</span><span class="cx">             JSValue value = object-&gt;get(&amp;state, i);
</span><del>-            if (state.hadException())
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">             if (value.isUndefinedOrNull())
</span><span class="lines">@@ -81,7 +84,7 @@
</span><span class="cx">             else {
</span><span class="cx">                 // Convert the argument to a string and append it
</span><span class="cx">                 sqlValues.append(value.toString(&amp;state)-&gt;value(&amp;state));
</span><del>-                if (state.hadException())
</del><ins>+                if (UNLIKELY(scope.exception()))
</ins><span class="cx">                     return jsUndefined();
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSVGLengthCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSSVGLengthCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     unsigned short unitType = state.uncheckedArgument(0).toUInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSStorageCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSStorageCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -79,16 +79,19 @@
</span><span class="cx"> 
</span><span class="cx"> void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray&amp; propertyNames, EnumerationMode mode)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSStorage* thisObject = jsCast&lt;JSStorage*&gt;(object);
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     unsigned length = thisObject-&gt;wrapped().length(ec);
</span><span class="cx">     setDOMException(exec, ec);
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         propertyNames.add(Identifier::fromString(exec, thisObject-&gt;wrapped().key(i, ec)));
</span><span class="cx">         setDOMException(exec, ec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="lines">@@ -97,6 +100,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool JSStorage::putDelegate(ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp;, bool&amp; putResult)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // Only perform the custom put if the object doesn't have a native property by this name.
</span><span class="cx">     // Since hasProperty() would end up calling canGetItemsForName() and be fooled, we need to check
</span><span class="cx">     // the native property slots manually.
</span><span class="lines">@@ -110,7 +116,7 @@
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     String stringValue = value.toString(exec)-&gt;value(exec);
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         // The return value indicates whether putDelegate() should handle the put operation (which
</span><span class="cx">         // if true, tells the caller not to execute the generic put). It does not indicate whether
</span><span class="cx">         // putDelegate() did successfully complete the operation or not (which it didn't in this
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTextTrackCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSTextTrackCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -44,8 +44,11 @@
</span><span class="cx"> void JSTextTrack::setLanguage(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto&amp; string = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     wrapped().setLanguage(string);
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSVideoTrackCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSVideoTrackCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -43,8 +43,11 @@
</span><span class="cx"> void JSVideoTrack::setKind(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto&amp; string = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     wrapped().setKind(string);
</span><span class="cx"> #else
</span><span class="lines">@@ -56,8 +59,11 @@
</span><span class="cx"> void JSVideoTrack::setLanguage(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     auto&amp; string = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx">     wrapped().setLanguage(string);
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGL2RenderingContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSWebGL2RenderingContextCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -106,10 +106,10 @@
</span><span class="cx"> 
</span><span class="cx">     WebGL2RenderingContext&amp; context = wrapped();
</span><span class="cx">     unsigned pname = exec.uncheckedArgument(0).toInt32(&amp;exec);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     unsigned index = exec.uncheckedArgument(1).toInt32(&amp;exec);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info = context.getIndexedParameter(pname, index);
</span><span class="cx">     return toJS(&amp;exec, globalObject(), info);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebGLRenderingContextBaseCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextBaseCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -199,10 +199,10 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     WebGLRenderingContextBase&amp; context = obj-&gt;wrapped();
</span><span class="cx">     unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info;
</span><span class="cx">     switch (objectType) {
</span><span class="lines">@@ -335,7 +335,7 @@
</span><span class="cx">     
</span><span class="cx">     WebGLRenderingContextBase&amp; context = wrapped();
</span><span class="cx">     const String name = state.uncheckedArgument(0).toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLExtension* extension = context.getExtension(name);
</span><span class="cx">     return toJS(&amp;state, globalObject(), extension);
</span><span class="lines">@@ -357,13 +357,13 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     WebGLRenderingContextBase&amp; context = wrapped();
</span><span class="cx">     unsigned target = state.uncheckedArgument(0).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     unsigned attachment = state.uncheckedArgument(1).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     unsigned pname = state.uncheckedArgument(2).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info = context.getFramebufferAttachmentParameter(target, attachment, pname, ec);
</span><span class="cx">     if (ec) {
</span><span class="lines">@@ -384,7 +384,7 @@
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     WebGLRenderingContextBase&amp; context = wrapped();
</span><span class="cx">     unsigned pname = state.uncheckedArgument(0).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info = context.getParameter(pname, ec);
</span><span class="cx">     if (ec) {
</span><span class="lines">@@ -408,7 +408,7 @@
</span><span class="cx">     if (!program &amp;&amp; !state.uncheckedArgument(0).isUndefinedOrNull())
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info = context.getProgramParameter(program, pname, ec);
</span><span class="cx">     if (ec) {
</span><span class="lines">@@ -437,7 +437,7 @@
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     WebGLShader* shader = JSWebGLShader::toWrapped(state.uncheckedArgument(0));
</span><span class="cx">     unsigned pname = state.uncheckedArgument(1).toInt32(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     WebGLGetInfo info = context.getShaderParameter(shader, pname, ec);
</span><span class="cx">     if (ec) {
</span><span class="lines">@@ -496,6 +496,9 @@
</span><span class="cx"> template&lt;typename T, size_t inlineCapacity&gt;
</span><span class="cx"> bool toVector(JSC::ExecState&amp; state, JSC::JSValue value, Vector&lt;T, inlineCapacity&gt;&amp; vector)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!value.isObject())
</span><span class="cx">         return false;
</span><span class="cx">     
</span><span class="lines">@@ -508,7 +511,7 @@
</span><span class="cx">     
</span><span class="cx">     for (int32_t i = 0; i &lt; length; ++i) {
</span><span class="cx">         JSC::JSValue v = object-&gt;get(&amp;state, i);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         vector[i] = static_cast&lt;T&gt;(v.toNumber(&amp;state));
</span><span class="cx">     }
</span><span class="lines">@@ -556,11 +559,11 @@
</span><span class="cx">     } else
</span><span class="cx">         index = state.uncheckedArgument(0).toInt32(&amp;state);
</span><span class="cx">     
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;Float32Array&gt; webGLArray = toFloat32Array(state.uncheckedArgument(1));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -707,7 +710,7 @@
</span><span class="cx">         return throwTypeError(&amp;state, scope);
</span><span class="cx">     
</span><span class="cx">     bool transpose = state.uncheckedArgument(1).toBoolean(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     
</span><span class="cx">     RefPtr&lt;Float32Array&gt; webGLArray = toFloat32Array(state.uncheckedArgument(2));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebKitSubtleCryptoCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -63,11 +63,14 @@
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;CryptoAlgorithm&gt; createAlgorithmFromJSValue(ExecState&amp; state, JSValue value)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     CryptoAlgorithmIdentifier algorithmIdentifier;
</span><del>-    if (!JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(&amp;state, value, algorithmIdentifier)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(&amp;state, value, algorithmIdentifier);
+    ASSERT_UNUSED(scope, scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return nullptr;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto result = CryptoAlgorithmRegistry::singleton().create(algorithmIdentifier);
</span><span class="cx">     if (!result)
</span><span class="lines">@@ -81,7 +84,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     String keyFormatString = value.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (keyFormatString == &quot;raw&quot;)
</span><span class="cx">         result = CryptoKeyFormat::Raw;
</span><span class="lines">@@ -114,7 +117,7 @@
</span><span class="cx">     for (size_t i = 0; i &lt; array-&gt;length(); ++i) {
</span><span class="cx">         JSValue element = array-&gt;getIndex(&amp;state, i);
</span><span class="cx">         String usageString = element.toString(&amp;state)-&gt;value(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return false;
</span><span class="cx">         if (usageString == &quot;encrypt&quot;)
</span><span class="cx">             result |= CryptoKeyUsageEncrypt;
</span><span class="lines">@@ -145,16 +148,14 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -167,10 +168,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="lines">@@ -201,16 +202,14 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -223,10 +222,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="cx">     RefPtr&lt;DeferredWrapper&gt; wrapper = DeferredWrapper::create(&amp;state, globalObject(), promiseDeferred);
</span><span class="lines">@@ -256,16 +255,14 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForSign(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -278,10 +275,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="cx">     RefPtr&lt;DeferredWrapper&gt; wrapper = DeferredWrapper::create(&amp;state, globalObject(), promiseDeferred);
</span><span class="lines">@@ -311,16 +308,14 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForVerify(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -333,16 +328,16 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoOperationData signature;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), signature)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), signature);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(3), data)) {
-        ASSERT(state.hadException());
</del><ins>+    success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(3), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="cx">     RefPtr&lt;DeferredWrapper&gt; wrapper = DeferredWrapper::create(&amp;state, globalObject(), promiseDeferred);
</span><span class="lines">@@ -372,22 +367,20 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForDigest(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="cx">     RefPtr&lt;DeferredWrapper&gt; wrapper = DeferredWrapper::create(&amp;state, globalObject(), promiseDeferred);
</span><span class="lines">@@ -417,30 +410,28 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForGenerateKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     bool extractable = false;
</span><span class="cx">     if (state.argumentCount() &gt;= 2) {
</span><span class="cx">         extractable = state.uncheckedArgument(1).toBoolean(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyUsage keyUsages = 0;
</span><span class="cx">     if (state.argumentCount() &gt;= 3) {
</span><del>-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(2), keyUsages)) {
-            ASSERT(state.hadException());
</del><ins>+        auto success = cryptoKeyUsagesFromJSValue(state, state.argument(2), keyUsages);
+        ASSERT(scope.exception() || success);
+        if (!success)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="lines">@@ -484,7 +475,7 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         keySerialization = std::make_unique&lt;JSCryptoKeySerializationJWK&gt;(&amp;state, jwkString);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -497,11 +488,11 @@
</span><span class="cx"> 
</span><span class="cx">     Optional&lt;CryptoAlgorithmPair&gt; reconciledResult = keySerialization-&gt;reconcileAlgorithm(algorithm.get(), parameters.get());
</span><span class="cx">     if (!reconciledResult) {
</span><del>-        if (!state.hadException())
</del><ins>+        if (!scope.exception())
</ins><span class="cx">             throwTypeError(&amp;state, scope, ASCIILiteral(&quot;Algorithm specified in key is not compatible with one passed to importKey as argument&quot;));
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     algorithm = reconciledResult-&gt;algorithm;
</span><span class="lines">@@ -513,15 +504,15 @@
</span><span class="cx">     ASSERT(parameters);
</span><span class="cx"> 
</span><span class="cx">     keySerialization-&gt;reconcileExtractable(extractable);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     keySerialization-&gt;reconcileUsages(keyUsages);
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     auto keyData = keySerialization-&gt;keyData();
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -539,45 +530,44 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyFormat keyFormat;
</span><del>-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     CryptoOperationData data;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
-        ASSERT(state.hadException());
</del><ins>+    success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoAlgorithm&gt; algorithm;
</span><span class="cx">     RefPtr&lt;CryptoAlgorithmParameters&gt; parameters;
</span><span class="cx">     if (!state.uncheckedArgument(2).isNull()) {
</span><span class="cx">         algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(2));
</span><del>-        if (!algorithm) {
-            ASSERT(state.hadException());
</del><ins>+        ASSERT(scope.exception() || algorithm);
+        if (!algorithm)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><ins>+
</ins><span class="cx">         parameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(2));
</span><del>-        if (!parameters) {
-            ASSERT(state.hadException());
</del><ins>+        ASSERT(scope.exception() || parameters);
+        if (!parameters)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool extractable = false;
</span><span class="cx">     if (state.argumentCount() &gt;= 4) {
</span><span class="cx">         extractable = state.uncheckedArgument(3).toBoolean(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyUsage keyUsages = 0;
</span><span class="cx">     if (state.argumentCount() &gt;= 5) {
</span><del>-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(4), keyUsages)) {
-            ASSERT(state.hadException());
</del><ins>+        auto success = cryptoKeyUsagesFromJSValue(state, state.argument(4), keyUsages);
+        ASSERT(scope.exception() || success);
+        if (!success)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="lines">@@ -590,7 +580,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     WebCore::importKey(state, keyFormat, data, WTFMove(algorithm), WTFMove(parameters), extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     return promiseDeferred-&gt;promise();
</span><span class="lines">@@ -617,7 +607,7 @@
</span><span class="cx">     }
</span><span class="cx">     case CryptoKeyFormat::JWK: {
</span><span class="cx">         String result = JSCryptoKeySerializationJWK::serialize(&amp;state, key);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return;
</span><span class="cx">         CString utf8String = result.utf8(StrictConversion);
</span><span class="cx">         Vector&lt;uint8_t&gt; resultBuffer;
</span><span class="lines">@@ -640,10 +630,10 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyFormat keyFormat;
</span><del>-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -659,7 +649,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     WebCore::exportKey(state, keyFormat, *key, WTFMove(successCallback), WTFMove(failureCallback));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     return promiseDeferred-&gt;promise();
</span><span class="lines">@@ -674,10 +664,10 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyFormat keyFormat;
</span><del>-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
</span><span class="cx">     if (!key)
</span><span class="lines">@@ -694,16 +684,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
</span><del>-    if (!algorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || algorithm);
+    if (!algorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(3));
</span><del>-    if (!parameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || parameters);
+    if (!parameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="cx">     RefPtr&lt;DeferredWrapper&gt; wrapper = DeferredWrapper::create(&amp;state, globalObject(), promiseDeferred);
</span><span class="lines">@@ -746,16 +734,16 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyFormat keyFormat;
</span><del>-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
</del><ins>+    auto success = cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     CryptoOperationData wrappedKeyData;
</span><del>-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), wrappedKeyData)) {
-        ASSERT(state.hadException());
</del><ins>+    success = cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), wrappedKeyData);
+    ASSERT(scope.exception() || success);
+    if (!success)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoKey&gt; unwrappingKey = JSCryptoKey::toWrapped(state.uncheckedArgument(2));
</span><span class="cx">     if (!unwrappingKey)
</span><span class="lines">@@ -768,44 +756,41 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     auto unwrapAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
</span><del>-    if (!unwrapAlgorithm) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || unwrapAlgorithm);
+    if (!unwrapAlgorithm)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx">     auto unwrapAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, unwrapAlgorithm-&gt;identifier(), state.uncheckedArgument(3));
</span><del>-    if (!unwrapAlgorithmParameters) {
-        ASSERT(state.hadException());
</del><ins>+    ASSERT(scope.exception() || unwrapAlgorithmParameters);
+    if (!unwrapAlgorithmParameters)
</ins><span class="cx">         return jsUndefined();
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CryptoAlgorithm&gt; unwrappedKeyAlgorithm;
</span><span class="cx">     RefPtr&lt;CryptoAlgorithmParameters&gt; unwrappedKeyAlgorithmParameters;
</span><span class="cx">     if (!state.uncheckedArgument(4).isNull()) {
</span><span class="cx">         unwrappedKeyAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(4));
</span><del>-        if (!unwrappedKeyAlgorithm) {
-            ASSERT(state.hadException());
</del><ins>+        ASSERT(scope.exception() || unwrappedKeyAlgorithm);
+        if (!unwrappedKeyAlgorithm)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><ins>+
</ins><span class="cx">         unwrappedKeyAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, unwrappedKeyAlgorithm-&gt;identifier(), state.uncheckedArgument(4));
</span><del>-        if (!unwrappedKeyAlgorithmParameters) {
-            ASSERT(state.hadException());
</del><ins>+        ASSERT(scope.exception() || unwrappedKeyAlgorithmParameters);
+        if (!unwrappedKeyAlgorithmParameters)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool extractable = false;
</span><span class="cx">     if (state.argumentCount() &gt;= 6) {
</span><span class="cx">         extractable = state.uncheckedArgument(5).toBoolean(&amp;state);
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CryptoKeyUsage keyUsages = 0;
</span><span class="cx">     if (state.argumentCount() &gt;= 7) {
</span><del>-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(6), keyUsages)) {
-            ASSERT(state.hadException());
</del><ins>+        auto success = cryptoKeyUsagesFromJSValue(state, state.argument(6), keyUsages);
+        ASSERT(scope.exception() || success);
+        if (!success)
</ins><span class="cx">             return jsUndefined();
</span><del>-        }
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
</span><span class="lines">@@ -819,11 +804,15 @@
</span><span class="cx">         auto importFailureCallback = [wrapper]() mutable {
</span><span class="cx">             wrapper-&gt;reject(nullptr);
</span><span class="cx">         };
</span><ins>+
+        VM&amp; vm = domGlobalObject-&gt;vm();
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">         ExecState&amp; state = *domGlobalObject-&gt;globalExec();
</span><span class="cx">         WebCore::importKey(state, keyFormat, std::make_pair(result.data(), result.size()), unwrappedKeyAlgorithm, unwrappedKeyAlgorithmParameters, extractable, keyUsages, WTFMove(importSuccessCallback), WTFMove(importFailureCallback));
</span><del>-        if (state.hadException()) {
</del><ins>+        if (UNLIKELY(scope.exception())) {
</ins><span class="cx">             // FIXME: Report exception details to console, and possibly to calling script once there is a standardized way to pass errors to WebCrypto promise reject functions.
</span><del>-            state.clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx">             wrapper-&gt;reject(nullptr);
</span><span class="cx">         }
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx">         return throwVMError(&amp;exec, scope, createNotEnoughArgumentsError(&amp;exec));
</span><span class="cx"> 
</span><span class="cx">     String scriptURL = exec.uncheckedArgument(0).toWTFString(&amp;exec);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><span class="cx">     // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerGlobalScopeCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -61,6 +61,9 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JSWorkerGlobalScope::importScripts(ExecState&amp; state)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!state.argumentCount())
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><span class="lines">@@ -67,7 +70,7 @@
</span><span class="cx">     Vector&lt;String&gt; urls;
</span><span class="cx">     for (unsigned i = 0; i &lt; state.argumentCount(); ++i) {
</span><span class="cx">         urls.append(valueToUSVString(&amp;state, state.uncheckedArgument(i)));
</span><del>-        if (state.hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return jsUndefined();
</span><span class="cx">     }
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="lines">@@ -86,7 +89,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), wrapped().contentSecurityPolicy());
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     if (!action)
</span><span class="cx">         return jsNumber(0);
</span><span class="lines">@@ -103,7 +106,7 @@
</span><span class="cx">         return throwException(&amp;state, scope, createNotEnoughArgumentsError(&amp;state));
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;ScheduledAction&gt; action = ScheduledAction::create(&amp;state, globalObject()-&gt;world(), wrapped().contentSecurityPolicy());
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return jsUndefined();
</span><span class="cx">     if (!action)
</span><span class="cx">         return jsNumber(0);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsReadableStreamDefaultControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx"> 
</span><span class="cx">     auto function = object.get(&amp;state, JSC::Identifier::fromString(&amp;state, propertyName));
</span><del>-    if (state.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsUndefined();
</span><span class="cx"> 
</span><span class="cx">     if (!function.isFunction()) {
</span><span class="lines">@@ -70,19 +70,22 @@
</span><span class="cx"> 
</span><span class="cx"> bool ReadableStreamDefaultController::isControlledReadableStreamLocked() const
</span><span class="cx"> {
</span><del>-    auto&amp; state = *globalObject()-&gt;globalExec();
-    JSC::JSLockHolder lock(&amp;state);
</del><ins>+    auto globalObject = this-&gt;globalObject();
+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    auto&amp; state = *globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    auto&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(state.vm().clientData);
</del><ins>+    auto&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);
</ins><span class="cx">     auto readableStream = m_jsController-&gt;get(&amp;state, clientData.builtinNames().controlledReadableStreamPrivateName());
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx"> 
</span><del>-    auto isLocked = globalObject()-&gt;builtinInternalFunctions().readableStreamInternals().m_isReadableStreamLockedFunction.get();
</del><ins>+    auto isLocked = globalObject-&gt;builtinInternalFunctions().readableStreamInternals().m_isReadableStreamLockedFunction.get();
</ins><span class="cx"> 
</span><span class="cx">     JSC::MarkedArgumentBuffer arguments;
</span><span class="cx">     arguments.append(readableStream);
</span><span class="cx">     auto result = callFunction(state, isLocked, JSC::jsUndefined(), arguments);
</span><del>-    ASSERT(!state.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx"> 
</span><span class="cx">     return result.isTrue();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsReadableStreamDefaultControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.h        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -74,8 +74,11 @@
</span><span class="cx"> 
</span><span class="cx"> inline bool ReadableStreamDefaultController::enqueue(RefPtr&lt;JSC::ArrayBuffer&gt;&amp;&amp; buffer)
</span><span class="cx"> {
</span><del>-    JSC::ExecState&amp; state = *globalObject()-&gt;globalExec();
-    JSC::JSLockHolder locker(&amp;state);
</del><ins>+    auto globalObject = this-&gt;globalObject();
+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder locker(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
+    JSC::ExecState&amp; state = *globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><span class="cx">     if (!buffer) {
</span><span class="cx">         error(state, createOutOfMemoryError(&amp;state));
</span><span class="lines">@@ -84,8 +87,8 @@
</span><span class="cx">     auto length = buffer-&gt;byteLength();
</span><span class="cx">     auto chunk = JSC::Uint8Array::create(WTFMove(buffer), 0, length);
</span><span class="cx">     ASSERT(chunk);
</span><del>-    enqueue(state, toJS(&amp;state, globalObject(), chunk.get()));
-    ASSERT(!state.hadException());
</del><ins>+    enqueue(state, toJS(&amp;state, globalObject, chunk.get()));
+    ASSERT_UNUSED(scope, !scope.exception());
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScheduledActioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScheduledAction.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/ScheduledAction.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -48,6 +48,9 @@
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;ScheduledAction&gt; ScheduledAction::create(ExecState* exec, DOMWrapperWorld&amp; isolatedWorld, ContentSecurityPolicy* policy)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     JSValue v = exec-&gt;argument(0);
</span><span class="cx">     CallData callData;
</span><span class="cx">     if (getCallData(v, callData) == CallType::None) {
</span><span class="lines">@@ -54,7 +57,7 @@
</span><span class="cx">         if (policy &amp;&amp; !policy-&gt;allowEval(exec))
</span><span class="cx">             return nullptr;
</span><span class="cx">         String string = v.toString(exec)-&gt;value(exec);
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(scope.exception()))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return std::unique_ptr&lt;ScheduledAction&gt;(new ScheduledAction(string, isolatedWorld));
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -43,10 +43,11 @@
</span><span class="cx"> {
</span><span class="cx">     auto&amp; vm = scriptState.vm();
</span><span class="cx">     JSLockHolder lock(vm);
</span><ins>+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     auto&amp; globalObject = *jsCast&lt;JSDOMGlobalObject*&gt;(scriptState.lexicalGlobalObject());
</span><span class="cx">     globalObject.putDirect(vm, Identifier::fromString(&amp;vm, name), toJS(&amp;scriptState, &amp;globalObject, value));
</span><del>-    if (scriptState.hadException()) {
-        reportException(&amp;scriptState, scriptState.exception());
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        reportException(&amp;scriptState, scope.exception());
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -389,7 +389,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool shouldTerminate()
</span><span class="cx">     {
</span><del>-        return m_exec-&gt;hadException();
</del><ins>+        VM&amp; vm = m_exec-&gt;vm();
+        auto scope = DECLARE_THROW_SCOPE(vm);
+        return scope.exception();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void throwStackOverflow()
</span><span class="lines">@@ -2448,6 +2450,9 @@
</span><span class="cx"> 
</span><span class="cx"> DeserializationResult CloneDeserializer::deserialize()
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = m_exec-&gt;vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     Vector&lt;uint32_t, 16&gt; indexStack;
</span><span class="cx">     Vector&lt;Identifier, 16&gt; propertyNameStack;
</span><span class="cx">     Vector&lt;JSObject*, 32&gt; outputObjectStack;
</span><span class="lines">@@ -2468,7 +2473,7 @@
</span><span class="cx">                 goto error;
</span><span class="cx">             }
</span><span class="cx">             JSArray* outArray = constructEmptyArray(m_exec, 0, m_globalObject, length);
</span><del>-            if (UNLIKELY(m_exec-&gt;hadException()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 goto error;
</span><span class="cx">             m_gcBuffer.append(outArray);
</span><span class="cx">             outputObjectStack.append(outArray);
</span><span class="lines">@@ -2546,7 +2551,7 @@
</span><span class="cx">             if (outputObjectStack.size() &gt; maximumFilterRecursion)
</span><span class="cx">                 return std::make_pair(JSValue(), StackOverflowError);
</span><span class="cx">             JSMap* map = JSMap::create(m_exec, m_exec-&gt;vm(), m_globalObject-&gt;mapStructure());
</span><del>-            if (UNLIKELY(m_exec-&gt;hadException()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 goto error;
</span><span class="cx">             m_gcBuffer.append(map);
</span><span class="cx">             outputObjectStack.append(map);
</span><span class="lines">@@ -2577,7 +2582,7 @@
</span><span class="cx">             if (outputObjectStack.size() &gt; maximumFilterRecursion)
</span><span class="cx">                 return std::make_pair(JSValue(), StackOverflowError);
</span><span class="cx">             JSSet* set = JSSet::create(m_exec, m_exec-&gt;vm(), m_globalObject-&gt;setStructure());
</span><del>-            if (UNLIKELY(m_exec-&gt;hadException()))
</del><ins>+            if (UNLIKELY(scope.exception()))
</ins><span class="cx">                 goto error;
</span><span class="cx">             m_gcBuffer.append(set);
</span><span class="cx">             outputObjectStack.append(set);
</span><span class="lines">@@ -2710,13 +2715,16 @@
</span><span class="cx"> RefPtr&lt;SerializedScriptValue&gt; SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     ExecState* exec = toJS(originContext);
</span><del>-    JSLockHolder locker(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder locker(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     JSValue value = toJS(exec, apiValue);
</span><span class="cx">     RefPtr&lt;SerializedScriptValue&gt; serializedValue = SerializedScriptValue::create(exec, value, nullptr, nullptr);
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, exec-&gt;exception()-&gt;value());
-        exec-&gt;clearException();
</del><ins>+            *exception = toRef(exec, scope.exception()-&gt;value());
+        scope.clearException();
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx">     ASSERT(serializedValue);
</span><span class="lines">@@ -2745,12 +2753,15 @@
</span><span class="cx"> JSValueRef SerializedScriptValue::deserialize(JSContextRef destinationContext, JSValueRef* exception)
</span><span class="cx"> {
</span><span class="cx">     ExecState* exec = toJS(destinationContext);
</span><del>-    JSLockHolder locker(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder locker(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     JSValue value = deserialize(exec, exec-&gt;lexicalGlobalObject(), nullptr);
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         if (exception)
</span><del>-            *exception = toRef(exec, exec-&gt;exception()-&gt;value());
-        exec-&gt;clearException();
</del><ins>+            *exception = toRef(exec, scope.exception()-&gt;value());
+        scope.clearException();
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx">     ASSERT(value);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -127,7 +127,6 @@
</span><span class="cx">     ExecState* exec = m_workerGlobalScopeWrapper-&gt;globalExec();
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     JSLockHolder lock(vm);
</span><del>-    auto scope = DECLARE_THROW_SCOPE(vm);
</del><span class="cx"> 
</span><span class="cx">     JSC::evaluate(exec, sourceCode.jsSourceCode(), m_workerGlobalScopeWrapper-&gt;globalThis(), returnedException);
</span><span class="cx"> 
</span><span class="lines">@@ -142,11 +141,8 @@
</span><span class="cx">         int columnNumber = 0;
</span><span class="cx">         String sourceURL = sourceCode.url().string();
</span><span class="cx">         Deprecated::ScriptValue error;
</span><del>-        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, error, sourceCode.cachedScript())) {
-            throwException(exec, scope, createError(exec, errorMessage.impl()));
-            returnedException = vm.exception();
-            vm.clearException();
-        }
</del><ins>+        if (m_workerGlobalScope-&gt;sanitizeScriptError(errorMessage, lineNumber, columnNumber, sourceURL, error, sourceCode.cachedScript()))
+            returnedException = Exception::create(vm, createError(exec, errorMessage.impl()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1024,7 +1024,7 @@
</span><span class="cx">         my $needExceptionCheck = 0;
</span><span class="cx">         foreach my $member (@{$dictionary-&gt;members}) {
</span><span class="cx">             if ($needExceptionCheck) {
</span><del>-                $result .= &quot;    if (UNLIKELY(state.hadException()))\n&quot;;
</del><ins>+                $result .= &quot;    if (UNLIKELY(throwScope.exception()))\n&quot;;
</ins><span class="cx">                 $result .= &quot;        return Nullopt;\n&quot;;
</span><span class="cx">             }
</span><span class="cx">             # FIXME: Eventually we will want this to share a lot more code with JSValueToNative.
</span><span class="lines">@@ -3133,7 +3133,7 @@
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    VM&amp; vm = state-&gt;vm();\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    auto throwScope = DECLARE_THROW_SCOPE(vm);\n&quot;);
</span><del>-            push(@implContent, &quot;    UNUSED_PARAM(throwScope);&quot;);
</del><ins>+            push(@implContent, &quot;    UNUSED_PARAM(throwScope);\n&quot;);
</ins><span class="cx">             push(@implContent, &quot;    JSValue value = JSValue::decode(encodedValue);\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    UNUSED_PARAM(thisValue);\n&quot;) if !$attribute-&gt;isStatic;
</span><span class="cx">             if (!$attribute-&gt;isStatic) {
</span><span class="lines">@@ -3231,7 +3231,7 @@
</span><span class="cx">                     push(@implContent, &quot;    if (!value.isUndefinedOrNull()) {\n&quot;);
</span><span class="cx">                     push(@implContent, &quot;        nativeValue = $nativeValue;\n&quot;);
</span><span class="cx">                     if ($mayThrowException) {
</span><del>-                        push(@implContent, &quot;        if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                        push(@implContent, &quot;        if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                         push(@implContent, &quot;            return false;\n&quot;);
</span><span class="cx">                     }
</span><span class="cx">                     push(@implContent, &quot;        if (UNLIKELY(!nativeValue)) {\n&quot;);
</span><span class="lines">@@ -3242,7 +3242,7 @@
</span><span class="cx">                 } else {
</span><span class="cx">                     push(@implContent, &quot;    auto nativeValue = $nativeValue;\n&quot;);
</span><span class="cx">                     if ($mayThrowException) {
</span><del>-                        push(@implContent, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                        push(@implContent, &quot;    if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                         push(@implContent, &quot;        return false;\n&quot;);
</span><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="lines">@@ -3979,7 +3979,7 @@
</span><span class="cx">             push(@$outputArray, &quot;    auto $name = toArguments&lt;VariadicHelper&lt;$wrapperType, $wrappedType&gt;&gt;(*state, $argumentIndex);\n&quot;);
</span><span class="cx"> 
</span><span class="cx">             if (IsNativeType($type)) {
</span><del>-                push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                push(@$outputArray, &quot;    if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                 push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><span class="cx">             else {
</span><span class="lines">@@ -4019,7 +4019,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             push(@$outputArray, &quot;$indent    $defineOptionalValue = parse&lt;$className&gt;(*state, ${name}Value);\n&quot;);
</span><del>-            push(@$outputArray, &quot;$indent    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+            push(@$outputArray, &quot;$indent    if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;$indent        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent    if (UNLIKELY(!$optionalValue))\n&quot;);
</span><span class="cx">             push(@$outputArray, &quot;$indent        return throwArgumentMustBeEnumError(*state, throwScope, $argumentIndex, \&quot;$name\&quot;, \&quot;$visibleInterfaceName\&quot;, $quotedFunctionName, expectedEnumerationValues&lt;$className&gt;());\n&quot;);
</span><span class="lines">@@ -4042,7 +4042,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    if (!$checkedArgument.isUndefinedOrNull()) {\n&quot;);
</span><span class="cx">                 push(@$outputArray, &quot;        $name = $nativeValue;\n&quot;);
</span><span class="cx">                 if ($mayThrowException) {
</span><del>-                    push(@$outputArray, &quot;        if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;        if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                     push(@$outputArray, &quot;            return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">                 push(@$outputArray, &quot;        if (UNLIKELY(!$name))\n&quot;);
</span><span class="lines">@@ -4085,7 +4085,7 @@
</span><span class="cx">                 push(@$outputArray, &quot;    auto $name = ${outer}${nativeValue};\n&quot;);
</span><span class="cx">                 $value = &quot;WTFMove($name)&quot;;
</span><span class="cx">                 if ($mayThrowException) {
</span><del>-                    push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                    push(@$outputArray, &quot;    if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                     push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -4466,7 +4466,7 @@
</span><span class="cx">         push(@implContent, &quot;\n&quot; . $indent . &quot;setDOMException(state, ec);\n&quot;) if $raisesException;
</span><span class="cx"> 
</span><span class="cx">         if ($codeGenerator-&gt;ExtendedAttributeContains($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;CallWith&quot;}, &quot;ScriptState&quot;)) {
</span><del>-            push(@implContent, $indent . &quot;if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+            push(@implContent, $indent . &quot;if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">             push(@implContent, $indent . &quot;    return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -5290,7 +5290,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> 
</span><span class="cx">     AtomicString eventType = state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     ${interfaceName}Init eventInit;
</span><span class="lines">@@ -5299,7 +5299,7 @@
</span><span class="cx">     if (!initializerValue.isUndefinedOrNull()) {
</span><span class="cx">         // Given the above test, this will always yield an object.
</span><span class="cx">         JSObject* initializerObject = initializerValue.toObject(state);
</span><del>-        ASSERT(!state-&gt;hadException());
</del><ins>+        ASSERT(!throwScope.exception());
</ins><span class="cx"> 
</span><span class="cx">         // Create the dictionary wrapper from the initializer object.
</span><span class="cx">         JSDictionary dictionary(state, initializerObject);
</span><span class="lines">@@ -5442,7 +5442,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             if ($codeGenerator-&gt;ExtendedAttributeContains($interface-&gt;extendedAttributes-&gt;{&quot;ConstructorCallWith&quot;}, &quot;ScriptState&quot;)) {
</span><del>-                 push(@$outputArray, &quot;    if (UNLIKELY(state-&gt;hadException()))\n&quot;);
</del><ins>+                 push(@$outputArray, &quot;    if (UNLIKELY(throwScope.exception()))\n&quot;);
</ins><span class="cx">                  push(@$outputArray, &quot;        return JSValue::encode(jsUndefined());\n&quot;);
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto message = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.postMessage(WTFMove(message));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.anotherFunction(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx"> 
</span><span class="cx">     AtomicString eventType = state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     TestEventConstructorInit eventInit;
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">     if (!initializerValue.isUndefinedOrNull()) {
</span><span class="cx">         // Given the above test, this will always yield an object.
</span><span class="cx">         JSObject* initializerObject = initializerValue.toObject(state);
</span><del>-        ASSERT(!state-&gt;hadException());
</del><ins>+        ASSERT(!throwScope.exception());
</ins><span class="cx"> 
</span><span class="cx">         // Create the dictionary wrapper from the initializer object.
</span><span class="cx">         JSDictionary dictionary(state, initializerObject);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto index = convert&lt;uint32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.item(WTFMove(index)));
</span><span class="cx">     return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -277,7 +277,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestGlobalObject* castedThis = jsDynamicCast&lt;JSTestGlobalObject*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -285,7 +286,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setRegularAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -296,7 +297,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestGlobalObject* castedThis = jsDynamicCast&lt;JSTestGlobalObject*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -304,7 +306,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setPublicAndPrivateAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -316,7 +318,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestGlobalObject* castedThis = jsDynamicCast&lt;JSTestGlobalObject*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -324,7 +327,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setPublicAndPrivateConditionalAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -337,7 +340,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestGlobalObject* castedThis = jsDynamicCast&lt;JSTestGlobalObject*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -345,7 +349,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setEnabledAtRuntimeAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -372,7 +376,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto testParam = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.regularOperation(WTFMove(testParam));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -393,7 +397,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto testParam = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -416,7 +420,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto testParam = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -231,10 +231,10 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto str1 = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
</span><span class="cx">     if (UNLIKELY(!context))
</span><span class="lines">@@ -663,9 +663,10 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     TestInterface::setImplementsStaticAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -678,7 +679,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -686,7 +688,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setImplementsStr2(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -699,7 +701,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -716,7 +719,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -739,9 +743,10 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     WebCore::TestSupplemental::setSupplementalStaticAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -754,7 +759,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -762,7 +768,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     WebCore::TestSupplemental::setSupplementalStr2(impl, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -775,7 +781,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -792,7 +799,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestInterface* castedThis = jsDynamicCast&lt;JSTestInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -852,7 +860,7 @@
</span><span class="cx">     if (!context)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -930,7 +938,7 @@
</span><span class="cx">     if (!context)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestJSBuiltinConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -190,7 +190,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestJSBuiltinConstructor* castedThis = jsDynamicCast&lt;JSTestJSBuiltinConstructor*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -91,13 +91,13 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto str1 = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto str2 = state-&gt;argument(1).isUndefined() ? ASCIILiteral(&quot;defaultString&quot;) : state-&gt;uncheckedArgument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto str3 = state-&gt;argument(2).isUndefined() ? String() : state-&gt;uncheckedArgument(2).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto object = TestNamedConstructor::createForJSConstructor(*castedThis-&gt;document(), WTFMove(str1), WTFMove(str2), WTFMove(str3), ec);
</span><span class="cx">     if (UNLIKELY(ec)) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -207,7 +207,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestNode* castedThis = jsDynamicCast&lt;JSTestNode*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -215,7 +216,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setName(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -361,7 +361,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestNondeterministic* castedThis = jsDynamicCast&lt;JSTestNondeterministic*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -369,7 +370,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicWriteableAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -380,7 +381,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestNondeterministic* castedThis = jsDynamicCast&lt;JSTestNondeterministic*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -388,7 +390,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicExceptionAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -399,7 +401,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestNondeterministic* castedThis = jsDynamicCast&lt;JSTestNondeterministic*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -407,7 +410,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicGetterExceptionAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -418,7 +421,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestNondeterministic* castedThis = jsDynamicCast&lt;JSTestNondeterministic*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -427,7 +431,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNondeterministicSetterExceptionAttr(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -525,97 +525,97 @@
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><span class="cx">     auto enumerationValueWithoutDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithoutDefault&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto enumerationValueWithDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithDefault&quot;)), TestObj::EnumType::EnumValue1);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto enumerationValueWithEmptyStringDefault = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValueWithEmptyStringDefault&quot;)), TestObj::EnumType::EmptyString);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto stringWithDefault = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithDefault&quot;)), &quot;defaultString&quot;);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto stringWithoutDefault = convertOptional&lt;String&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;stringWithoutDefault&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto booleanWithDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithDefault&quot;)), false);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto sequenceOfStrings = convertOptional&lt;Vector&lt;String&gt;&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;sequenceOfStrings&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto restrictedDouble = convertOptional&lt;double&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedDouble&quot;)), ShouldAllowNonFinite::No);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unrestrictedDouble = convertOptional&lt;double&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDouble&quot;)), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto restrictedDoubleWithDefault = convertOptional&lt;double&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedDoubleWithDefault&quot;)), ShouldAllowNonFinite::No, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unrestrictedDoubleWithDefault = convertOptional&lt;double&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedDoubleWithDefault&quot;)), ShouldAllowNonFinite::Yes, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto restrictedFloat = convertOptional&lt;float&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedFloat&quot;)), ShouldAllowNonFinite::No);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unrestrictedFloat = convertOptional&lt;float&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloat&quot;)), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto restrictedFloatWithDefault = convertOptional&lt;float&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;restrictedFloatWithDefault&quot;)), ShouldAllowNonFinite::No, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unrestrictedFloatWithDefault = convertOptional&lt;float&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unrestrictedFloatWithDefault&quot;)), ShouldAllowNonFinite::Yes, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto smallIntegerClamped = convertOptional&lt;int8_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;smallIntegerClamped&quot;)), Clamp);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto smallIntegerWithDefault = convertOptional&lt;int8_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;smallIntegerWithDefault&quot;)), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto smallUnsignedIntegerEnforcedRange = convertOptional&lt;uint8_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;smallUnsignedIntegerEnforcedRange&quot;)), EnforceRange);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto smallUnsignedIntegerWithDefault = convertOptional&lt;uint8_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;smallUnsignedIntegerWithDefault&quot;)), NormalConversion, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto integer = convertOptional&lt;int32_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integer&quot;)), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto integerWithDefault = convertOptional&lt;int32_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;integerWithDefault&quot;)), NormalConversion, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unsignedInteger = convertOptional&lt;uint32_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedInteger&quot;)), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unsignedIntegerWithDefault = convertOptional&lt;uint32_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedIntegerWithDefault&quot;)), NormalConversion, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto largeInteger = convertOptional&lt;int64_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeInteger&quot;)), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto largeIntegerWithDefault = convertOptional&lt;int64_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;largeIntegerWithDefault&quot;)), NormalConversion, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unsignedLargeInteger = convertOptional&lt;uint64_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedLargeInteger&quot;)), NormalConversion);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto unsignedLargeIntegerWithDefault = convertOptional&lt;uint64_t&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;unsignedLargeIntegerWithDefault&quot;)), NormalConversion, 0);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto* nullableNode = convertWrapperType&lt;Node, JSNode&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;nullableNode&quot;)), IsNullable::Yes);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto anyValue = convertOptional&lt;JSC::JSValue&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyValue&quot;)), jsUndefined());
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto anyTypedefValue = convertOptional&lt;JSC::JSValue&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;anyTypedefValue&quot;)), jsUndefined());
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto dictionaryMember = convertDictionary&lt;TestObj::DictionaryThatShouldTolerateNull&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;dictionaryMember&quot;)));
</span><span class="cx">     return TestObj::Dictionary { WTFMove(enumerationValueWithoutDefault), WTFMove(enumerationValueWithDefault), WTFMove(enumerationValueWithEmptyStringDefault), WTFMove(stringWithDefault), WTFMove(stringWithoutDefault), WTFMove(booleanWithDefault), WTFMove(booleanWithoutDefault), WTFMove(sequenceOfStrings), WTFMove(restrictedDouble), WTFMove(unrestrictedDouble), WTFMove(restrictedDoubleWithDefault), WTFMove(unrestrictedDoubleWithDefault), WTFMove(restrictedFloat), WTFMove(unrestrictedFloat), WTFMove(restrictedFloatWithDefault), WTFMove(unrestrictedFloatWithDefault), WTFMove(smallIntegerClamped), WTFMove(smallIntegerWithDefault), WTFMove(smallUnsignedIntegerEnforcedRange), WTFMove(smallUnsignedIntegerWithDefault), WTFMove(integer), WTFMove(integerWithDefault), WTFMove(unsignedInteger), WTFMove(unsignedIntegerWithDefault), WTFMove(largeInteger), WTFMove(largeIntegerWithDefault), WTFMove(unsignedLargeInteger), WTFMove(unsignedLargeIntegerWithDefault), WT
 FMove(nullableNode), WTFMove(anyValue), WTFMove(anyTypedefValue), dictionaryMember.value() };
</span><span class="lines">@@ -631,13 +631,13 @@
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><span class="cx">     auto requiredEnumerationValue = convert&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;requiredEnumerationValue&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto* nonNullableNode = convertWrapperType&lt;Node, JSNode&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;nonNullableNode&quot;)), IsNullable::No);
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto requiredDictionaryMember = convertDictionary&lt;TestObj::Dictionary&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;requiredDictionaryMember&quot;)));
</span><span class="cx">     return TestObj::DictionaryThatShouldNotTolerateNull { WTFMove(requiredEnumerationValue), WTFMove(booleanWithoutDefault), *nonNullableNode, requiredDictionaryMember.value() };
</span><span class="lines">@@ -655,7 +655,7 @@
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><span class="cx">     auto enumerationValue = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValue&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
</span><span class="cx">     return TestObj::DictionaryThatShouldTolerateNull { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
</span><span class="lines">@@ -673,7 +673,7 @@
</span><span class="cx">         return Nullopt;
</span><span class="cx">     }
</span><span class="cx">     auto enumerationValue = convertOptional&lt;TestObj::EnumType&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;enumerationValue&quot;)));
</span><del>-    if (UNLIKELY(state.hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return Nullopt;
</span><span class="cx">     auto booleanWithoutDefault = convertOptional&lt;bool&gt;(state, object-&gt;get(&amp;state, Identifier::fromString(&amp;state, &quot;booleanWithoutDefault&quot;)));
</span><span class="cx">     return AlternateDictionaryName { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
</span><span class="lines">@@ -3090,9 +3090,10 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     TestObj::setStaticStringAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3103,7 +3104,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3118,7 +3120,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3126,7 +3129,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = parse&lt;TestObj::EnumType&gt;(*state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (UNLIKELY(!nativeValue))
</span><span class="cx">         return false;
</span><span class="lines">@@ -3139,7 +3142,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3147,7 +3151,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int8_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setByteAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3158,7 +3162,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3166,7 +3171,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;uint8_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setOctetAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3177,7 +3182,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3185,7 +3191,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int16_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setShortAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3196,7 +3202,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3204,7 +3211,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int16_t&gt;(*state, value, Clamp);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setClampedShortAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3215,7 +3222,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3223,7 +3231,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int16_t&gt;(*state, value, EnforceRange);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setEnforceRangeShortAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3234,7 +3242,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3242,7 +3251,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;uint16_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedShortAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3253,7 +3262,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3261,7 +3271,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setLongAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3272,7 +3282,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3280,7 +3291,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int64_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setLongLongAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3291,7 +3302,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3299,7 +3311,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;uint64_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3310,7 +3322,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3318,7 +3331,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3329,7 +3342,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3337,7 +3351,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUsvstringAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3348,7 +3362,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3369,7 +3384,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3393,7 +3409,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3414,7 +3431,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3422,7 +3440,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToStringTreatingNullAsEmptyString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrTreatingNullAsEmptyString(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3433,7 +3451,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3441,7 +3460,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVStringTreatingNullAsEmptyString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUsvstringAttrTreatingNullAsEmptyString(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3452,7 +3471,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3460,7 +3480,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = parse&lt;AlternateEnumName&gt;(*state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (UNLIKELY(!nativeValue))
</span><span class="cx">         return false;
</span><span class="lines">@@ -3473,7 +3493,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3494,7 +3515,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3502,7 +3524,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setCreate(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3513,7 +3535,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3521,7 +3544,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedstringattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3532,7 +3555,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3540,7 +3564,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedusvstringattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3551,7 +3575,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3559,7 +3584,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3570,7 +3595,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3578,7 +3604,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;uint32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedIntegralAttribute(WebCore::HTMLNames::reflectedunsignedintegralattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3589,7 +3615,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3597,7 +3624,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3608,7 +3635,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3616,7 +3644,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedurlattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3627,7 +3655,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3635,7 +3664,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectedusvurlattrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3646,7 +3675,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3654,7 +3684,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentStringAttrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3665,7 +3695,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3673,7 +3704,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3684,7 +3715,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3692,7 +3724,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3703,7 +3735,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3711,7 +3744,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::customContentURLAttrAttr, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3723,7 +3756,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3731,7 +3765,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setEnabledAtRuntimeAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3743,7 +3777,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3751,7 +3786,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = toFloat32Array(value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (UNLIKELY(!nativeValue)) {
</span><span class="cx">         throwAttributeTypeError(*state, throwScope, &quot;TestObject&quot;, &quot;typedArrayAttr&quot;, &quot;Float32Array&quot;);
</span><span class="lines">@@ -3766,7 +3801,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3774,7 +3810,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterException(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3785,7 +3821,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3793,7 +3830,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterExceptionWithMessage(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3804,7 +3841,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3813,7 +3851,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span><span class="lines">@@ -3825,7 +3863,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3834,7 +3873,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCodeWithMessage ec;
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterExceptionWithMessage(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span><span class="lines">@@ -3846,7 +3885,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3854,7 +3894,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithGetterException(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3865,7 +3905,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3874,7 +3915,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span><span class="lines">@@ -3886,7 +3927,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3901,7 +3943,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3916,7 +3959,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3931,7 +3975,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3939,7 +3984,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithScriptStateAttribute(*state, WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3950,7 +3995,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3958,7 +4004,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setWithCallWithAndSetterCallWithAttribute(*state, activeDOMWindow(state), firstDOMWindow(state), WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -3969,7 +4015,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -3993,7 +4040,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4014,7 +4062,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4038,7 +4087,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4062,7 +4112,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4086,7 +4137,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4110,7 +4162,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4132,7 +4185,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4140,7 +4194,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr1(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4153,7 +4207,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4161,7 +4216,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr2(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4174,7 +4229,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4182,7 +4238,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setConditionalAttr3(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4195,7 +4251,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4212,7 +4269,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4229,7 +4287,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4245,7 +4304,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4262,7 +4322,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4286,7 +4347,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4310,7 +4372,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4318,7 +4381,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setBlueberry(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4329,7 +4392,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4337,7 +4401,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setId(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4348,7 +4412,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4363,7 +4428,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4371,7 +4437,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNullableLongSettableAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4382,7 +4448,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4390,7 +4457,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToStringWithUndefinedOrNullCheck(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNullableStringSettableAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4401,7 +4468,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4409,7 +4477,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVStringWithUndefinedOrNullCheck(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNullableUSVStringSettableAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4420,7 +4488,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4428,7 +4497,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setNullableStringValue(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4439,7 +4508,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4447,7 +4517,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = parse&lt;TestObj::Optional&gt;(*state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     if (UNLIKELY(!nativeValue))
</span><span class="cx">         return false;
</span><span class="lines">@@ -4460,7 +4530,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4469,7 +4540,7 @@
</span><span class="cx">     Ref&lt;TestNode&gt; forwardedImpl = castedThis-&gt;wrapped().putForwardsAttribute();
</span><span class="cx">     auto&amp; impl = forwardedImpl.get();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setName(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4480,7 +4551,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4491,7 +4563,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     auto&amp; impl = *forwardedImpl;
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setName(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4502,7 +4574,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestObj* castedThis = jsDynamicCast&lt;JSTestObj*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -4510,7 +4583,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = valueToUSVString(state, value);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringifierAttribute(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -4546,7 +4619,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto testParam = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -4569,7 +4642,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto testParam = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.enabledAtRuntimeOperation(WTFMove(testParam));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -4627,10 +4700,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -4668,10 +4741,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto byteArg = convert&lt;int8_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -4709,10 +4782,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto octetArg = convert&lt;uint8_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -4750,10 +4823,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -4791,10 +4864,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(2));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -4832,7 +4905,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arg = valueToStringTreatingNullAsEmptyString(state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithArgTreatingNullAsEmptyString(WTFMove(arg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -4852,7 +4925,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto resolver = JSXPathNSResolver::toWrapped(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!resolver))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 0, &quot;resolver&quot;, &quot;TestObject&quot;, &quot;methodWithXPathNSResolverParameter&quot;, &quot;XPathNSResolver&quot;);
</span><span class="lines">@@ -4898,7 +4971,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto index = convert&lt;uint32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsStringOrNull(state, impl.nullableStringSpecialMethod(WTFMove(index)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -4920,7 +4993,7 @@
</span><span class="cx">     auto enumArgValue = state-&gt;argument(0);
</span><span class="cx">     TestObj::EnumType enumArg;
</span><span class="cx">     auto optionalValue = parse&lt;TestObj::EnumType&gt;(*state, enumArgValue);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!optionalValue))
</span><span class="cx">         return throwArgumentMustBeEnumError(*state, throwScope, 0, &quot;enumArg&quot;, &quot;TestObject&quot;, &quot;methodWithEnumArg&quot;, expectedEnumerationValues&lt;TestObj::EnumType&gt;());
</span><span class="lines">@@ -4944,7 +5017,7 @@
</span><span class="cx">     Optional&lt;TestObj::EnumType&gt; enumArg;
</span><span class="cx">     if (!enumArgValue.isUndefined()) {
</span><span class="cx">         enumArg = parse&lt;TestObj::EnumType&gt;(*state, enumArgValue);
</span><del>-        if (UNLIKELY(state-&gt;hadException()))
</del><ins>+        if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (UNLIKELY(!enumArg))
</span><span class="cx">             return throwArgumentMustBeEnumError(*state, throwScope, 0, &quot;enumArg&quot;, &quot;TestObject&quot;, &quot;methodWithOptionalEnumArg&quot;, expectedEnumerationValues&lt;TestObj::EnumType&gt;());
</span><span class="lines">@@ -4970,7 +5043,7 @@
</span><span class="cx">         enumArg = TestObj::EnumType::EnumValue1;
</span><span class="cx">     } else {
</span><span class="cx">         auto optionalValue = parse&lt;TestObj::EnumType&gt;(*state, enumArgValue);
</span><del>-        if (UNLIKELY(state-&gt;hadException()))
</del><ins>+        if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (UNLIKELY(!optionalValue))
</span><span class="cx">             return throwArgumentMustBeEnumError(*state, throwScope, 0, &quot;enumArg&quot;, &quot;TestObject&quot;, &quot;methodWithOptionalEnumArgAndDefaultValue&quot;, expectedEnumerationValues&lt;TestObj::EnumType&gt;());
</span><span class="lines">@@ -4995,7 +5068,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArg = JSTestObj::toWrapped(state-&gt;argument(1));
</span><span class="cx">     if (UNLIKELY(!objArg))
</span><span class="lines">@@ -5020,7 +5093,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = valueToUSVString(state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithUSVStringArg(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5040,7 +5113,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = valueToUSVStringWithUndefinedOrNullCheck(state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithNullableUSVStringArg(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5060,7 +5133,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = valueToUSVStringTreatingNullAsEmptyString(state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithUSVStringArgTreatingNullAsEmptyString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5080,7 +5153,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto serializedArg = SerializedScriptValue::create(state, state-&gt;argument(0), 0, 0);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.serializedValue(WTFMove(serializedArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5179,7 +5252,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto argument = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsStringWithCache(state, impl.privateMethod(WTFMove(argument)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -5199,7 +5272,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto argument = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsStringWithCache(state, impl.publicAndPrivateMethod(WTFMove(argument)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -5219,13 +5292,13 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto type = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto listener = JSEventListener::create(state-&gt;argument(1), *castedThis, false, currentWorld(state));
</span><span class="cx">     if (UNLIKELY(!listener))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 1, &quot;listener&quot;, &quot;TestObject&quot;, &quot;addEventListener&quot;, &quot;EventListener&quot;);
</span><span class="cx">     auto useCapture = state-&gt;argument(2).toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.addEventListener(WTFMove(type), *listener, WTFMove(useCapture));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5245,13 +5318,13 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto type = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto listener = JSEventListener::create(state-&gt;argument(1), *castedThis, false, currentWorld(state));
</span><span class="cx">     if (UNLIKELY(!listener))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 1, &quot;listener&quot;, &quot;TestObject&quot;, &quot;removeEventListener&quot;, &quot;EventListener&quot;);
</span><span class="cx">     auto useCapture = state-&gt;argument(2).toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.removeEventListener(WTFMove(type), *listener, WTFMove(useCapture));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5284,7 +5357,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.withScriptStateObj(*state));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5321,7 +5394,7 @@
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.withScriptStateObjException(*state, ec));
</span><span class="cx"> 
</span><span class="cx">     setDOMException(state, ec);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5380,7 +5453,7 @@
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.withScriptExecutionContextAndScriptStateObjException(*state, *context, ec));
</span><span class="cx"> 
</span><span class="cx">     setDOMException(state, ec);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5400,7 +5473,7 @@
</span><span class="cx">     if (!context)
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.withScriptExecutionContextAndScriptStateWithSpaces(*state, *context));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="lines">@@ -5486,7 +5559,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto opt = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalArg(WTFMove(opt));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5504,7 +5577,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto opt = state-&gt;argument(0).isUndefined() ? 666 : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalArgAndDefaultValue(WTFMove(opt));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5524,10 +5597,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto nonOpt = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto opt = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithNonOptionalArgAndOptionalArg(WTFMove(nonOpt), WTFMove(opt));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5547,13 +5620,13 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto nonOpt = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto opt1 = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto opt2 = state-&gt;argument(2).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(2), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithNonOptionalArgAndTwoOptionalArgs(WTFMove(nonOpt), WTFMove(opt1), WTFMove(opt2));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5571,7 +5644,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5589,7 +5662,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? String() : valueToUSVString(state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUSVString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5607,7 +5680,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? nullAtom : state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalAtomicString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5625,7 +5698,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? ASCIILiteral(&quot;foo&quot;) : state-&gt;uncheckedArgument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringAndDefaultValue(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5643,7 +5716,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? AtomicString(&quot;foo&quot;, AtomicString::ConstructFromLiteral) : state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalAtomicStringAndDefaultValue(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5661,7 +5734,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? String() : state-&gt;uncheckedArgument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsNull(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5679,7 +5752,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsUndefined(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5697,7 +5770,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? nullAtom : state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalAtomicStringIsNull(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5715,7 +5788,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? emptyString() : state-&gt;uncheckedArgument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalStringIsEmptyString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5733,7 +5806,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? emptyString() : valueToUSVString(state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUSVStringIsEmptyString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5751,7 +5824,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto str = state-&gt;argument(0).isUndefined() ? emptyAtom : state-&gt;uncheckedArgument(0).toString(state)-&gt;toAtomicString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalAtomicStringIsEmptyString(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5769,7 +5842,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = convert&lt;double&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalDoubleIsNaN(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5787,7 +5860,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalFloatIsNaN(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5805,7 +5878,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;int64_t&gt;() : convert&lt;int64_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalLongLong(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5823,7 +5896,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = convert&lt;int64_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalLongLongIsZero(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5841,7 +5914,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = state-&gt;argument(0).isUndefined() ? Optional&lt;uint64_t&gt;() : convert&lt;uint64_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUnsignedLongLong(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5859,7 +5932,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto number = convert&lt;uint64_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalUnsignedLongLongIsZero(WTFMove(number));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5877,7 +5950,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto array = state-&gt;argument(0).isUndefined() ? Optional&lt;Vector&lt;String&gt;&gt;() : toNativeArray&lt;String&gt;(*state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalSequence(WTFMove(array));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5895,7 +5968,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto array = state-&gt;argument(0).isUndefined() ? Vector&lt;String&gt;() : toNativeArray&lt;String&gt;(*state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalSequenceIsEmpty(WTFMove(array));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5913,7 +5986,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto b = state-&gt;argument(0).isUndefined() ? Optional&lt;bool&gt;() : state-&gt;uncheckedArgument(0).toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalBoolean(WTFMove(b));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -5931,7 +6004,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto b = state-&gt;argument(0).toBoolean(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithOptionalBooleanIsFalse(WTFMove(b));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6009,7 +6082,7 @@
</span><span class="cx">     RefPtr&lt;XPathNSResolver&gt; resolver = nullptr;
</span><span class="cx">     if (!state-&gt;argument(0).isUndefinedOrNull()) {
</span><span class="cx">         resolver = JSXPathNSResolver::toWrapped(*state, state-&gt;uncheckedArgument(0));
</span><del>-        if (UNLIKELY(state-&gt;hadException()))
</del><ins>+        if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         if (UNLIKELY(!resolver))
</span><span class="cx">             return throwArgumentTypeError(*state, throwScope, 0, &quot;resolver&quot;, &quot;TestObject&quot;, &quot;methodWithOptionalXPathNSResolver&quot;, &quot;XPathNSResolver&quot;);
</span><span class="lines">@@ -6052,7 +6125,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto nonCallback = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;callback&quot;, &quot;TestObject&quot;, &quot;methodWithNonCallbackArgAndCallbackArg&quot;);
</span><span class="lines">@@ -6116,7 +6189,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto nonCallback = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isFunction()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;callback&quot;, &quot;TestObject&quot;, &quot;methodWithNonCallbackArgAndCallbackFunctionArg&quot;);
</span><span class="lines">@@ -6249,7 +6322,7 @@
</span><span class="cx">             return throwArgumentTypeError(*state, throwScope, 0, &quot;objArg&quot;, &quot;TestObject&quot;, &quot;overloadedMethod&quot;, &quot;TestObj&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto strArg = state-&gt;argument(1).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(objArg), WTFMove(strArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6275,7 +6348,7 @@
</span><span class="cx">             return throwArgumentTypeError(*state, throwScope, 0, &quot;objArg&quot;, &quot;TestObject&quot;, &quot;overloadedMethod&quot;, &quot;TestObj&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6295,7 +6368,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(strArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6315,7 +6388,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(longArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6378,7 +6451,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayArg = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6418,7 +6491,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayArg = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6438,7 +6511,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayArg = toNativeArray&lt;uint32_t&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(arrayArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6458,7 +6531,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethod(WTFMove(strArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6540,7 +6613,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto strArg = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj* objArg = nullptr;
</span><span class="cx">     if (!state-&gt;argument(1).isUndefinedOrNull()) {
</span><span class="lines">@@ -6572,7 +6645,7 @@
</span><span class="cx">             return throwArgumentTypeError(*state, throwScope, 0, &quot;objArg&quot;, &quot;TestObject&quot;, &quot;overloadedMethodWithOptionalParameter&quot;, &quot;TestObj&quot;);
</span><span class="cx">     }
</span><span class="cx">     auto longArg = state-&gt;argument(1).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(1), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6618,7 +6691,7 @@
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">     UNUSED_PARAM(throwScope);
</span><span class="cx">     auto arg = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsNumber(TestObj::classMethodWithOptional(WTFMove(arg)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -6643,7 +6716,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj::overloadedMethod1(WTFMove(arg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6660,7 +6733,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto type = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     TestObj::overloadedMethod1(WTFMove(type));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6703,10 +6776,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto objArgsShort = convert&lt;uint16_t&gt;(*state, state-&gt;argument(0), Clamp);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArgsLong = convert&lt;uint32_t&gt;(*state, state-&gt;argument(1), Clamp);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.classMethodWithClamp(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6726,10 +6799,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto objArgsShort = convert&lt;uint16_t&gt;(*state, state-&gt;argument(0), EnforceRange);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto objArgsLong = convert&lt;uint32_t&gt;(*state, state-&gt;argument(1), EnforceRange);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.classMethodWithEnforceRange(WTFMove(objArgsShort), WTFMove(objArgsLong));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6749,7 +6822,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto unsignedLongSequence = toNativeArray&lt;uint32_t&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithUnsignedLongSequence(WTFMove(unsignedLongSequence));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6770,7 +6843,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto values = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsArray(state, castedThis-&gt;globalObject(), impl.stringArrayFunction(WTFMove(values), ec));
</span><span class="cx"> 
</span><span class="lines">@@ -6815,10 +6888,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayArg = toNativeArray&lt;uint32_t&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto nullableArrayArg = toNativeArray&lt;uint32_t&gt;(*state, state-&gt;argument(1));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.methodWithAndWithoutNullableSequence(WTFMove(arrayArg), WTFMove(nullableArrayArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6838,7 +6911,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto elementId = AtomicString(state-&gt;argument(0).toString(state)-&gt;toExistingAtomicString(state));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.getElementById(WTFMove(elementId)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -6921,7 +6994,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto value = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.convert3(WTFMove(value));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -6941,7 +7014,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto value = valueToStringWithUndefinedOrNullCheck(state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.convert4(WTFMove(value));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7006,10 +7079,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto head = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto tail = toArguments&lt;VariadicHelper&lt;JSC::JSValue, String&gt;&gt;(*state, 1);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.variadicStringMethod(WTFMove(head), WTFMove(*tail.second));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7029,10 +7102,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto head = convert&lt;double&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto tail = toArguments&lt;VariadicHelper&lt;JSC::JSValue, double&gt;&gt;(*state, 1);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.variadicDoubleMethod(WTFMove(head), WTFMove(*tail.second));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7075,10 +7148,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto a = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto b = convert&lt;int32_t&gt;(*state, state-&gt;argument(1), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.any(WTFMove(a), WTFMove(b));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7125,7 +7198,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto a = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::No);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.testPromiseFunctionWithFloatArgument(WTFMove(a), DeferredWrapper::create(state, castedThis-&gt;globalObject(), promiseDeferred));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7172,7 +7245,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto a = state-&gt;argument(0).isUndefined() ? Optional&lt;int32_t&gt;() : convert&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.testPromiseFunctionWithOptionalIntArgument(WTFMove(a), DeferredWrapper::create(state, castedThis-&gt;globalObject(), promiseDeferred));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7198,7 +7271,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto a = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::No);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.testPromiseOverloadedFunction(WTFMove(a), DeferredWrapper::create(state, castedThis-&gt;globalObject(), promiseDeferred));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7312,7 +7385,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.conditionalOverload(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7335,7 +7408,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto a = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.conditionalOverload(WTFMove(a));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7378,7 +7451,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto str = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.singleConditionalOverload(WTFMove(str));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7399,7 +7472,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto a = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.singleConditionalOverload(WTFMove(a));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -7438,7 +7511,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto init = convertDictionary&lt;TestObj::Dictionary&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.attachShadowRoot(init.value());
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayBuffer = toArrayBuffer(state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!arrayBuffer))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 0, &quot;arrayBuffer&quot;, &quot;TestOverloadedConstructors&quot;, nullptr, &quot;ArrayBuffer&quot;);
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arrayBufferView = toArrayBufferView(state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!arrayBufferView))
</span><span class="cx">         return throwArgumentTypeError(*state, throwScope, 0, &quot;arrayBufferView&quot;, &quot;TestOverloadedConstructors&quot;, nullptr, &quot;ArrayBufferView&quot;);
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto string = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto object = TestOverloadedConstructors::create(WTFMove(string));
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object)));
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     ASSERT(castedThis);
</span><span class="cx">     auto longArgs = toArguments&lt;VariadicHelper&lt;JSC::JSValue, int32_t&gt;&gt;(*state, 0);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsWithSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     auto* castedThis = jsCast&lt;JSTestOverloadedConstructorsWithSequenceConstructor*&gt;(state-&gt;callee());
</span><span class="cx">     ASSERT(castedThis);
</span><span class="cx">     auto sequenceOfStrings = state-&gt;argument(0).isUndefined() ? Vector&lt;String&gt;() : toNativeArray&lt;String&gt;(*state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object)));
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto string = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string));
</span><span class="cx">     return JSValue::encode(toJSNewlyCreated(state, castedThis-&gt;globalObject(), WTFMove(object)));
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverrideBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto name = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = toJS(state, castedThis-&gt;globalObject(), impl.namedItem(WTFMove(name)));
</span><span class="cx">     return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -251,7 +251,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast&lt;JSTestSerializedScriptValueInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -259,7 +260,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setValue(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -270,7 +271,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestSerializedScriptValueInterface* castedThis = jsDynamicCast&lt;JSTestSerializedScriptValueInterface*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -278,7 +280,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setCachedValue(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 2))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto hello = state-&gt;argument(0).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     if (UNLIKELY(!state-&gt;argument(1).isObject()))
</span><span class="cx">         return throwArgumentMustBeFunctionError(*state, throwScope, 1, &quot;testCallback&quot;, &quot;TestTypedefs&quot;, nullptr);
</span><span class="lines">@@ -360,7 +360,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -368,7 +369,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;uint64_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setUnsignedLongLongAttr(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -379,7 +380,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -387,7 +389,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = SerializedScriptValue::create(state, value, 0, 0);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setImmutableSerializedScriptValue(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -398,7 +400,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -406,7 +409,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithGetterException(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -417,7 +420,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -426,7 +430,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto nativeValue = convert&lt;int32_t&gt;(*state, value, NormalConversion);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span><span class="lines">@@ -438,7 +442,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -446,7 +451,7 @@
</span><span class="cx">     }
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithGetterException(WTFMove(nativeValue));
</span><span class="cx">     return true;
</span><span class="lines">@@ -457,7 +462,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = state-&gt;vm();
</span><span class="cx">     auto throwScope = DECLARE_THROW_SCOPE(vm);
</span><del>-    UNUSED_PARAM(throwScope);    JSValue value = JSValue::decode(encodedValue);
</del><ins>+    UNUSED_PARAM(throwScope);
+    JSValue value = JSValue::decode(encodedValue);
</ins><span class="cx">     UNUSED_PARAM(thisValue);
</span><span class="cx">     JSTestTypedefs* castedThis = jsDynamicCast&lt;JSTestTypedefs*&gt;(JSValue::decode(thisValue));
</span><span class="cx">     if (UNLIKELY(!castedThis)) {
</span><span class="lines">@@ -466,7 +472,7 @@
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto nativeValue = value.toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return false;
</span><span class="cx">     impl.setStringAttrWithSetterException(WTFMove(nativeValue), ec);
</span><span class="cx">     setDOMException(state, ec);
</span><span class="lines">@@ -491,7 +497,7 @@
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestTypedefs::info());
</span><span class="cx">     auto&amp; impl = castedThis-&gt;wrapped();
</span><span class="cx">     auto x = state-&gt;argument(0).isUndefined() ? Vector&lt;int32_t&gt;() : toNativeArray&lt;int32_t&gt;(*state, state-&gt;uncheckedArgument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.func(WTFMove(x));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -511,19 +517,19 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 3))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto width = convert&lt;float&gt;(*state, state-&gt;argument(0), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto height = convert&lt;float&gt;(*state, state-&gt;argument(1), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto blur = convert&lt;float&gt;(*state, state-&gt;argument(2), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto color = state-&gt;argument(3).isUndefined() ? String() : state-&gt;uncheckedArgument(3).toWTFString(state);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto alpha = state-&gt;argument(4).isUndefined() ? Optional&lt;float&gt;() : convert&lt;float&gt;(*state, state-&gt;uncheckedArgument(4), ShouldAllowNonFinite::Yes);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -543,7 +549,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto sequenceArg = toRefPtrNativeArray&lt;SerializedScriptValue, JSSerializedScriptValue&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsNumber(impl.methodWithSequenceArg(WTFMove(sequenceArg)));
</span><span class="cx">     return JSValue::encode(result);
</span><span class="lines">@@ -563,7 +569,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto sequenceArg = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.nullableSequenceArg(WTFMove(sequenceArg));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -583,10 +589,10 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto arg1 = convert&lt;uint64_t&gt;(*state, state-&gt;argument(0), Clamp);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     auto arg2 = state-&gt;argument(1).isUndefined() ? Optional&lt;uint64_t&gt;() : convert&lt;uint64_t&gt;(*state, state-&gt;uncheckedArgument(1), Clamp);
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2));
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="lines">@@ -622,7 +628,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto values = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsArray(state, castedThis-&gt;globalObject(), impl.stringSequenceFunction(WTFMove(values), ec));
</span><span class="cx"> 
</span><span class="lines">@@ -645,7 +651,7 @@
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     auto values = toNativeArray&lt;String&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsArray(state, castedThis-&gt;globalObject(), impl.stringSequenceFunction2(WTFMove(values), ec));
</span><span class="cx"> 
</span><span class="lines">@@ -667,7 +673,7 @@
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
</span><span class="cx">     auto sequenceArg = toRefPtrNativeArray&lt;TestEventTarget, JSTestEventTarget&gt;(*state, state-&gt;argument(0));
</span><del>-    if (UNLIKELY(state-&gt;hadException()))
</del><ins>+    if (UNLIKELY(throwScope.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     JSValue result = jsBoolean(impl.callWithSequenceThatRequiresInclude(WTFMove(sequenceArg)));
</span><span class="cx">     return JSValue::encode(result);
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeNP_jsobjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/NP_jsobject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/NP_jsobject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bridge/NP_jsobject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -177,8 +177,12 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx">         
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         
</span><span class="cx">         // Call the function object.
</span><span class="cx">         JSValue function = obj-&gt;imp;
</span><span class="lines">@@ -193,7 +197,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Convert and return the result of the function call.
</span><span class="cx">         convertValueToNPVariant(exec, resultV, result);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;        
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -225,8 +229,13 @@
</span><span class="cx">         RootObject* rootObject = obj-&gt;rootObject;
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+
+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         JSValue function = obj-&gt;imp-&gt;get(exec, identifierFromNPIdentifier(exec, i-&gt;string()));
</span><span class="cx">         CallData callData;
</span><span class="cx">         CallType callType = getCallData(function, callData);
</span><span class="lines">@@ -240,7 +249,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Convert and return the result of the function call.
</span><span class="cx">         convertValueToNPVariant(exec, resultV, result);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -260,14 +269,18 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         String scriptString = convertNPStringToUTF16(s);
</span><span class="cx">         
</span><del>-        JSValue returnValue = JSC::evaluate(rootObject-&gt;globalObject()-&gt;globalExec(), makeSource(scriptString), JSC::JSValue());
</del><ins>+        JSValue returnValue = JSC::evaluate(exec, makeSource(scriptString), JSC::JSValue());
</ins><span class="cx"> 
</span><span class="cx">         convertValueToNPVariant(exec, returnValue, variant);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -284,10 +297,14 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(propertyName);
</span><span class="cx">         
</span><del>-        JSLockHolder lock(exec);
</del><span class="cx">         JSValue result;
</span><span class="cx">         if (i-&gt;isString())
</span><span class="cx">             result = obj-&gt;imp-&gt;get(exec, identifierFromNPIdentifier(exec, i-&gt;string()));
</span><span class="lines">@@ -295,7 +312,7 @@
</span><span class="cx">             result = obj-&gt;imp-&gt;get(exec, i-&gt;number());
</span><span class="cx"> 
</span><span class="cx">         convertValueToNPVariant(exec, result, variant);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -318,8 +335,12 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(propertyName);
</span><span class="cx"> 
</span><span class="cx">         if (i-&gt;isString()) {
</span><span class="lines">@@ -327,7 +348,7 @@
</span><span class="cx">             obj-&gt;imp-&gt;methodTable()-&gt;put(obj-&gt;imp, exec, identifierFromNPIdentifier(exec, i-&gt;string()), convertNPVariantToValue(exec, variant, rootObject), slot);
</span><span class="cx">         } else
</span><span class="cx">             obj-&gt;imp-&gt;methodTable()-&gt;putByIndex(obj-&gt;imp, exec, i-&gt;number(), convertNPVariantToValue(exec, variant, rootObject), false);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -346,27 +367,32 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
+
</ins><span class="cx">         IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(propertyName);
</span><span class="cx">         if (i-&gt;isString()) {
</span><span class="cx">             if (!obj-&gt;imp-&gt;hasProperty(exec, identifierFromNPIdentifier(exec, i-&gt;string()))) {
</span><del>-                exec-&gt;clearException();
</del><ins>+                scope.clearException();
</ins><span class="cx">                 return false;
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             if (!obj-&gt;imp-&gt;hasProperty(exec, i-&gt;number())) {
</span><del>-                exec-&gt;clearException();
</del><ins>+                scope.clearException();
</ins><span class="cx">                 return false;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        JSLockHolder lock(exec);
</del><span class="cx">         if (i-&gt;isString())
</span><span class="cx">             obj-&gt;imp-&gt;methodTable()-&gt;deleteProperty(obj-&gt;imp, exec, identifierFromNPIdentifier(exec, i-&gt;string()));
</span><span class="cx">         else
</span><span class="cx">             obj-&gt;imp-&gt;methodTable()-&gt;deletePropertyByIndex(obj-&gt;imp, exec, i-&gt;number());
</span><span class="cx"> 
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -381,17 +407,21 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         IdentifierRep* i = static_cast&lt;IdentifierRep*&gt;(propertyName);
</span><del>-        JSLockHolder lock(exec);
</del><span class="cx">         if (i-&gt;isString()) {
</span><span class="cx">             bool result = obj-&gt;imp-&gt;hasProperty(exec, identifierFromNPIdentifier(exec, i-&gt;string()));
</span><del>-            exec-&gt;clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx">             return result;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         bool result = obj-&gt;imp-&gt;hasProperty(exec, i-&gt;number());
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -414,10 +444,14 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         JSValue func = obj-&gt;imp-&gt;get(exec, identifierFromNPIdentifier(exec, i-&gt;string()));
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return !func.isUndefined();
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -443,8 +477,12 @@
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><span class="cx">         
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         PropertyNameArray propertyNames(exec, PropertyNameMode::Strings);
</span><span class="cx"> 
</span><span class="cx">         obj-&gt;imp-&gt;methodTable()-&gt;getPropertyNames(obj-&gt;imp, exec, propertyNames, EnumerationMode());
</span><span class="lines">@@ -458,7 +496,7 @@
</span><span class="cx">         *identifier = identifiers;
</span><span class="cx">         *count = size;
</span><span class="cx"> 
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -479,10 +517,14 @@
</span><span class="cx">         RootObject* rootObject = obj-&gt;rootObject;
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><ins>+
+        auto globalObject = rootObject-&gt;globalObject();
+        VM&amp; vm = globalObject-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         
</span><del>-        ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSLockHolder lock(exec);
-        
</del><span class="cx">         // Call the constructor object.
</span><span class="cx">         JSValue constructor = obj-&gt;imp;
</span><span class="cx">         ConstructData constructData;
</span><span class="lines">@@ -496,7 +538,7 @@
</span><span class="cx">         
</span><span class="cx">         // Convert and return the result.
</span><span class="cx">         convertValueToNPVariant(exec, resultV, result);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorebridgecc_instancecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/c/c_instance.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/c/c_instance.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bridge/c/c_instance.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -68,14 +68,13 @@
</span><span class="cx"> 
</span><span class="cx"> void CInstance::moveGlobalExceptionToExecState(ExecState* exec)
</span><span class="cx"> {
</span><del>-    VM&amp; vm = exec-&gt;vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
</del><span class="cx">     if (globalExceptionString().isNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     {
</span><del>-        JSLockHolder lock(exec);
</del><ins>+        VM&amp; vm = exec-&gt;vm();
+        JSLockHolder lock(vm);
+        auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">         throwException(exec, scope, createError(exec, globalExceptionString()));
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeobjcWebScriptObjectmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/objc/WebScriptObject.mm (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/objc/WebScriptObject.mm        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/bridge/objc/WebScriptObject.mm        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #import &lt;JavaScriptCore/JSContextInternal.h&gt;
</span><span class="cx"> #import &lt;JavaScriptCore/JSValueInternal.h&gt;
</span><span class="cx"> #import &lt;interpreter/CallFrame.h&gt;
</span><ins>+#import &lt;runtime/CatchScope.h&gt;
</ins><span class="cx"> #import &lt;runtime/Completion.h&gt;
</span><span class="cx"> #import &lt;runtime/InitializeThreading.h&gt;
</span><span class="cx"> #import &lt;runtime/JSGlobalObject.h&gt;
</span><span class="lines">@@ -129,8 +130,10 @@
</span><span class="cx"> 
</span><span class="cx"> static void addExceptionToConsole(ExecState* exec)
</span><span class="cx"> {
</span><del>-    JSC::Exception* exception = exec-&gt;exception();
-    exec-&gt;clearException();
</del><ins>+    JSC::VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    JSC::Exception* exception = scope.exception();
+    scope.clearException();
</ins><span class="cx">     addExceptionToConsole(exec, exception);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -334,9 +337,12 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     // Look up the function object.
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    JSLockHolder lock(exec);
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
+    UNUSED_PARAM(scope);
</ins><span class="cx"> 
</span><span class="cx">     JSC::JSValue function = [self _imp]-&gt;get(exec, Identifier::fromString(exec, String(name)));
</span><span class="cx">     CallData callData;
</span><span class="lines">@@ -369,10 +375,12 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
-
-    JSLockHolder lock(exec);
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
+    UNUSED_PARAM(scope);
</ins><span class="cx">     
</span><span class="cx">     JSC::JSValue returnValue = JSMainThreadExecState::profiledEvaluate(exec, JSC::ProfilingReason::Other, makeSource(String(script)), JSC::JSValue());
</span><span class="cx"> 
</span><span class="lines">@@ -386,17 +394,19 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     JSObject* object = JSC::jsDynamicCast&lt;JSObject*&gt;([self _imp]);
</span><span class="cx">     PutPropertySlot slot(object);
</span><span class="cx">     object-&gt;methodTable()-&gt;put(object, exec, Identifier::fromString(exec, String(key)), convertObjcValueToValue(exec, &amp;value, ObjcObjectType, [self _rootObject]), slot);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         addExceptionToConsole(exec);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -405,22 +415,25 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
-
</del><span class="cx">     id resultObj;
</span><span class="cx">     {
</span><ins>+        auto globalObject = [self _rootObject]-&gt;globalObject();
+        auto&amp; vm = globalObject-&gt;vm();
+
</ins><span class="cx">         // Need to scope this lock to ensure that we release the lock before calling
</span><span class="cx">         // [super valueForKey:key] which might throw an exception and bypass the JSLock destructor,
</span><span class="cx">         // leaving the lock permanently held
</span><del>-        JSLockHolder lock(exec);
-        
</del><ins>+        JSLockHolder lock(vm);
+
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+        ExecState* exec = globalObject-&gt;globalExec();
+
</ins><span class="cx">         JSC::JSValue result = [self _imp]-&gt;get(exec, Identifier::fromString(exec, String(key)));
</span><span class="cx">         
</span><del>-        if (exec-&gt;hadException()) {
</del><ins>+        if (UNLIKELY(scope.exception())) {
</ins><span class="cx">             addExceptionToConsole(exec);
</span><span class="cx">             result = jsUndefined();
</span><del>-            exec-&gt;clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         resultObj = [WebScriptObject _convertValueToObjcValue:result originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
</span><span class="lines">@@ -437,15 +450,17 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     [self _imp]-&gt;methodTable()-&gt;deleteProperty([self _imp], exec, Identifier::fromString(exec, String(key)));
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         addExceptionToConsole(exec);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -454,15 +469,17 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     BOOL result = [self _imp]-&gt;hasProperty(exec, Identifier::fromString(exec, String(key)));
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         addExceptionToConsole(exec);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="lines">@@ -490,16 +507,18 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     JSC::JSValue result = [self _imp]-&gt;get(exec, index);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         addExceptionToConsole(exec);
</span><span class="cx">         result = jsUndefined();
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     id resultObj = [WebScriptObject _convertValueToObjcValue:result originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
</span><span class="lines">@@ -512,15 +531,17 @@
</span><span class="cx">     if (![self _isSafeScript])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ExecState* exec = [self _rootObject]-&gt;globalObject()-&gt;globalExec();
-    ASSERT(!exec-&gt;hadException());
</del><ins>+    auto globalObject = [self _rootObject]-&gt;globalObject();
+    auto&amp; vm = globalObject-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+    ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     [self _imp]-&gt;methodTable()-&gt;putByIndex([self _imp], exec, index, convertObjcValueToValue(exec, &amp;value, ObjcObjectType, [self _rootObject]), false);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException()) {
</del><ins>+    if (UNLIKELY(scope.exception())) {
</ins><span class="cx">         addExceptionToConsole(exec);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionParser.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -60,6 +60,9 @@
</span><span class="cx">     
</span><span class="cx"> static std::error_code getDomainList(ExecState&amp; exec, const JSObject* arrayObject, Vector&lt;String&gt;&amp; vector)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     ASSERT(vector.isEmpty());
</span><span class="cx">     if (!arrayObject || !isJSArray(arrayObject))
</span><span class="cx">         return ContentExtensionError::JSONInvalidDomainList;
</span><span class="lines">@@ -68,7 +71,7 @@
</span><span class="cx">     unsigned length = array-&gt;length();
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         const JSValue value = array-&gt;getIndex(&amp;exec, i);
</span><del>-        if (exec.hadException() || !value.isString())
</del><ins>+        if (scope.exception() || !value.isString())
</ins><span class="cx">             return ContentExtensionError::JSONInvalidDomainList;
</span><span class="cx">         
</span><span class="cx">         // Domains should be punycode encoded lower case.
</span><span class="lines">@@ -84,11 +87,14 @@
</span><span class="cx"> 
</span><span class="cx"> static std::error_code getTypeFlags(ExecState&amp; exec, const JSValue&amp; typeValue, ResourceFlags&amp; flags, uint16_t (*stringToType)(const String&amp;))
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     if (!typeValue.isObject())
</span><span class="cx">         return { };
</span><span class="cx"> 
</span><span class="cx">     const JSObject* object = typeValue.toObject(&amp;exec);
</span><del>-    ASSERT(!exec.hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     if (!isJSArray(object))
</span><span class="cx">         return ContentExtensionError::JSONInvalidTriggerFlagsArray;
</span><span class="cx"> 
</span><span class="lines">@@ -97,7 +103,7 @@
</span><span class="cx">     unsigned length = array-&gt;length();
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         const JSValue value = array-&gt;getIndex(&amp;exec, i);
</span><del>-        if (exec.hadException() || !value)
</del><ins>+        if (scope.exception() || !value)
</ins><span class="cx">             return ContentExtensionError::JSONInvalidObjectInTriggerFlagsArray;
</span><span class="cx">         
</span><span class="cx">         String name = value.toWTFString(&amp;exec);
</span><span class="lines">@@ -113,12 +119,15 @@
</span><span class="cx">     
</span><span class="cx"> static std::error_code loadTrigger(ExecState&amp; exec, const JSObject&amp; ruleObject, Trigger&amp; trigger)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     const JSValue triggerObject = ruleObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;trigger&quot;));
</span><del>-    if (!triggerObject || exec.hadException() || !triggerObject.isObject())
</del><ins>+    if (!triggerObject || scope.exception() || !triggerObject.isObject())
</ins><span class="cx">         return ContentExtensionError::JSONInvalidTrigger;
</span><span class="cx">     
</span><span class="cx">     const JSValue urlFilterObject = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;url-filter&quot;));
</span><del>-    if (!urlFilterObject || exec.hadException() || !urlFilterObject.isString())
</del><ins>+    if (!urlFilterObject || scope.exception() || !urlFilterObject.isString())
</ins><span class="cx">         return ContentExtensionError::JSONInvalidURLFilterInTrigger;
</span><span class="cx"> 
</span><span class="cx">     String urlFilter = urlFilterObject.toWTFString(&amp;exec);
</span><span class="lines">@@ -128,11 +137,11 @@
</span><span class="cx">     trigger.urlFilter = urlFilter;
</span><span class="cx"> 
</span><span class="cx">     const JSValue urlFilterCaseValue = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;url-filter-is-case-sensitive&quot;));
</span><del>-    if (urlFilterCaseValue &amp;&amp; !exec.hadException() &amp;&amp; urlFilterCaseValue.isBoolean())
</del><ins>+    if (urlFilterCaseValue &amp;&amp; !scope.exception() &amp;&amp; urlFilterCaseValue.isBoolean())
</ins><span class="cx">         trigger.urlFilterIsCaseSensitive = urlFilterCaseValue.toBoolean(&amp;exec);
</span><span class="cx"> 
</span><span class="cx">     const JSValue resourceTypeValue = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;resource-type&quot;));
</span><del>-    if (!exec.hadException() &amp;&amp; resourceTypeValue.isObject()) {
</del><ins>+    if (!scope.exception() &amp;&amp; resourceTypeValue.isObject()) {
</ins><span class="cx">         auto typeFlagsError = getTypeFlags(exec, resourceTypeValue, trigger.flags, readResourceType);
</span><span class="cx">         if (typeFlagsError)
</span><span class="cx">             return typeFlagsError;
</span><span class="lines">@@ -140,7 +149,7 @@
</span><span class="cx">         return ContentExtensionError::JSONInvalidTriggerFlagsArray;
</span><span class="cx"> 
</span><span class="cx">     const JSValue loadTypeValue = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;load-type&quot;));
</span><del>-    if (!exec.hadException() &amp;&amp; loadTypeValue.isObject()) {
</del><ins>+    if (!scope.exception() &amp;&amp; loadTypeValue.isObject()) {
</ins><span class="cx">         auto typeFlagsError = getTypeFlags(exec, loadTypeValue, trigger.flags, readLoadType);
</span><span class="cx">         if (typeFlagsError)
</span><span class="cx">             return typeFlagsError;
</span><span class="lines">@@ -148,7 +157,7 @@
</span><span class="cx">         return ContentExtensionError::JSONInvalidTriggerFlagsArray;
</span><span class="cx"> 
</span><span class="cx">     const JSValue ifDomain = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;if-domain&quot;));
</span><del>-    if (!exec.hadException() &amp;&amp; ifDomain.isObject()) {
</del><ins>+    if (!scope.exception() &amp;&amp; ifDomain.isObject()) {
</ins><span class="cx">         auto ifDomainError = getDomainList(exec, asObject(ifDomain), trigger.domains);
</span><span class="cx">         if (ifDomainError)
</span><span class="cx">             return ifDomainError;
</span><span class="lines">@@ -160,7 +169,7 @@
</span><span class="cx">         return ContentExtensionError::JSONInvalidDomainList;
</span><span class="cx">     
</span><span class="cx">     const JSValue unlessDomain = triggerObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;unless-domain&quot;));
</span><del>-    if (!exec.hadException() &amp;&amp; unlessDomain.isObject()) {
</del><ins>+    if (!scope.exception() &amp;&amp; unlessDomain.isObject()) {
</ins><span class="cx">         if (trigger.domainCondition != Trigger::DomainCondition::None)
</span><span class="cx">             return ContentExtensionError::JSONUnlessAndIfDomain;
</span><span class="cx">         auto unlessDomainError = getDomainList(exec, asObject(unlessDomain), trigger.domains);
</span><span class="lines">@@ -186,13 +195,16 @@
</span><span class="cx"> 
</span><span class="cx"> static std::error_code loadAction(ExecState&amp; exec, const JSObject&amp; ruleObject, Action&amp; action, bool&amp; validSelector)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     validSelector = true;
</span><span class="cx">     const JSValue actionObject = ruleObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;action&quot;));
</span><del>-    if (!actionObject || exec.hadException() || !actionObject.isObject())
</del><ins>+    if (!actionObject || scope.exception() || !actionObject.isObject())
</ins><span class="cx">         return ContentExtensionError::JSONInvalidAction;
</span><span class="cx"> 
</span><span class="cx">     const JSValue typeObject = actionObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;type&quot;));
</span><del>-    if (!typeObject || exec.hadException() || !typeObject.isString())
</del><ins>+    if (!typeObject || scope.exception() || !typeObject.isString())
</ins><span class="cx">         return ContentExtensionError::JSONInvalidActionType;
</span><span class="cx"> 
</span><span class="cx">     String actionType = typeObject.toWTFString(&amp;exec);
</span><span class="lines">@@ -205,7 +217,7 @@
</span><span class="cx">         action = ActionType::BlockCookies;
</span><span class="cx">     else if (actionType == &quot;css-display-none&quot;) {
</span><span class="cx">         JSValue selector = actionObject.get(&amp;exec, Identifier::fromString(&amp;exec, &quot;selector&quot;));
</span><del>-        if (!selector || exec.hadException() || !selector.isString())
</del><ins>+        if (!selector || scope.exception() || !selector.isString())
</ins><span class="cx">             return ContentExtensionError::JSONInvalidCSSDisplayNoneActionType;
</span><span class="cx"> 
</span><span class="cx">         String s = selector.toWTFString(&amp;exec);
</span><span class="lines">@@ -243,10 +255,13 @@
</span><span class="cx"> 
</span><span class="cx"> static std::error_code loadEncodedRules(ExecState&amp; exec, const String&amp; rules, Vector&lt;ContentExtensionRule&gt;&amp; ruleList)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
+
</ins><span class="cx">     // FIXME: JSONParse should require callbacks instead of an ExecState.
</span><span class="cx">     const JSValue decodedRules = JSONParse(&amp;exec, rules);
</span><span class="cx"> 
</span><del>-    if (exec.hadException() || !decodedRules)
</del><ins>+    if (scope.exception() || !decodedRules)
</ins><span class="cx">         return ContentExtensionError::JSONInvalid;
</span><span class="cx"> 
</span><span class="cx">     if (!decodedRules.isObject())
</span><span class="lines">@@ -253,7 +268,7 @@
</span><span class="cx">         return ContentExtensionError::JSONTopLevelStructureNotAnObject;
</span><span class="cx"> 
</span><span class="cx">     const JSObject* topLevelObject = decodedRules.toObject(&amp;exec);
</span><del>-    if (!topLevelObject || exec.hadException())
</del><ins>+    if (!topLevelObject || scope.exception())
</ins><span class="cx">         return ContentExtensionError::JSONTopLevelStructureNotAnObject;
</span><span class="cx">     
</span><span class="cx">     if (!isJSArray(topLevelObject))
</span><span class="lines">@@ -269,11 +284,11 @@
</span><span class="cx">         return ContentExtensionError::JSONTooManyRules;
</span><span class="cx">     for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">         const JSValue value = topLevelArray-&gt;getIndex(&amp;exec, i);
</span><del>-        if (exec.hadException() || !value)
</del><ins>+        if (scope.exception() || !value)
</ins><span class="cx">             return ContentExtensionError::JSONInvalidObjectInTopLevelArray;
</span><span class="cx"> 
</span><span class="cx">         const JSObject* ruleObject = value.toObject(&amp;exec);
</span><del>-        if (!ruleObject || exec.hadException())
</del><ins>+        if (!ruleObject || scope.exception())
</ins><span class="cx">             return ContentExtensionError::JSONInvalidRule;
</span><span class="cx"> 
</span><span class="cx">         auto error = loadRule(exec, *ruleObject, localRuleList);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -4002,6 +4002,8 @@
</span><span class="cx"> 
</span><span class="cx"> static JSC::JSValue controllerJSValue(JSC::ExecState&amp; exec, JSDOMGlobalObject&amp; globalObject, HTMLMediaElement&amp; media)
</span><span class="cx"> {
</span><ins>+    JSC::VM&amp; vm = globalObject.vm();
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     auto mediaJSWrapper = toJS(&amp;exec, &amp;globalObject, media);
</span><span class="cx">     
</span><span class="cx">     // Retrieve the controller through the JS object graph
</span><span class="lines">@@ -4009,9 +4011,9 @@
</span><span class="cx">     if (!mediaJSWrapperObject)
</span><span class="cx">         return JSC::jsNull();
</span><span class="cx">     
</span><del>-    JSC::Identifier controlsHost = JSC::Identifier::fromString(&amp;exec.vm(), &quot;controlsHost&quot;);
</del><ins>+    JSC::Identifier controlsHost = JSC::Identifier::fromString(&amp;vm, &quot;controlsHost&quot;);
</ins><span class="cx">     JSC::JSValue controlsHostJSWrapper = mediaJSWrapperObject-&gt;get(&amp;exec, controlsHost);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsNull();
</span><span class="cx"> 
</span><span class="cx">     JSC::JSObject* controlsHostJSWrapperObject = JSC::jsDynamicCast&lt;JSC::JSObject*&gt;(controlsHostJSWrapper);
</span><span class="lines">@@ -4018,9 +4020,9 @@
</span><span class="cx">     if (!controlsHostJSWrapperObject)
</span><span class="cx">         return JSC::jsNull();
</span><span class="cx"> 
</span><del>-    JSC::Identifier controllerID = JSC::Identifier::fromString(&amp;exec.vm(), &quot;controller&quot;);
</del><ins>+    JSC::Identifier controllerID = JSC::Identifier::fromString(&amp;vm, &quot;controller&quot;);
</ins><span class="cx">     JSC::JSValue controllerJSWrapper = controlsHostJSWrapperObject-&gt;get(&amp;exec, controllerID);
</span><del>-    if (exec.hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return JSC::jsNull();
</span><span class="cx"> 
</span><span class="cx">     return controllerJSWrapper;
</span><span class="lines">@@ -4057,8 +4059,10 @@
</span><span class="cx"> 
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     JSC::JSValue controllerValue = controllerJSValue(*exec, *globalObject, *this);
</span><span class="cx">     JSC::JSObject* controllerObject = JSC::jsDynamicCast&lt;JSC::JSObject*&gt;(controllerValue);
</span><span class="lines">@@ -4083,7 +4087,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSC::MarkedArgumentBuffer noArguments;
</span><span class="cx">     JSC::call(exec, methodObject, callType, callData, controllerObject, noArguments);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     m_haveSetUpCaptionContainer = true;
</span><span class="cx"> #endif
</span><span class="lines">@@ -6603,8 +6607,10 @@
</span><span class="cx">     DOMWrapperWorld&amp; world = ensureIsolatedWorld();
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     JSC::JSValue functionValue = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;createControls&quot;));
</span><span class="cx">     if (functionValue.isFunction())
</span><span class="lines">@@ -6617,8 +6623,8 @@
</span><span class="cx">     URL scriptURL;
</span><span class="cx"> #endif
</span><span class="cx">     scriptController.evaluateInWorld(ScriptSourceCode(mediaControlsScript, scriptURL), world);
</span><del>-    if (exec-&gt;hadException()) {
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception())) {
+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -6676,8 +6682,10 @@
</span><span class="cx"> 
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     // The media controls script must provide a method with the following details.
</span><span class="cx">     // Name: createControls
</span><span class="lines">@@ -6704,7 +6712,7 @@
</span><span class="cx">     argList.append(mediaControlsHostJSWrapper);
</span><span class="cx"> 
</span><span class="cx">     JSC::JSObject* function = functionValue.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSC::CallData callData;
</span><span class="cx">     JSC::CallType callType = function-&gt;methodTable()-&gt;getCallData(function, callData);
</span><span class="cx">     if (callType == JSC::CallType::None)
</span><span class="lines">@@ -6711,7 +6719,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue controllerValue = JSC::call(exec, function, callType, callData, globalObject, argList);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     JSC::JSObject* controllerObject = JSC::jsDynamicCast&lt;JSC::JSObject*&gt;(controllerValue);
</span><span class="cx">     if (!controllerObject)
</span><span class="cx">         return;
</span><span class="lines">@@ -6718,7 +6726,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Connect the Media, MediaControllerHost, and Controller so the GC knows about their relationship
</span><span class="cx">     JSC::JSObject* mediaJSWrapperObject = mediaJSWrapper.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSC::Identifier controlsHost = JSC::Identifier::fromString(&amp;exec-&gt;vm(), &quot;controlsHost&quot;);
</span><span class="cx">     
</span><span class="cx">     ASSERT(!mediaJSWrapperObject-&gt;hasProperty(exec, controlsHost));
</span><span class="lines">@@ -6738,8 +6746,8 @@
</span><span class="cx">     updatePageScaleFactorJSProperty();
</span><span class="cx">     updateUsesLTRUserInterfaceLayoutDirectionJSProperty();
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
-        exec-&gt;clearException();
</del><ins>+    if (UNLIKELY(scope.exception()))
+        scope.clearException();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLMediaElement::setMediaControlsDependOnPageScaleFactor(bool dependsOnPageScale)
</span><span class="lines">@@ -6774,21 +6782,23 @@
</span><span class="cx">     DOMWrapperWorld&amp; world = ensureIsolatedWorld();
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     JSC::JSValue controllerValue = controllerJSValue(*exec, *globalObject, *this);
</span><span class="cx">     JSC::JSObject* controllerObject = controllerValue.toObject(exec);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue functionValue = controllerObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;handlePresentationModeChange&quot;));
</span><del>-    if (exec-&gt;hadException() || functionValue.isUndefinedOrNull())
</del><ins>+    if (UNLIKELY(scope.exception()) || functionValue.isUndefinedOrNull())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSC::JSObject* function = functionValue.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSC::CallData callData;
</span><span class="cx">     JSC::CallType callType = function-&gt;methodTable()-&gt;getCallData(function, callData);
</span><span class="cx">     if (callType == JSC::CallType::None)
</span><span class="lines">@@ -6815,21 +6825,23 @@
</span><span class="cx"> 
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(world));
</span><ins>+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_THROW_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><del>-    JSC::JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     JSC::JSValue controllerValue = controllerJSValue(*exec, *globalObject, *this);
</span><span class="cx">     JSC::JSObject* controllerObject = controllerValue.toObject(exec);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return emptyString();
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue functionValue = controllerObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;getCurrentControlsStatus&quot;));
</span><del>-    if (exec-&gt;hadException() || functionValue.isUndefinedOrNull())
</del><ins>+    if (UNLIKELY(scope.exception()) || functionValue.isUndefinedOrNull())
</ins><span class="cx">         return emptyString();
</span><span class="cx"> 
</span><span class="cx">     JSC::JSObject* function = functionValue.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!scope.exception());
</ins><span class="cx">     JSC::CallData callData;
</span><span class="cx">     JSC::CallType callType = function-&gt;methodTable()-&gt;getCallData(function, callData);
</span><span class="cx">     JSC::MarkedArgumentBuffer argList;
</span><span class="lines">@@ -6838,7 +6850,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue outputValue = JSC::call(exec, function, callType, callData, controllerObject, argList);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(scope.exception()))
</ins><span class="cx">         return emptyString();
</span><span class="cx"> 
</span><span class="cx">     return outputValue.getString(exec);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -392,10 +392,12 @@
</span><span class="cx"> 
</span><span class="cx">     ScriptController&amp; scriptController = document().frame()-&gt;script();
</span><span class="cx">     JSDOMGlobalObject* globalObject = JSC::jsCast&lt;JSDOMGlobalObject*&gt;(scriptController.globalObject(isolatedWorld));
</span><ins>+
+    JSC::VM&amp; vm = globalObject-&gt;vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx">     JSC::ExecState* exec = globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><del>-    JSC::JSLockHolder lock(exec);
-
</del><span class="cx">     JSC::MarkedArgumentBuffer argList;
</span><span class="cx">     argList.append(toJS(exec, globalObject, root));
</span><span class="cx">     argList.append(jsString(exec, titleText(page, mimeType)));
</span><span class="lines">@@ -408,8 +410,8 @@
</span><span class="cx">     // It is expected the JS file provides a createOverlay(shadowRoot, title, subtitle) function.
</span><span class="cx">     JSC::JSObject* overlay = globalObject-&gt;get(exec, JSC::Identifier::fromString(exec, &quot;createOverlay&quot;)).toObject(exec);
</span><span class="cx">     if (!overlay) {
</span><del>-        ASSERT(exec-&gt;hadException());
-        exec-&gt;clearException();
</del><ins>+        ASSERT(scope.exception());
+        scope.clearException();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     JSC::CallData callData;
</span><span class="lines">@@ -418,7 +420,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     JSC::call(exec, overlay, callType, callData, globalObject, argList);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HTMLPlugInImageElement::partOfSnapshotOverlay(const Node* node) const
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::evaluate):
+        (WebKit::NetscapePluginInstanceProxy::invoke):
+        (WebKit::NetscapePluginInstanceProxy::invokeDefault):
+        (WebKit::NetscapePluginInstanceProxy::construct):
+        (WebKit::NetscapePluginInstanceProxy::getProperty):
+        (WebKit::NetscapePluginInstanceProxy::setProperty):
+        (WebKit::NetscapePluginInstanceProxy::removeProperty):
+        (WebKit::NetscapePluginInstanceProxy::hasProperty):
+        (WebKit::NetscapePluginInstanceProxy::hasMethod):
+        (WebKit::NetscapePluginInstanceProxy::enumerate):
+        * WebView/WebView.mm:
+        (aeDescFromJSValue):
+
</ins><span class="cx"> 2016-09-07  Youenn Fablet  &lt;youenn@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Streams API] Separate compile flag for ReadableStream and WritableStream
</span></span></pre></div>
<a id="trunkSourceWebKitmacPluginsHostedNetscapePluginInstanceProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -885,8 +885,11 @@
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(pluginWorld().vm());
-    Strong&lt;JSGlobalObject&gt; globalObject(pluginWorld().vm(), frame-&gt;script().globalObject(pluginWorld()));
</del><ins>+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
+    Strong&lt;JSGlobalObject&gt; globalObject(vm, frame-&gt;script().globalObject(pluginWorld()));
</ins><span class="cx">     ExecState* exec = globalObject-&gt;globalExec();
</span><span class="cx"> 
</span><span class="cx">     UserGestureIndicator gestureIndicator(allowPopups ? Optional&lt;ProcessingUserGestureState&gt;(ProcessingUserGesture) : Nullopt);
</span><span class="lines">@@ -894,7 +897,7 @@
</span><span class="cx">     JSValue result = JSC::evaluate(exec, makeSource(script));
</span><span class="cx">     
</span><span class="cx">     marshalValue(exec, result, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -915,9 +918,12 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     JSValue function = object-&gt;get(exec, methodName);
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = getCallData(function, callData);
</span><span class="lines">@@ -930,7 +936,7 @@
</span><span class="cx">     JSValue value = call(exec, function, callType, callData, object, argList);
</span><span class="cx">         
</span><span class="cx">     marshalValue(exec, value, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -948,9 +954,12 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);    
</del><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = object-&gt;methodTable()-&gt;getCallData(object, callData);
</span><span class="cx">     if (callType == CallType::None)
</span><span class="lines">@@ -962,7 +971,7 @@
</span><span class="cx">     JSValue value = call(exec, object, callType, callData, object, argList);
</span><span class="cx">     
</span><span class="cx">     marshalValue(exec, value, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -980,9 +989,12 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx"> 
</span><span class="cx">     ConstructData constructData;
</span><span class="cx">     ConstructType constructType = object-&gt;methodTable()-&gt;getConstructData(object, constructData);
</span><span class="lines">@@ -995,7 +1007,7 @@
</span><span class="cx">     JSValue value = JSC::construct(exec, object, constructType, constructData, argList);
</span><span class="cx">     
</span><span class="cx">     marshalValue(exec, value, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1013,13 +1025,16 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);    
</del><span class="cx">     JSValue value = object-&gt;get(exec, propertyName);
</span><span class="cx">     
</span><span class="cx">     marshalValue(exec, value, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1034,13 +1049,16 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);    
</del><span class="cx">     JSValue value = object-&gt;get(exec, propertyName);
</span><span class="cx">     
</span><span class="cx">     marshalValue(exec, value, resultData, resultLength);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1058,15 +1076,18 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);    
</del><span class="cx"> 
</span><span class="cx">     JSValue value = demarshalValue(exec, valueData, valueLength);
</span><span class="cx">     PutPropertySlot slot(object);
</span><span class="cx">     object-&gt;methodTable()-&gt;put(object, exec, propertyName, value, slot);
</span><span class="cx">     
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1084,14 +1105,17 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);    
</del><span class="cx">     
</span><span class="cx">     JSValue value = demarshalValue(exec, valueData, valueLength);
</span><span class="cx">     object-&gt;methodTable()-&gt;putByIndex(object, exec, propertyName, value, false);
</span><span class="cx">     
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1110,15 +1134,18 @@
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     if (!object-&gt;hasProperty(exec, propertyName)) {
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     object-&gt;methodTable()-&gt;deleteProperty(object, exec, propertyName);
</span><del>-    exec-&gt;clearException();    
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1136,16 +1163,19 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     if (!object-&gt;hasProperty(exec, propertyName)) {
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     object-&gt;methodTable()-&gt;deletePropertyByIndex(object, exec, propertyName);
</span><del>-    exec-&gt;clearException();    
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1163,11 +1193,15 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><span class="cx">     bool result = object-&gt;hasProperty(exec, propertyName);
</span><del>-    exec-&gt;clearException();
-    
</del><ins>+    scope.clearException();
+
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1185,11 +1219,15 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><span class="cx">     bool result = object-&gt;hasProperty(exec, propertyName);
</span><del>-    exec-&gt;clearException();
-    
</del><ins>+    scope.clearException();
+
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -1207,11 +1245,14 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">     JSValue func = object-&gt;get(exec, methodName);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return !func.isUndefined();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1229,9 +1270,12 @@
</span><span class="cx">     Frame* frame = core([m_pluginView webFrame]);
</span><span class="cx">     if (!frame)
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
+    VM&amp; vm = pluginWorld().vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     ExecState* exec = frame-&gt;script().globalObject(pluginWorld())-&gt;globalExec();
</span><del>-    JSLockHolder lock(exec);
</del><span class="cx">  
</span><span class="cx">     PropertyNameArray propertyNames(exec, PropertyNameMode::Strings);
</span><span class="cx">     object-&gt;methodTable()-&gt;getPropertyNames(object, exec, propertyNames, EnumerationMode());
</span><span class="lines">@@ -1251,7 +1295,7 @@
</span><span class="cx"> 
</span><span class="cx">     memcpy(resultData, [data bytes], resultLength);
</span><span class="cx"> 
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -6936,6 +6936,9 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSC::JSValue jsValue)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     NSAppleEventDescriptor* aeDesc = 0;
</span><span class="cx">     if (jsValue.isBoolean())
</span><span class="cx">         return [NSAppleEventDescriptor descriptorWithBoolean:jsValue.asBoolean()];
</span><span class="lines">@@ -6976,8 +6979,8 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         JSC::JSValue primitive = object-&gt;toPrimitive(exec);
</span><del>-        if (exec-&gt;hadException()) {
-            exec-&gt;clearException();
</del><ins>+        if (UNLIKELY(scope.exception())) {
+            scope.clearException();
</ins><span class="cx">             return [NSAppleEventDescriptor nullDescriptor];
</span><span class="cx">         }
</span><span class="cx">         return aeDescFromJSValue(exec, primitive);
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit/win/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        * Plugins/PluginPackage.cpp:
+        (WebCore::NPN_Evaluate):
+        (WebCore::NPN_Invoke):
+
</ins><span class="cx"> 2016-09-06  Per Arne Vollan  &lt;pvollan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Null pointer crash under WebView::scrollOffset.
</span></span></pre></div>
<a id="trunkSourceWebKitwinPluginsPluginPackagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Plugins/PluginPackage.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Plugins/PluginPackage.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit/win/Plugins/PluginPackage.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -210,14 +210,18 @@
</span><span class="cx">         // PluginView, so we destroy it asynchronously.
</span><span class="cx">         PluginView::keepAlive(instance);
</span><span class="cx"> 
</span><del>-        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSC::JSLockHolder lock(exec);
</del><ins>+        auto globalObject = rootObject-&gt;globalObject();
+        auto&amp; vm = globalObject-&gt;vm();
+        JSC::JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        JSC::ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         String scriptString = JSC::Bindings::convertNPStringToUTF16(s);
</span><span class="cx"> 
</span><del>-        JSC::JSValue returnValue = JSC::evaluate(rootObject-&gt;globalObject()-&gt;globalExec(), makeSource(scriptString), JSC::JSValue());
</del><ins>+        JSC::JSValue returnValue = JSC::evaluate(exec, makeSource(scriptString), JSC::JSValue());
</ins><span class="cx"> 
</span><span class="cx">         JSC::Bindings::convertValueToNPVariant(exec, returnValue, variant);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -247,8 +251,13 @@
</span><span class="cx">         JSC::Bindings::RootObject* rootObject = obj-&gt;rootObject;
</span><span class="cx">         if (!rootObject || !rootObject-&gt;isValid())
</span><span class="cx">             return false;
</span><del>-        JSC::ExecState* exec = rootObject-&gt;globalObject()-&gt;globalExec();
-        JSC::JSLockHolder lock(exec);
</del><ins>+
+        auto globalObject = rootObject-&gt;globalObject();
+        auto&amp; vm = globalObject-&gt;vm();
+        JSC::JSLockHolder lock(vm);
+        auto scope = DECLARE_CATCH_SCOPE(vm);
+
+        JSC::ExecState* exec = globalObject-&gt;globalExec();
</ins><span class="cx">         JSC::JSValue function = obj-&gt;imp-&gt;get(exec, JSC::Bindings::identifierFromNPIdentifier(exec, i-&gt;string()));
</span><span class="cx">         JSC::CallData callData;
</span><span class="cx">         JSC::CallType callType = getCallData(function, callData);
</span><span class="lines">@@ -262,7 +271,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Convert and return the result of the function call.
</span><span class="cx">         JSC::Bindings::convertValueToNPVariant(exec, resultV, result);
</span><del>-        exec-&gt;clearException();
</del><ins>+        scope.clearException();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-09-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
+        https://bugs.webkit.org/show_bug.cgi?id=161498
+
+        Reviewed by Geoffrey Garen.
+
+        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
+        (WebKit::NPJSObject::hasMethod):
+        (WebKit::NPJSObject::hasProperty):
+        (WebKit::NPJSObject::getProperty):
+        (WebKit::NPJSObject::setProperty):
+        (WebKit::NPJSObject::removeProperty):
+        (WebKit::NPJSObject::construct):
+        (WebKit::NPJSObject::invoke):
+
</ins><span class="cx"> 2016-09-07  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Make inspection of Inspector conditional on DEVELOPER_MODE
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsNetscapeNPJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp (205568 => 205569)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp        2016-09-07 22:01:39 UTC (rev 205568)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp        2016-09-07 22:10:50 UTC (rev 205569)
</span><span class="lines">@@ -101,10 +101,12 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue value = m_jsObject-&gt;get(exec, identifierFromIdentifierRep(exec, identifierRep));    
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     CallData callData;
</span><span class="cx">     return getCallData(value, callData) != CallType::None;
</span><span class="lines">@@ -147,7 +149,9 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     bool result;
</span><span class="cx">     if (identifierRep-&gt;isString())
</span><span class="lines">@@ -155,7 +159,7 @@
</span><span class="cx">     else
</span><span class="cx">         result = m_jsObject-&gt;hasProperty(exec, identifierRep-&gt;number());
</span><span class="cx"> 
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -167,7 +171,10 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     JSValue jsResult;
</span><span class="cx">     if (identifierRep-&gt;isString())
</span><span class="cx">         jsResult = m_jsObject-&gt;get(exec, identifierFromIdentifierRep(exec, identifierRep));
</span><span class="lines">@@ -175,7 +182,7 @@
</span><span class="cx">         jsResult = m_jsObject-&gt;get(exec, identifierRep-&gt;number());
</span><span class="cx">     
</span><span class="cx">     m_objectMap-&gt;convertJSValueToNPVariant(exec, jsResult, *result);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -187,7 +194,9 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     JSValue jsValue = m_objectMap-&gt;convertNPVariantToJSValue(exec, m_objectMap-&gt;globalObject(), *value);
</span><span class="cx">     if (identifierRep-&gt;isString()) {
</span><span class="lines">@@ -195,7 +204,7 @@
</span><span class="cx">         m_jsObject-&gt;methodTable()-&gt;put(m_jsObject.get(), exec, identifierFromIdentifierRep(exec, identifierRep), jsValue, slot);
</span><span class="cx">     } else
</span><span class="cx">         m_jsObject-&gt;methodTable()-&gt;putByIndex(m_jsObject.get(), exec, identifierRep-&gt;number(), jsValue, false);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -208,12 +217,15 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     if (identifierRep-&gt;isString()) {
</span><span class="cx">         Identifier identifier = identifierFromIdentifierRep(exec, identifierRep);
</span><span class="cx">         
</span><span class="cx">         if (!m_jsObject-&gt;hasProperty(exec, identifier)) {
</span><del>-            exec-&gt;clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -220,7 +232,7 @@
</span><span class="cx">         m_jsObject-&gt;methodTable()-&gt;deleteProperty(m_jsObject.get(), exec, identifier);
</span><span class="cx">     } else {
</span><span class="cx">         if (!m_jsObject-&gt;hasProperty(exec, identifierRep-&gt;number())) {
</span><del>-            exec-&gt;clearException();
</del><ins>+            scope.clearException();
</ins><span class="cx">             return false;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -227,7 +239,7 @@
</span><span class="cx">         m_jsObject-&gt;methodTable()-&gt;deletePropertyByIndex(m_jsObject.get(), exec, identifierRep-&gt;number());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -259,7 +271,9 @@
</span><span class="cx">     if (!exec)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    JSLockHolder lock(exec);
</del><ins>+    VM&amp; vm = exec-&gt;vm();
+    JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
</ins><span class="cx"> 
</span><span class="cx">     ConstructData constructData;
</span><span class="cx">     ConstructType constructType = getConstructData(m_jsObject.get(), constructData);
</span><span class="lines">@@ -275,7 +289,7 @@
</span><span class="cx">     
</span><span class="cx">     // Convert and return the new object.
</span><span class="cx">     m_objectMap-&gt;convertJSValueToNPVariant(exec, value, *result);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -282,6 +296,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool NPJSObject::invoke(ExecState* exec, JSGlobalObject* globalObject, JSValue function, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
</ins><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = getCallData(function, callData);
</span><span class="cx">     if (callType == CallType::None)
</span><span class="lines">@@ -296,7 +313,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Convert and return the result of the function call.
</span><span class="cx">     m_objectMap-&gt;convertJSValueToNPVariant(exec, value, *result);
</span><del>-    exec-&gt;clearException();
</del><ins>+    scope.clearException();
</ins><span class="cx">     
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>