<!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>[201787] 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/201787">201787</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-06-07 19:53:32 -0700 (Tue, 07 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Need an exception check after constructEmptyArray().
https://bugs.webkit.org/show_bug.cgi?id=158411

Reviewed by Saam Barati.

Source/JavaScriptCore:

Added an exception check after each call to constructEmptyArray().

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):
* 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::arrayProtoFuncConcat):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser&lt;CharType&gt;::parse):
* runtime/ModuleLoaderObject.cpp:
(JSC::moduleLoaderObjectRequestedModules):
* runtime/ObjectConstructor.cpp:
(JSC::ownPropertyKeys):
* runtime/RegExpObject.cpp:
(JSC::collectMatches):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncSplitFast):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplitFast):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):

* tests/stress/regress-158411.js: Added.

Source/WebCore:

A stress test for this was added in JavaScriptCore.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::buildJSONForRSAComponents):
(WebCore::addBoolToJSON):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSDOMBinding.h:
(WebCore::toJS):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::deserialize):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp">trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterShadowChickencpp">trunk/Source/JavaScriptCore/interpreter/ShadowChicken.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="#trunkSourceJavaScriptCoreruntimeLiteralParsercpp">trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeModuleLoaderObjectcpp">trunk/Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeObjectConstructorcpp">trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp</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="#trunkSourceJavaScriptCoreruntimeStringPrototypecpp">trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeTemplateRegistrycpp">trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp">trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp">trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoretestsstressregress158411js">trunk/Source/JavaScriptCore/tests/stress/regress-158411.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2016-06-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Need an exception check after constructEmptyArray().
+        https://bugs.webkit.org/show_bug.cgi?id=158411
+
+        Reviewed by Saam Barati.
+
+        Added an exception check after each call to constructEmptyArray().
+
+        * inspector/JSInjectedScriptHost.cpp:
+        (Inspector::JSInjectedScriptHost::getInternalProperties):
+        (Inspector::JSInjectedScriptHost::weakMapEntries):
+        (Inspector::JSInjectedScriptHost::weakSetEntries):
+        (Inspector::JSInjectedScriptHost::iteratorEntries):
+        * interpreter/ShadowChicken.cpp:
+        (JSC::ShadowChicken::functionsOnStack):
+        * 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::arrayProtoFuncConcat):
+        (JSC::arrayProtoFuncSlice):
+        (JSC::arrayProtoFuncSplice):
+        * runtime/LiteralParser.cpp:
+        (JSC::LiteralParser&lt;CharType&gt;::parse):
+        * runtime/ModuleLoaderObject.cpp:
+        (JSC::moduleLoaderObjectRequestedModules):
+        * runtime/ObjectConstructor.cpp:
+        (JSC::ownPropertyKeys):
+        * runtime/RegExpObject.cpp:
+        (JSC::collectMatches):
+        * runtime/RegExpPrototype.cpp:
+        (JSC::regExpProtoFuncSplitFast):
+        * runtime/StringPrototype.cpp:
+        (JSC::stringProtoFuncSplitFast):
+        * runtime/TemplateRegistry.cpp:
+        (JSC::TemplateRegistry::getTemplateObject):
+
+        * tests/stress/regress-158411.js: Added.
+
</ins><span class="cx"> 2016-06-07  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement Air::allocateStack() in ES6 to see how much of a bad idea that is
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSInjectedScriptHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/inspector/JSInjectedScriptHost.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -257,11 +257,14 @@
</span><span class="cx">     if (exec-&gt;argumentCount() &lt; 1)
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;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><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><span class="cx">         switch (promise-&gt;status(exec-&gt;vm())) {
</span><span class="cx">         case JSPromise::Status::Pending:
</span><span class="cx">             array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, ASCIILiteral(&quot;status&quot;), jsNontrivialString(exec, ASCIILiteral(&quot;pending&quot;))));
</span><span class="lines">@@ -282,6 +285,8 @@
</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><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">         if (boundFunction-&gt;boundArgs())
</span><span class="lines">@@ -292,6 +297,8 @@
</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><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">         return array;
</span><span class="lines">@@ -304,6 +311,8 @@
</span><span class="cx"> 
</span><span class="cx">             unsigned index = 0;
</span><span class="cx">             JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><ins>+            if (UNLIKELY(vm.exception()))
+                return jsUndefined();
</ins><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="cx">             return array;
</span><span class="lines">@@ -325,6 +334,8 @@
</span><span class="cx">         }
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;array&quot;, arrayIterator-&gt;iteratedValue(exec)));
</span><span class="cx">         array-&gt;putDirectIndex(exec, index++, constructInternalProperty(exec, &quot;kind&quot;, jsNontrivialString(exec, kind)));
</span><span class="cx">         return array;
</span><span class="lines">@@ -345,6 +356,8 @@
</span><span class="cx">         }
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">         return array;
</span><span class="lines">@@ -365,6 +378,8 @@
</span><span class="cx">         }
</span><span class="cx">         unsigned index = 0;
</span><span class="cx">         JSArray* array = constructEmptyArray(exec, nullptr, 2);
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">         return array;
</span><span class="lines">@@ -373,6 +388,8 @@
</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><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">     }
</span><span class="lines">@@ -380,6 +397,8 @@
</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><ins>+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><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="cx">     }
</span><span class="lines">@@ -405,6 +424,7 @@
</span><span class="cx">     if (exec-&gt;argumentCount() &lt; 1)
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;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">@@ -419,6 +439,8 @@
</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><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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="cx">         entry-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;key&quot;), it-&gt;key);
</span><span class="lines">@@ -449,6 +471,7 @@
</span><span class="cx">     if (exec-&gt;argumentCount() &lt; 1)
</span><span class="cx">         return jsUndefined();
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;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">@@ -463,6 +486,8 @@
</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><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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="cx">         entry-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;value&quot;), it-&gt;key);
</span><span class="lines">@@ -501,7 +526,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(exec-&gt;hadException()))
</del><ins>+        if (UNLIKELY(vm.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">@@ -521,16 +546,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><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.exception()))
</ins><span class="cx">             break;
</span><span class="cx"> 
</span><span class="cx">         JSObject* entry = constructEmptyObject(exec);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterShadowChickencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/interpreter/ShadowChicken.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -435,10 +435,13 @@
</span><span class="cx"> 
</span><span class="cx"> JSArray* ShadowChicken::functionsOnStack(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     iterate(
</span><del>-        exec-&gt;vm(), exec,
</del><ins>+        vm, exec,
</ins><span class="cx">         [&amp;] (const Frame&amp; frame) -&gt; bool {
</span><span class="cx">             result-&gt;push(exec, frame.callee);
</span><span class="cx">             return true;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerBytecodeSequencecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerBytecodeSequence.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -77,15 +77,20 @@
</span><span class="cx"> 
</span><span class="cx"> void BytecodeSequence::addSequenceProperties(ExecState* exec, JSObject* result) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* header = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return;
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().header, header);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().header, header);
</ins><span class="cx">     
</span><span class="cx">     JSArray* sequence = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return;
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().bytecode, sequence);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().bytecode, sequence);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::Profiler
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerCompilationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerCompilation.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -114,48 +114,60 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue Compilation::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
+    result-&gt;putDirect(vm, exec-&gt;propertyNames().bytecodesID, jsNumber(m_bytecodes-&gt;id()));
+    result-&gt;putDirect(vm, exec-&gt;propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind))));
</ins><span class="cx">     
</span><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().bytecodesID, jsNumber(m_bytecodes-&gt;id()));
-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().compilationKind, jsString(exec, String::fromUTF8(toCString(m_kind))));
-    
</del><span class="cx">     JSArray* profiledBytecodes = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().profiledBytecodes, profiledBytecodes);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().profiledBytecodes, profiledBytecodes);
</ins><span class="cx">     
</span><span class="cx">     JSArray* descriptions = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().descriptions, descriptions);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().descriptions, descriptions);
</ins><span class="cx">     
</span><span class="cx">     JSArray* counters = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-        counterEntry-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().origin, it-&gt;key.toJS(exec));
-        counterEntry-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().executionCount, jsNumber(it-&gt;value-&gt;count()));
</del><ins>+        counterEntry-&gt;putDirect(vm, exec-&gt;propertyNames().origin, it-&gt;key.toJS(exec));
+        counterEntry-&gt;putDirect(vm, exec-&gt;propertyNames().executionCount, jsNumber(it-&gt;value-&gt;count()));
</ins><span class="cx">         counters-&gt;push(exec, counterEntry);
</span><span class="cx">     }
</span><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().counters, counters);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().counters, counters);
</ins><span class="cx">     
</span><span class="cx">     JSArray* exitSites = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().osrExitSites, exitSites);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().osrExitSites, exitSites);
</ins><span class="cx">     
</span><span class="cx">     JSArray* exits = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().osrExits, exits);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().osrExits, exits);
</ins><span class="cx">     
</span><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));
-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason))));
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().numInlinedGetByIds, jsNumber(m_numInlinedGetByIds));
+    result-&gt;putDirect(vm, exec-&gt;propertyNames().numInlinedPutByIds, jsNumber(m_numInlinedPutByIds));
+    result-&gt;putDirect(vm, exec-&gt;propertyNames().numInlinedCalls, jsNumber(m_numInlinedCalls));
+    result-&gt;putDirect(vm, exec-&gt;propertyNames().jettisonReason, jsString(exec, String::fromUTF8(toCString(m_jettisonReason))));
</ins><span class="cx">     if (!m_additionalJettisonReason.isNull())
</span><del>-        result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().additionalJettisonReason, jsString(exec, String::fromUTF8(m_additionalJettisonReason)));
</del><ins>+        result-&gt;putDirect(vm, exec-&gt;propertyNames().additionalJettisonReason, jsString(exec, String::fromUTF8(m_additionalJettisonReason)));
</ins><span class="cx">     
</span><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().uid, m_uid.toJS(exec));
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().uid, m_uid.toJS(exec));
</ins><span class="cx">     
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerDatabase.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -99,22 +99,29 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue Database::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSObject* result = constructEmptyObject(exec);
</span><span class="cx">     
</span><span class="cx">     JSArray* bytecodes = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().bytecodes, bytecodes);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().bytecodes, bytecodes);
</ins><span class="cx">     
</span><span class="cx">     JSArray* compilations = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().compilations, compilations);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().compilations, compilations);
</ins><span class="cx">     
</span><span class="cx">     JSArray* events = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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><del>-    result-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().events, events);
</del><ins>+    result-&gt;putDirect(vm, exec-&gt;propertyNames().events, events);
</ins><span class="cx">     
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerOSRExitSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerOSRExitSite.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -36,7 +36,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue OSRExitSite::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><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 class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerOriginStackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerOriginStack.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -100,7 +100,10 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue OriginStack::toJS(ExecState* exec) const
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* result = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><span class="cx">     
</span><span class="cx">     for (unsigned i = 0; i &lt; m_stack.size(); ++i)
</span><span class="cx">         result-&gt;putDirectIndex(exec, i, m_stack[i].toJS(exec));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeArrayPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -590,6 +590,7 @@
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncConcat(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSValue thisValue = exec-&gt;thisValue().toThis(exec, StrictMode);
</span><span class="cx">     unsigned argCount = exec-&gt;argumentCount();
</span><span class="cx">     JSValue curArg = thisValue.toObject(exec);
</span><span class="lines">@@ -610,7 +611,7 @@
</span><span class="cx">         if (currentArray) {
</span><span class="cx">             // Can't use JSArray::length here because this might be a RuntimeArray!
</span><span class="cx">             finalArraySize += getLength(exec, currentArray);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(vm.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         } else
</span><span class="cx">             ++finalArraySize;
</span><span class="lines">@@ -636,22 +637,22 @@
</span><span class="cx">     else {
</span><span class="cx">         // We add the newTarget because the compiler gets confused between 0 being a number and a pointer.
</span><span class="cx">         result = constructEmptyArray(exec, nullptr, 0, JSValue());
</span><del>-        if (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     curArg = thisValue.toObject(exec);
</span><del>-    ASSERT(!exec-&gt;hadException());
</del><ins>+    ASSERT(!vm.exception());
</ins><span class="cx">     unsigned n = 0;
</span><span class="cx">     for (unsigned i = 0; ; ++i) {
</span><span class="cx">         if (JSArray* currentArray = jsDynamicCast&lt;JSArray*&gt;(curArg)) {
</span><span class="cx">             // Can't use JSArray::length here because this might be a RuntimeArray!
</span><span class="cx">             unsigned length = getLength(exec, currentArray);
</span><del>-            if (exec-&gt;hadException())
</del><ins>+            if (UNLIKELY(vm.exception()))
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">             for (unsigned k = 0; k &lt; length; ++k) {
</span><span class="cx">                 JSValue v = getProperty(exec, currentArray, k);
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(vm.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">@@ -846,11 +847,12 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL arrayProtoFuncSlice(ExecState* exec)
</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><ins>+    VM&amp; vm = exec-&gt;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(vm.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">@@ -869,13 +871,16 @@
</span><span class="cx">     JSObject* result;
</span><span class="cx">     if (speciesResult.first == SpeciesConstructResult::CreatedObject)
</span><span class="cx">         result = speciesResult.second;
</span><del>-    else
</del><ins>+    else {
</ins><span class="cx">         result = constructEmptyArray(exec, nullptr, end - begin);
</span><ins>+        if (UNLIKELY(vm.exception()))
+            return JSValue::encode(jsUndefined());
+    }
</ins><span class="cx"> 
</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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.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">@@ -894,7 +899,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(vm.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">@@ -905,8 +910,11 @@
</span><span class="cx">         JSObject* result;
</span><span class="cx">         if (speciesResult.first == SpeciesConstructResult::CreatedObject)
</span><span class="cx">             result = speciesResult.second;
</span><del>-        else
</del><ins>+        else {
</ins><span class="cx">             result = constructEmptyArray(exec, nullptr);
</span><ins>+            if (UNLIKELY(vm.exception()))
+                return JSValue::encode(jsUndefined());
+        }
</ins><span class="cx"> 
</span><span class="cx">         setLength(exec, result, 0);
</span><span class="cx">         return JSValue::encode(result);
</span><span class="lines">@@ -939,10 +947,10 @@
</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 (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(vm.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">                 result-&gt;putByIndexInline(exec, k, v, true);
</span><del>-                if (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(vm.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="lines">@@ -952,7 +960,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 (exec-&gt;hadException())
</del><ins>+                if (UNLIKELY(vm.exception()))
</ins><span class="cx">                     return JSValue::encode(jsUndefined());
</span><span class="cx">                 result-&gt;initializeIndex(vm, k, v);
</span><span class="cx">             }
</span><span class="lines">@@ -962,16 +970,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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.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 (exec-&gt;hadException())
</del><ins>+        if (UNLIKELY(vm.exception()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeLiteralParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -583,6 +583,8 @@
</span><span class="cx">             startParseArray:
</span><span class="cx">             case StartParseArray: {
</span><span class="cx">                 JSArray* array = constructEmptyArray(m_exec, 0);
</span><ins>+                if (UNLIKELY(m_exec-&gt;hadException()))
+                    return JSValue();
</ins><span class="cx">                 objectStack.append(array);
</span><span class="cx">             }
</span><span class="cx">             doParseArrayStartExpression:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeModuleLoaderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/ModuleLoaderObject.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -297,6 +297,8 @@
</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><ins>+    if (UNLIKELY(exec-&gt;hadException()))
+        JSValue::encode(jsUndefined());
</ins><span class="cx">     size_t i = 0;
</span><span class="cx">     for (auto&amp; key : moduleRecord-&gt;requestedModules())
</span><span class="cx">         result-&gt;putDirectIndex(exec, i++, jsString(exec, key.get()));
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeObjectConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -703,12 +703,15 @@
</span><span class="cx"> // FIXME: Use the enumeration cache.
</span><span class="cx"> JSArray* ownPropertyKeys(ExecState* exec, JSObject* object, PropertyNameMode propertyNameMode, DontEnumPropertiesMode dontEnumPropertiesMode)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     PropertyNameArray properties(exec, propertyNameMode);
</span><del>-    object-&gt;methodTable(exec-&gt;vm())-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(dontEnumPropertiesMode));
-    if (exec-&gt;hadException())
</del><ins>+    object-&gt;methodTable(vm)-&gt;getOwnPropertyNames(object, exec, properties, EnumerationMode(dontEnumPropertiesMode));
+    if (UNLIKELY(vm.exception()))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     JSArray* keys = constructEmptyArray(exec, 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     switch (propertyNameMode) {
</span><span class="cx">     case PropertyNameMode::Strings: {
</span><span class="lines">@@ -727,7 +730,7 @@
</span><span class="cx">             const auto&amp; identifier = properties[i];
</span><span class="cx">             ASSERT(identifier.isSymbol());
</span><span class="cx">             if (!exec-&gt;propertyNames().isPrivateName(identifier))
</span><del>-                keys-&gt;push(exec, Symbol::create(exec-&gt;vm(), static_cast&lt;SymbolImpl&amp;&gt;(*identifier.impl())));
</del><ins>+                keys-&gt;push(exec, Symbol::create(vm, static_cast&lt;SymbolImpl&amp;&gt;(*identifier.impl())));
</ins><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -746,7 +749,7 @@
</span><span class="cx"> 
</span><span class="cx">         // To ensure the order defined in the spec (9.1.12), we append symbols at the last elements of keys.
</span><span class="cx">         for (const auto&amp; identifier : propertySymbols)
</span><del>-            keys-&gt;push(exec, Symbol::create(exec-&gt;vm(), static_cast&lt;SymbolImpl&amp;&gt;(*identifier.impl())));
</del><ins>+            keys-&gt;push(exec, Symbol::create(vm, static_cast&lt;SymbolImpl&amp;&gt;(*identifier.impl())));
</ins><span class="cx"> 
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/RegExpObject.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -179,6 +179,8 @@
</span><span class="cx">     static unsigned maxSizeForDirectPath = 100000;
</span><span class="cx">     
</span><span class="cx">     JSArray* array = constructEmptyArray(exec, nullptr);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return jsUndefined();
</ins><span class="cx"> 
</span><span class="cx">     auto iterate = [&amp;] () {
</span><span class="cx">         size_t end = result.end;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeRegExpPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -563,6 +563,8 @@
</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><ins>+    if (UNLIKELY(vm.exception()))
+        return JSValue::encode(jsUndefined());
</ins><span class="cx">     unsigned resultLength = 0;
</span><span class="cx"> 
</span><span class="cx">     // 13. If limit is undefined, let lim be 2^32-1; else let lim be ? ToUint32(limit).
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStringPrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -1082,19 +1082,22 @@
</span><span class="cx"> // ES 21.1.3.17 String.prototype.split(separator, limit)
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncSplitFast(ExecState* exec)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;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">     // 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 (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(vm.exception()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(!input.isNull());
</span><span class="cx"> 
</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><ins>+    if (UNLIKELY(vm.exception()))
+        return JSValue::encode(jsUndefined());
</ins><span class="cx"> 
</span><span class="cx">     // 5. Let lengthA be 0.
</span><span class="cx">     unsigned resultLength = 0;
</span><span class="lines">@@ -1110,7 +1113,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 (exec-&gt;hadException())
</del><ins>+    if (UNLIKELY(vm.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></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeTemplateRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/JavaScriptCore/runtime/TemplateRegistry.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -45,9 +45,14 @@
</span><span class="cx">     if (cached)
</span><span class="cx">         return cached;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     unsigned count = templateKey.cookedStrings().size();
</span><span class="cx">     JSArray* templateObject = constructEmptyArray(exec, nullptr, count);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return nullptr;
</ins><span class="cx">     JSArray* rawObject = constructEmptyArray(exec, nullptr, count);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     for (unsigned index = 0; index &lt; count; ++index) {
</span><span class="cx">         templateObject-&gt;putDirectIndex(exec, index, jsString(exec, templateKey.cookedStrings()[index]), ReadOnly | DontDelete, PutDirectIndexLikePutDirect);
</span><span class="lines">@@ -57,7 +62,7 @@
</span><span class="cx">     objectConstructorFreeze(exec, rawObject);
</span><span class="cx">     ASSERT(!exec-&gt;hadException());
</span><span class="cx"> 
</span><del>-    templateObject-&gt;putDirect(exec-&gt;vm(), exec-&gt;propertyNames().raw, rawObject, ReadOnly | DontEnum | DontDelete);
</del><ins>+    templateObject-&gt;putDirect(vm, exec-&gt;propertyNames().raw, rawObject, ReadOnly | DontEnum | DontDelete);
</ins><span class="cx"> 
</span><span class="cx">     objectConstructorFreeze(exec, templateObject);
</span><span class="cx">     ASSERT(!exec-&gt;hadException());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoretestsstressregress158411js"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/tests/stress/regress-158411.js (0 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/tests/stress/regress-158411.js                                (rev 0)
+++ trunk/Source/JavaScriptCore/tests/stress/regress-158411.js        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+//@ defaultNoSamplingProfilerRun
+
+// Should not crash.
+try {
+    function foo(){
+        [].slice({});
+        foo();
+    }
+    foo();
+} catch (e) {
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/ChangeLog        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-06-07  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Need an exception check after constructEmptyArray().
+        https://bugs.webkit.org/show_bug.cgi?id=158411
+
+        Reviewed by Saam Barati.
+
+        A stress test for this was added in JavaScriptCore.
+
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSCommandLineAPIHostCustom.cpp:
+        (WebCore::getJSListenerFunctions):
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::buildJSONForRSAComponents):
+        (WebCore::addBoolToJSON):
+        (WebCore::addUsagesToJSON):
+        (WebCore::JSCryptoKeySerializationJWK::serialize):
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::toJS):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneDeserializer::deserialize):
+
</ins><span class="cx"> 2016-06-07  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         The backdrop-filter property does not respect border-radius
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -88,16 +88,19 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Locker&lt;JSLock&gt; locker(state.vm().apiLock());
</del><ins>+    VM&amp; vm = state.vm();
+    Locker&lt;JSLock&gt; locker(vm.apiLock());
</ins><span class="cx"> 
</span><span class="cx">     switch (key-&gt;type()) {
</span><span class="cx">     case KeyType::Array: {
</span><span class="cx">         auto&amp; inArray = key-&gt;array();
</span><span class="cx">         unsigned size = inArray.size();
</span><del>-        auto&amp; outArray = *constructEmptyArray(&amp;state, 0, &amp;globalObject, size);
</del><ins>+        auto outArray = constructEmptyArray(&amp;state, 0, &amp;globalObject, size);
+        if (UNLIKELY(vm.exception()))
+            return jsUndefined();
</ins><span class="cx">         for (size_t i = 0; i &lt; size; ++i)
</span><del>-            outArray.putDirectIndex(&amp;state, i, toJS(state, globalObject, inArray.at(i).get()));
-        return &amp;outArray;
</del><ins>+            outArray-&gt;putDirectIndex(&amp;state, i, toJS(state, globalObject, inArray.at(i).get()));
+        return outArray;
</ins><span class="cx">     }
</span><span class="cx">     case KeyType::String:
</span><span class="cx">         return jsStringWithCache(&amp;state, key-&gt;string());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCommandLineAPIHostCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/bindings/js/JSCommandLineAPIHostCustom.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -67,7 +67,10 @@
</span><span class="cx"> 
</span><span class="cx"> static JSArray* getJSListenerFunctions(ExecState&amp; state, Document* document, const EventListenerInfo&amp; listenerInfo)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = state.vm();
</ins><span class="cx">     JSArray* result = constructEmptyArray(&amp;state, nullptr);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return nullptr;
</ins><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 class="cx">         const JSEventListener* jsListener = JSEventListener::cast(listenerInfo.eventListenerVector[i].listener.get());
</span><span class="lines">@@ -85,8 +88,8 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         JSObject* listenerEntry = constructEmptyObject(&amp;state);
</span><del>-        listenerEntry-&gt;putDirect(state.vm(), Identifier::fromString(&amp;state, &quot;listener&quot;), function);
-        listenerEntry-&gt;putDirect(state.vm(), Identifier::fromString(&amp;state, &quot;useCapture&quot;), jsBoolean(listenerInfo.eventListenerVector[i].useCapture));
</del><ins>+        listenerEntry-&gt;putDirect(vm, Identifier::fromString(&amp;state, &quot;listener&quot;), function);
+        listenerEntry-&gt;putDirect(vm, Identifier::fromString(&amp;state, &quot;useCapture&quot;), jsBoolean(listenerInfo.eventListenerVector[i].useCapture));
</ins><span class="cx">         result-&gt;putDirectIndex(&amp;state, outputIndex++, JSValue(listenerEntry));
</span><span class="cx">     }
</span><span class="cx">     return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCryptoKeySerializationJWKcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -534,7 +534,10 @@
</span><span class="cx">     if (data.otherPrimeInfos().isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* oth = constructEmptyArray(exec, 0, exec-&gt;lexicalGlobalObject(), data.otherPrimeInfos().size());
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return;
</ins><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="cx">         addToJSON(exec, jsPrimeInfo, &quot;r&quot;, base64URLEncode(data.otherPrimeInfos()[i].primeFactor));
</span><span class="lines">@@ -542,7 +545,7 @@
</span><span class="cx">         addToJSON(exec, jsPrimeInfo, &quot;t&quot;, base64URLEncode(data.otherPrimeInfos()[i].factorCRTCoefficient));
</span><span class="cx">         oth-&gt;putDirectIndex(exec, i, jsPrimeInfo);
</span><span class="cx">     }
</span><del>-    result-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;oth&quot;), oth);
</del><ins>+    result-&gt;putDirect(vm, Identifier::fromString(exec, &quot;oth&quot;), oth);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void addBoolToJSON(ExecState* exec, JSObject* json, const char* key, bool value)
</span><span class="lines">@@ -655,7 +658,10 @@
</span><span class="cx"> 
</span><span class="cx"> static void addUsagesToJSON(ExecState* exec, JSObject* json, CryptoKeyUsage usages)
</span><span class="cx"> {
</span><ins>+    VM&amp; vm = exec-&gt;vm();
</ins><span class="cx">     JSArray* keyOps = constructEmptyArray(exec, 0, exec-&gt;lexicalGlobalObject(), 0);
</span><ins>+    if (UNLIKELY(vm.exception()))
+        return;
</ins><span class="cx"> 
</span><span class="cx">     unsigned index = 0;
</span><span class="cx">     if (usages &amp; CryptoKeyUsageSign)
</span><span class="lines">@@ -675,7 +681,7 @@
</span><span class="cx">     if (usages &amp; CryptoKeyUsageDeriveBits)
</span><span class="cx">         keyOps-&gt;putDirectIndex(exec, index++, jsNontrivialString(exec, ASCIILiteral(&quot;deriveBits&quot;)));
</span><span class="cx"> 
</span><del>-    json-&gt;putDirect(exec-&gt;vm(), Identifier::fromString(exec, &quot;key_ops&quot;), keyOps);
</del><ins>+    json-&gt;putDirect(vm, Identifier::fromString(exec, &quot;key_ops&quot;), keyOps);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String JSCryptoKeySerializationJWK::serialize(ExecState* exec, const CryptoKey&amp; key)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -540,6 +540,8 @@
</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><span class="cx">     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><ins>+    if (UNLIKELY(exec-&gt;hadException()))
+        return JSC::jsUndefined();
</ins><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="cx">     return array;
</span><span class="lines">@@ -548,6 +550,8 @@
</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><span class="cx">     JSC::JSArray* array = constructEmptyArray(exec, nullptr, vector.size());
</span><ins>+    if (UNLIKELY(exec-&gt;hadException()))
+        return JSC::jsUndefined();
</ins><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="cx">     return array;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (201786 => 201787)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-06-08 02:47:44 UTC (rev 201786)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-06-08 02:53:32 UTC (rev 201787)
</span><span class="lines">@@ -2463,6 +2463,8 @@
</span><span class="cx">                 goto error;
</span><span class="cx">             }
</span><span class="cx">             JSArray* outArray = constructEmptyArray(m_exec, 0, m_globalObject, length);
</span><ins>+            if (UNLIKELY(m_exec-&gt;hadException()))
+                goto error;
</ins><span class="cx">             m_gcBuffer.append(outArray);
</span><span class="cx">             outputObjectStack.append(outArray);
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>