<!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>[202981] trunk/Source/WebCore</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/202981">202981</a></dd>
<dt>Author</dt> <dd>nael.ouedraogo@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-07-08 08:52:57 -0700 (Fri, 08 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>ExecState should be passed by reference in JS bindings generator for custom constructors
https://bugs.webkit.org/show_bug.cgi?id=159357

Reviewed by Youenn Fablet.

Pass ExecState as a reference instead of pointer in JS bindings
code for custom constructors.

* bindings/js/JSAudioContextCustom.cpp:
(WebCore::constructJSAudioContext):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSDOMFormDataCustom.cpp:
(WebCore::constructJSDOMFormData):
(WebCore::JSDOMFormData::append):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSMediaSessionCustom.cpp:
(WebCore::constructJSMediaSession):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamController):
(WebCore::constructJSReadableStreamReader):
* bindings/js/JSWebKitPointCustom.cpp:
(WebCore::constructJSWebKitPoint):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSAudioContextCustomcpp">trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMFormDataCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDataCueCustomcpp">trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMediaSessionCustomcpp">trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp">trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp">trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebKitPointCustomcpp">trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerCustomcpp">trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/ChangeLog        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-07-08  Nael Ouedraogo  &lt;nael.ouedraogo@crf.canon.fr&gt;
+
+        ExecState should be passed by reference in JS bindings generator for custom constructors
+        https://bugs.webkit.org/show_bug.cgi?id=159357
+
+        Reviewed by Youenn Fablet.
+
+        Pass ExecState as a reference instead of pointer in JS bindings
+        code for custom constructors.
+
+        * bindings/js/JSAudioContextCustom.cpp:
+        (WebCore::constructJSAudioContext):
+        * bindings/js/JSBlobCustom.cpp:
+        (WebCore::constructJSBlob):
+        * bindings/js/JSDOMFormDataCustom.cpp:
+        (WebCore::constructJSDOMFormData):
+        (WebCore::JSDOMFormData::append):
+        * bindings/js/JSDataCueCustom.cpp:
+        (WebCore::constructJSDataCue):
+        * bindings/js/JSFileCustom.cpp:
+        (WebCore::constructJSFile):
+        * bindings/js/JSHTMLElementCustom.cpp:
+        (WebCore::constructJSHTMLElement):
+        * bindings/js/JSMediaSessionCustom.cpp:
+        (WebCore::constructJSMediaSession):
+        * bindings/js/JSMutationObserverCustom.cpp:
+        (WebCore::constructJSMutationObserver):
+        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
+        (WebCore::constructJSReadableStreamController):
+        (WebCore::constructJSReadableStreamReader):
+        * bindings/js/JSWebKitPointCustom.cpp:
+        (WebCore::constructJSWebKitPoint):
+        * bindings/js/JSWorkerCustom.cpp:
+        (WebCore::constructJSWorker):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateConstructorDefinition):
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
+
</ins><span class="cx"> 2016-07-08  Olivier Blin  &lt;olivier.blin@softathome.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Expose crossOrigin attribute as a static property in HTMLMediaElement
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSAudioContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -44,33 +44,33 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSAudioContext(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSAudioContext(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx">     if (!jsConstructor)
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;AudioContext constructor callee is unavailable&quot;));
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;AudioContext constructor callee is unavailable&quot;));
</ins><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* scriptExecutionContext = jsConstructor-&gt;scriptExecutionContext();
</span><span class="cx">     if (!scriptExecutionContext)
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;AudioContext constructor script execution context is unavailable&quot;));
-        
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;AudioContext constructor script execution context is unavailable&quot;));
+
</ins><span class="cx">     if (!is&lt;Document&gt;(*scriptExecutionContext))
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;AudioContext constructor called in a script execution context which is not a document&quot;));
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;AudioContext constructor called in a script execution context which is not a document&quot;));
</ins><span class="cx"> 
</span><span class="cx">     Document&amp; document = downcast&lt;Document&gt;(*scriptExecutionContext);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;AudioContext&gt; audioContext;
</span><del>-    
-    if (!exec-&gt;argumentCount()) {
</del><ins>+
+    if (!exec.argumentCount()) {
</ins><span class="cx">         // Constructor for default AudioContext which talks to audio hardware.
</span><span class="cx">         ExceptionCode ec = 0;
</span><span class="cx">         audioContext = AudioContext::create(document, ec);
</span><span class="cx">         if (ec) {
</span><del>-            setDOMException(exec, ec);
</del><ins>+            setDOMException(&amp;exec, ec);
</ins><span class="cx">             return JSValue::encode(JSValue());
</span><span class="cx">         }
</span><span class="cx">         if (!audioContext.get())
</span><del>-            return throwVMError(exec, createSyntaxError(exec, &quot;audio resources unavailable for AudioContext construction&quot;));
</del><ins>+            return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;audio resources unavailable for AudioContext construction&quot;));
</ins><span class="cx">     } else {
</span><span class="cx"> #if ENABLE(LEGACY_WEB_AUDIO)
</span><span class="cx">         // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer.
</span><span class="lines">@@ -77,36 +77,36 @@
</span><span class="cx">         // new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
</span><span class="cx">         document.addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral(&quot;Deprecated AudioContext constructor: use OfflineAudioContext instead&quot;));
</span><span class="cx"> 
</span><del>-        if (exec-&gt;argumentCount() &lt; 3)
-            return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+        if (exec.argumentCount() &lt; 3)
+            return throwVMError(&amp;exec, createNotEnoughArgumentsError(&amp;exec));
</ins><span class="cx"> 
</span><del>-        int32_t numberOfChannels = exec-&gt;argument(0).toInt32(exec);
-        int32_t numberOfFrames = exec-&gt;argument(1).toInt32(exec);
-        float sampleRate = exec-&gt;argument(2).toFloat(exec);
-        
</del><ins>+        int32_t numberOfChannels = exec.uncheckedArgument(0).toInt32(&amp;exec);
+        int32_t numberOfFrames = exec.uncheckedArgument(1).toInt32(&amp;exec);
+        float sampleRate = exec.uncheckedArgument(2).toFloat(&amp;exec);
+
</ins><span class="cx">         if (numberOfChannels &lt;= 0 || numberOfChannels &gt; 10)
</span><del>-            return throwVMError(exec, createSyntaxError(exec, &quot;Invalid number of channels&quot;));
</del><ins>+            return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;Invalid number of channels&quot;));
</ins><span class="cx"> 
</span><span class="cx">         if (numberOfFrames &lt;= 0)
</span><del>-            return throwVMError(exec, createSyntaxError(exec, &quot;Invalid number of frames&quot;));
</del><ins>+            return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;Invalid number of frames&quot;));
</ins><span class="cx"> 
</span><span class="cx">         if (sampleRate &lt;= 0)
</span><del>-            return throwVMError(exec, createSyntaxError(exec, &quot;Invalid sample rate&quot;));
</del><ins>+            return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;Invalid sample rate&quot;));
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         ExceptionCode ec = 0;
</span><span class="cx">         audioContext = OfflineAudioContext::create(document, numberOfChannels, numberOfFrames, sampleRate, ec);
</span><span class="cx">         if (ec) {
</span><del>-            setDOMException(exec, ec);
-            return throwVMError(exec, createSyntaxError(exec, &quot;Error creating OfflineAudioContext&quot;));
</del><ins>+            setDOMException(&amp;exec, ec);
+            return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;Error creating OfflineAudioContext&quot;));
</ins><span class="cx">         }
</span><span class="cx"> #else
</span><del>-        return throwVMError(exec, createSyntaxError(exec, &quot;Illegal AudioContext constructor&quot;));
</del><ins>+        return throwVMError(&amp;exec, createSyntaxError(&amp;exec, &quot;Illegal AudioContext constructor&quot;));
</ins><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!audioContext)
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;Error creating AudioContext&quot;));
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;Error creating AudioContext&quot;));
</ins><span class="cx"> 
</span><span class="cx">     return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), AudioContext, audioContext.releaseNonNull()));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -60,20 +60,20 @@
</span><span class="cx">     return wrap(state, globalObject, blob);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx">     ScriptExecutionContext* context = jsConstructor-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;Blob constructor associated document is unavailable&quot;));
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;Blob constructor associated document is unavailable&quot;));
</ins><span class="cx"> 
</span><del>-    if (!exec-&gt;argumentCount()) {
</del><ins>+    if (!exec.argumentCount()) {
</ins><span class="cx">         return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor-&gt;globalObject(), Blob, Blob::create()));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned blobPartsLength = 0;
</span><del>-    JSObject* blobParts = toJSSequence(exec, exec-&gt;argument(0), blobPartsLength);
-    if (exec-&gt;hadException())
</del><ins>+    JSObject* blobParts = toJSSequence(&amp;exec, exec.uncheckedArgument(0), blobPartsLength);
+    if (exec.hadException())
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(blobParts);
</span><span class="cx"> 
</span><span class="lines">@@ -80,31 +80,31 @@
</span><span class="cx">     String type;
</span><span class="cx">     String endings = ASCIILiteral(&quot;transparent&quot;);
</span><span class="cx"> 
</span><del>-    if (exec-&gt;argumentCount() &gt; 1) {
-        JSValue blobPropertyBagValue = exec-&gt;argument(1);
</del><ins>+    if (exec.argumentCount() &gt; 1) {
+        JSValue blobPropertyBagValue = exec.uncheckedArgument(1);
</ins><span class="cx"> 
</span><span class="cx">         if (!blobPropertyBagValue.isObject())
</span><del>-            return throwVMTypeError(exec, &quot;Second argument of the constructor is not of type Object&quot;);
</del><ins>+            return throwVMTypeError(&amp;exec, &quot;Second argument of the constructor is not of type Object&quot;);
</ins><span class="cx"> 
</span><span class="cx">         // Given the above test, this will always yield an object.
</span><del>-        JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(exec);
</del><ins>+        JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(&amp;exec);
</ins><span class="cx"> 
</span><span class="cx">         // Create the dictionary wrapper from the initializer object.
</span><del>-        JSDictionary dictionary(exec, blobPropertyBagObject);
</del><ins>+        JSDictionary dictionary(&amp;exec, blobPropertyBagObject);
</ins><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-&gt;hadException())
</del><ins>+        if (exec.hadException())
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (containsEndings) {
</span><span class="cx">             if (endings != &quot;transparent&quot; &amp;&amp; endings != &quot;native&quot;)
</span><del>-                return throwVMTypeError(exec, &quot;The endings property must be either \&quot;transparent\&quot; or \&quot;native\&quot;&quot;);
</del><ins>+                return throwVMTypeError(&amp;exec, &quot;The endings property must be either \&quot;transparent\&quot; or \&quot;native\&quot;&quot;);
</ins><span class="cx">         }
</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-&gt;hadException())
</del><ins>+        if (exec.hadException())
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -113,8 +113,8 @@
</span><span class="cx">     BlobBuilder blobBuilder;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; blobPartsLength; ++i) {
</span><del>-        JSValue item = blobParts-&gt;get(exec, i);
-        if (exec-&gt;hadException())
</del><ins>+        JSValue item = blobParts-&gt;get(&amp;exec, i);
+        if (exec.hadException())
</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">@@ -124,8 +124,8 @@
</span><span class="cx">         else if (Blob* blob = JSBlob::toWrapped(item))
</span><span class="cx">             blobBuilder.append(blob);
</span><span class="cx">         else {
</span><del>-            String string = item.toString(exec)-&gt;value(exec);
-            if (exec-&gt;hadException())
</del><ins>+            String string = item.toWTFString(&amp;exec);
+            if (exec.hadException())
</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="trunkSourceWebCorebindingsjsJSDOMFormDataCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -46,27 +46,27 @@
</span><span class="cx">     return value.inherits(JSHTMLFormElement::info()) ? &amp;jsCast&lt;JSHTMLFormElement*&gt;(asObject(value))-&gt;wrapped() : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSDOMFormData(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSDOMFormData(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx"> 
</span><del>-    HTMLFormElement* form = toHTMLFormElementOrNull(exec-&gt;argument(0));
</del><ins>+    HTMLFormElement* form = toHTMLFormElementOrNull(exec.argument(0));
</ins><span class="cx">     auto domFormData = DOMFormData::create(form);
</span><del>-    return JSValue::encode(asObject(toJS(exec, jsConstructor-&gt;globalObject(), domFormData)));
</del><ins>+    return JSValue::encode(toJSNewlyCreated(&amp;exec, jsConstructor-&gt;globalObject(), WTFMove(domFormData)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSDOMFormData::append(ExecState&amp; state)
</del><ins>+JSValue JSDOMFormData::append(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    if (state.argumentCount() &gt;= 2) {
-        String name = state.argument(0).toString(&amp;state)-&gt;value(&amp;state);
-        JSValue value = state.argument(1);
</del><ins>+    if (exec.argumentCount() &gt;= 2) {
+        String name = exec.uncheckedArgument(0).toWTFString(&amp;exec);
+        JSValue value = exec.uncheckedArgument(1);
</ins><span class="cx">         if (value.inherits(JSBlob::info())) {
</span><span class="cx">             String filename;
</span><del>-            if (state.argumentCount() &gt;= 3 &amp;&amp; !state.argument(2).isUndefinedOrNull())
-                filename = state.argument(2).toString(&amp;state)-&gt;value(&amp;state);
</del><ins>+            if (exec.argumentCount() &gt;= 3 &amp;&amp; !exec.uncheckedArgument(2).isUndefinedOrNull())
+                filename = exec.uncheckedArgument(2).toWTFString(&amp;exec);
</ins><span class="cx">             wrapped().append(name, JSBlob::toWrapped(value), filename);
</span><span class="cx">         } else
</span><del>-            wrapped().append(name, value.toString(&amp;state)-&gt;value(&amp;state));
</del><ins>+            wrapped().append(name, value.toWTFString(&amp;exec));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return jsUndefined();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDataCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -47,61 +47,56 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSDataCue(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSDataCue(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* castedThis = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
-    if (exec-&gt;argumentCount() &lt; 3)
-        return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+    DOMConstructorObject* castedThis = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
+    if (exec.argumentCount() &lt; 3)
+        return throwVMError(&amp;exec, createNotEnoughArgumentsError(&amp;exec));
</ins><span class="cx"> 
</span><del>-    double startTime(exec-&gt;argument(0).toNumber(exec));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double startTime(exec.uncheckedArgument(0).toNumber(&amp;exec));
+    if (UNLIKELY(exec.hadException()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><del>-    double endTime(exec-&gt;argument(1).toNumber(exec));
-    if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    double endTime(exec.uncheckedArgument(1).toNumber(&amp;exec));
+    if (UNLIKELY(exec.hadException()))
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     ScriptExecutionContext* context = castedThis-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return throwConstructorDocumentUnavailableError(*exec, &quot;DataCue&quot;);
</del><ins>+        return throwConstructorDocumentUnavailableError(exec, &quot;DataCue&quot;);
</ins><span class="cx"> 
</span><span class="cx">     String type;
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>-    if (exec-&gt;argumentCount() &gt; 3) {
-        if (!exec-&gt;argument(3).isString())
-            return throwVMTypeError(exec, ASCIILiteral(&quot;Second argument of the constructor is not of type String&quot;));
-        type = exec-&gt;argument(3).getString(exec);
</del><ins>+    if (exec.argumentCount() &gt; 3) {
+        if (!exec.uncheckedArgument(3).isString())
+            return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;Second argument of the constructor is not of type String&quot;));
+        type = exec.uncheckedArgument(3).getString(&amp;exec);
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    JSValue valueArgument = exec-&gt;argument(2);
</del><ins>+    JSValue valueArgument = exec.uncheckedArgument(2);
</ins><span class="cx">     if (valueArgument.isUndefinedOrNull()) {
</span><del>-        setDOMException(exec, TypeError);
</del><ins>+        setDOMException(&amp;exec, TypeError);
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;DataCue&gt; object;
</del><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-&gt;hadException()))
</del><ins>+        if (UNLIKELY(exec.hadException()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         if (UNLIKELY(!data)) {
</span><del>-            setDOMException(exec, TypeError);
</del><ins>+            setDOMException(&amp;exec, TypeError);
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><del>-
-        object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), *data, type);
-
-        return JSValue::encode(asObject(toJS(exec, castedThis-&gt;globalObject(), object.get())));
</del><ins>+        return JSValue::encode(CREATE_DOM_WRAPPER(castedThis-&gt;globalObject(), DataCue, DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), *data, type)));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if !ENABLE(DATACUE_VALUE)
</span><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> #else
</span><del>-    object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type);
-    return JSValue::encode(asObject(toJS(exec, castedThis-&gt;globalObject(), object.get())));
</del><ins>+    return JSValue::encode(CREATE_DOM_WRAPPER(castedThis-&gt;globalObject(), DataCue,DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type)));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -40,47 +40,47 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSFile(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSFile(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    auto* constructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    auto* constructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx">     ScriptExecutionContext* context = constructor-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return throwVMError(exec, createReferenceError(exec, &quot;File constructor associated document is unavailable&quot;));
</del><ins>+        return throwVMError(&amp;exec, createReferenceError(&amp;exec, &quot;File constructor associated document is unavailable&quot;));
</ins><span class="cx"> 
</span><del>-    JSValue arg = exec-&gt;argument(0);
</del><ins>+    JSValue arg = exec.argument(0);
</ins><span class="cx">     if (arg.isUndefinedOrNull())
</span><del>-        return throwVMTypeError(exec, ASCIILiteral(&quot;First argument to File constructor must be a valid sequence, was undefined or null&quot;));
</del><ins>+        return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;First argument to File constructor must be a valid sequence, was undefined or null&quot;));
</ins><span class="cx"> 
</span><span class="cx">     unsigned blobPartsLength = 0;
</span><del>-    JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
-    if (exec-&gt;hadException())
</del><ins>+    JSObject* blobParts = toJSSequence(&amp;exec, arg, blobPartsLength);
+    if (exec.hadException())
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     ASSERT(blobParts);
</span><span class="cx"> 
</span><del>-    arg = exec-&gt;argument(1);
</del><ins>+    arg = exec.argument(1);
</ins><span class="cx">     if (arg.isUndefined())
</span><del>-        return throwVMTypeError(exec, ASCIILiteral(&quot;Second argument to File constructor must be a valid string, was undefined&quot;));
</del><ins>+        return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;Second argument to File constructor must be a valid string, was undefined&quot;));
</ins><span class="cx"> 
</span><del>-    String filename = arg.toWTFString(exec).replace('/', ':');
-    if (exec-&gt;hadException())
</del><ins>+    String filename = arg.toWTFString(&amp;exec).replace('/', ':');
+    if (exec.hadException())
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     String normalizedType;
</span><span class="cx">     Optional&lt;int64_t&gt; lastModified;
</span><span class="cx"> 
</span><del>-    arg = exec-&gt;argument(2);
</del><ins>+    arg = exec.argument(2);
</ins><span class="cx">     if (!arg.isUndefinedOrNull()) {
</span><span class="cx">         JSObject* filePropertyBagObject = arg.getObject();
</span><span class="cx">         if (!filePropertyBagObject)
</span><del>-            return throwVMTypeError(exec, ASCIILiteral(&quot;Third argument of the constructor is not of type Object&quot;));
</del><ins>+            return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;Third argument of the constructor is not of type Object&quot;));
</ins><span class="cx"> 
</span><span class="cx">         // Create the dictionary wrapper from the initializer object.
</span><del>-        JSDictionary dictionary(exec, filePropertyBagObject);
</del><ins>+        JSDictionary dictionary(&amp;exec, filePropertyBagObject);
</ins><span class="cx"> 
</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-&gt;hadException())
</del><ins>+        if (exec.hadException())
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">         normalizedType = Blob::normalizedContentType(type);
</span><span class="lines">@@ -88,7 +88,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-&gt;hadException())
</del><ins>+            if (exec.hadException())
</ins><span class="cx">                 return JSValue::encode(jsUndefined());
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx">     BlobBuilder blobBuilder;
</span><span class="cx"> 
</span><span class="cx">     for (unsigned i = 0; i &lt; blobPartsLength; ++i) {
</span><del>-        JSValue item = blobParts-&gt;get(exec, i);
-        if (exec-&gt;hadException())
</del><ins>+        JSValue item = blobParts-&gt;get(&amp;exec, i);
+        if (exec.hadException())
</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">@@ -110,8 +110,8 @@
</span><span class="cx">         else if (Blob* blob = JSBlob::toWrapped(item))
</span><span class="cx">             blobBuilder.append(blob);
</span><span class="cx">         else {
</span><del>-            String string = item.toWTFString(exec);
-            if (exec-&gt;hadException())
</del><ins>+            String string = item.toWTFString(&amp;exec);
+            if (exec.hadException())
</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="trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -38,31 +38,31 @@
</span><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSHTMLElement(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSHTMLElement(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    auto* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(state-&gt;callee());
</del><ins>+    auto* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx"> 
</span><span class="cx">     auto* context = jsConstructor-&gt;scriptExecutionContext();
</span><span class="cx">     if (!is&lt;Document&gt;(context))
</span><del>-        return throwConstructorDocumentUnavailableError(*state, &quot;HTMLElement&quot;);
</del><ins>+        return throwConstructorDocumentUnavailableError(exec, &quot;HTMLElement&quot;);
</ins><span class="cx">     auto&amp; document = downcast&lt;Document&gt;(*context);
</span><span class="cx"> 
</span><span class="cx">     auto* definitions = document.customElementDefinitions();
</span><span class="cx">     if (!definitions)
</span><del>-        return throwVMTypeError(state, &quot;new.target is not a valid custom element constructor&quot;);
</del><ins>+        return throwVMTypeError(&amp;exec, &quot;new.target is not a valid custom element constructor&quot;);
</ins><span class="cx"> 
</span><del>-    VM&amp; vm = state-&gt;vm();
-    JSValue newTargetValue = state-&gt;thisValue();
</del><ins>+    VM&amp; vm = exec.vm();
+    JSValue newTargetValue = exec.thisValue();
</ins><span class="cx">     JSObject* newTarget = newTargetValue.getObject();
</span><span class="cx">     auto* elementInterface = definitions-&gt;findInterface(newTarget);
</span><span class="cx">     if (!elementInterface)
</span><del>-        return throwVMTypeError(state, &quot;new.target does not define a custom element&quot;);
</del><ins>+        return throwVMTypeError(&amp;exec, &quot;new.target does not define a custom element&quot;);
</ins><span class="cx"> 
</span><span class="cx">     if (!elementInterface-&gt;isUpgradingElement()) {
</span><span class="cx">         auto* globalObject = jsConstructor-&gt;globalObject();
</span><span class="cx">         Structure* baseStructure = getDOMStructure&lt;JSHTMLElement&gt;(vm, *globalObject);
</span><del>-        auto* newElementStructure = InternalFunction::createSubclassStructure(state, newTargetValue, baseStructure);
-        if (UNLIKELY(state-&gt;hadException()))
</del><ins>+        auto* newElementStructure = InternalFunction::createSubclassStructure(&amp;exec, newTargetValue, baseStructure);
+        if (UNLIKELY(exec.hadException()))
</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">@@ -74,20 +74,20 @@
</span><span class="cx"> 
</span><span class="cx">     Element* elementToUpgrade = elementInterface-&gt;lastElementInConstructionStack();
</span><span class="cx">     if (!elementToUpgrade) {
</span><del>-        throwInvalidStateError(*state, &quot;Cannot instantiate a custom element inside its own constrcutor during upgrades&quot;);
</del><ins>+        throwInvalidStateError(exec, &quot;Cannot instantiate a custom element inside its own constrcutor during upgrades&quot;);
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    JSValue elementWrapperValue = toJS(state, jsConstructor-&gt;globalObject(), *elementToUpgrade);
</del><ins>+    JSValue elementWrapperValue = toJS(&amp;exec, jsConstructor-&gt;globalObject(), *elementToUpgrade);
</ins><span class="cx">     ASSERT(elementWrapperValue.isObject());
</span><span class="cx"> 
</span><del>-    JSValue newPrototype = newTarget-&gt;get(state, vm.propertyNames-&gt;prototype);
-    if (state-&gt;hadException())
</del><ins>+    JSValue newPrototype = newTarget-&gt;get(&amp;exec, vm.propertyNames-&gt;prototype);
+    if (exec.hadException())
</ins><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><span class="cx">     JSObject* elementWrapperObject = asObject(elementWrapperValue);
</span><del>-    JSObject::setPrototype(elementWrapperObject, state, newPrototype, true /* shouldThrowIfCantSet */);
-    if (state-&gt;hadException())
</del><ins>+    JSObject::setPrototype(elementWrapperObject, &amp;exec, newPrototype, true /* shouldThrowIfCantSet */);
+    if (exec.hadException())
</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="trunkSourceWebCorebindingsjsJSMediaSessionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -39,26 +39,26 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSMediaSession(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSMediaSession(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    auto* castedThis = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    auto* castedThis = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
+
</ins><span class="cx">     auto* context = castedThis-&gt;scriptExecutionContext();
</span><span class="cx">     if (!context)
</span><del>-        return throwConstructorDocumentUnavailableError(*exec, &quot;MediaSession&quot;);
</del><ins>+        return throwConstructorDocumentUnavailableError(exec, &quot;MediaSession&quot;);
</ins><span class="cx"> 
</span><span class="cx">     String kind;
</span><del>-    if (exec-&gt;argumentCount() &gt; 0) {
-        JSString* kindString = exec-&gt;argument(0).toString(exec);
-        if (UNLIKELY(exec-&gt;hadException()))
</del><ins>+    if (exec.argumentCount() &gt; 0) {
+        JSString* kindString = exec.uncheckedArgument(0).toString(&amp;exec);
+        if (UNLIKELY(exec.hadException()))
</ins><span class="cx">             return JSValue::encode(jsUndefined());
</span><del>-        kind = kindString-&gt;value(exec);
</del><ins>+        kind = kindString-&gt;value(&amp;exec);
</ins><span class="cx">         if (kind != &quot;content&quot; &amp;&amp; kind != &quot;transient&quot; &amp;&amp; kind != &quot;transient-solo&quot; &amp;&amp; kind != &quot;ambient&quot;)
</span><del>-            return throwArgumentMustBeEnumError(*exec, 0, &quot;kind&quot;, &quot;MediaSession&quot;, nullptr, &quot;\&quot;content\&quot;, \&quot;transient\&quot;, \&quot;transient-solo\&quot;, \&quot;ambient\&quot;&quot;);
</del><ins>+            return throwArgumentMustBeEnumError(exec, 0, &quot;kind&quot;, &quot;MediaSession&quot;, nullptr, &quot;\&quot;content\&quot;, \&quot;transient\&quot;, \&quot;transient-solo\&quot;, \&quot;ambient\&quot;&quot;);
</ins><span class="cx">     } else
</span><span class="cx">         kind = &quot;content&quot;;
</span><span class="cx"> 
</span><del>-    auto object = MediaSession::create(*context, kind);
-    return JSValue::encode(asObject(toJS(exec, castedThis-&gt;globalObject(), object)));
</del><ins>+    return JSValue::encode(toJSNewlyCreated(&amp;exec, castedThis-&gt;globalObject(), MediaSession::create(*context, kind)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -42,19 +42,19 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    if (exec-&gt;argumentCount() &lt; 1)
-        return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+    if (exec.argumentCount() &lt; 1)
+        return throwVMError(&amp;exec, createNotEnoughArgumentsError(&amp;exec));
</ins><span class="cx"> 
</span><del>-    JSObject* object = exec-&gt;argument(0).getObject();
</del><ins>+    JSObject* object = exec.uncheckedArgument(0).getObject();
</ins><span class="cx">     CallData callData;
</span><span class="cx">     if (!object || object-&gt;methodTable()-&gt;getCallData(object, callData) == CallType::None)
</span><del>-        return throwVMTypeError(exec, ASCIILiteral(&quot;Callback argument must be a function&quot;));
</del><ins>+        return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;Callback argument must be a function&quot;));
</ins><span class="cx"> 
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx">     auto callback = JSMutationCallback::create(object, jsConstructor-&gt;globalObject());
</span><del>-    JSObject* jsObserver = asObject(toJS(exec, jsConstructor-&gt;globalObject(), MutationObserver::create(WTFMove(callback))));
</del><ins>+    JSObject* jsObserver = asObject(toJSNewlyCreated(&amp;exec, jsConstructor-&gt;globalObject(), MutationObserver::create(WTFMove(callback))));
</ins><span class="cx">     PrivateName propertyName;
</span><span class="cx">     jsObserver-&gt;putDirect(jsConstructor-&gt;globalObject()-&gt;vm(), propertyName, object);
</span><span class="cx">     return JSValue::encode(jsObserver);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -34,23 +34,23 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> // Public JS ReadableStreamReder and ReadableStreamController constructor callbacks.
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamController(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamController(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    return throwVMTypeError(state, ASCIILiteral(&quot;ReadableStreamController constructor should not be called directly&quot;));
</del><ins>+    return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;ReadableStreamController constructor should not be called directly&quot;));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    JSReadableStream* stream = jsDynamicCast&lt;JSReadableStream*&gt;(state-&gt;argument(0));
</del><ins>+    JSReadableStream* stream = jsDynamicCast&lt;JSReadableStream*&gt;(exec.argument(0));
</ins><span class="cx">     if (!stream)
</span><del>-        return throwVMTypeError(state, ASCIILiteral(&quot;ReadableStreamReader constructor parameter is not a ReadableStream&quot;));
</del><ins>+        return throwVMTypeError(&amp;exec, ASCIILiteral(&quot;ReadableStreamReader constructor parameter is not a ReadableStream&quot;));
</ins><span class="cx"> 
</span><del>-    JSValue jsFunction = stream-&gt;get(state, Identifier::fromString(state, &quot;getReader&quot;));
</del><ins>+    JSValue jsFunction = stream-&gt;get(&amp;exec, Identifier::fromString(&amp;exec, &quot;getReader&quot;));
</ins><span class="cx"> 
</span><span class="cx">     CallData callData;
</span><span class="cx">     CallType callType = getCallData(jsFunction, callData);
</span><span class="cx">     MarkedArgumentBuffer noArguments;
</span><del>-    return JSValue::encode(call(state, jsFunction, callType, callData, stream, noArguments));
</del><ins>+    return JSValue::encode(call(&amp;exec, jsFunction, callType, callData, stream, noArguments));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Private JS ReadableStreamReder and ReadableStreamController constructors.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebKitPointCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -32,21 +32,21 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSWebKitPoint(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSWebKitPoint(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx"> 
</span><span class="cx">     float x = 0;
</span><span class="cx">     float y = 0;
</span><del>-    if (exec-&gt;argumentCount() &gt;= 2) {
-        x = static_cast&lt;float&gt;(exec-&gt;argument(0).toNumber(exec));
-        y = static_cast&lt;float&gt;(exec-&gt;argument(1).toNumber(exec));
</del><ins>+    if (exec.argumentCount() &gt;= 2) {
+        x = static_cast&lt;float&gt;(exec.uncheckedArgument(0).toNumber(&amp;exec));
+        y = static_cast&lt;float&gt;(exec.uncheckedArgument(1).toNumber(&amp;exec));
</ins><span class="cx">         if (std::isnan(x))
</span><span class="cx">             x = 0;
</span><span class="cx">         if (std::isnan(y))
</span><span class="cx">             y = 0;
</span><span class="cx">     }
</span><del>-    return JSValue::encode(asObject(toJS(exec, jsConstructor-&gt;globalObject(), WebKitPoint::create(x, y))));
</del><ins>+    return JSValue::encode(asObject(toJSNewlyCreated(&amp;exec, jsConstructor-&gt;globalObject(), WebKitPoint::create(x, y))));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -45,29 +45,29 @@
</span><span class="cx">     return handlePostMessage(state, &amp;wrapped());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSWorker(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSWorker(ExecState&amp; exec)
</ins><span class="cx"> {
</span><del>-    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec-&gt;callee());
</del><ins>+    DOMConstructorObject* jsConstructor = jsCast&lt;DOMConstructorObject*&gt;(exec.callee());
</ins><span class="cx"> 
</span><del>-    if (!exec-&gt;argumentCount())
-        return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+    if (!exec.argumentCount())
+        return throwVMError(&amp;exec, createNotEnoughArgumentsError(&amp;exec));
</ins><span class="cx"> 
</span><del>-    String scriptURL = exec-&gt;argument(0).toString(exec)-&gt;value(exec);
-    if (exec-&gt;hadException())
</del><ins>+    String scriptURL = exec.uncheckedArgument(0).toWTFString(&amp;exec);
+    if (exec.hadException())
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx"> 
</span><del>-    // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject. 
-    DOMWindow&amp; window = asJSDOMWindow(exec-&gt;lexicalGlobalObject())-&gt;wrapped();
</del><ins>+    // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
+    DOMWindow&amp; window = asJSDOMWindow(exec.lexicalGlobalObject())-&gt;wrapped();
</ins><span class="cx"> 
</span><span class="cx">     ExceptionCode ec = 0;
</span><span class="cx">     ASSERT(window.document());
</span><span class="cx">     RefPtr&lt;Worker&gt; worker = Worker::create(*window.document(), scriptURL, ec);
</span><span class="cx">     if (ec) {
</span><del>-        setDOMException(exec, ec);
</del><ins>+        setDOMException(&amp;exec, ec);
</ins><span class="cx">         return JSValue::encode(JSValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return JSValue::encode(asObject(toJS(exec, jsConstructor-&gt;globalObject(), *worker)));
</del><ins>+    return JSValue::encode(asObject(toJSNewlyCreated(&amp;exec, jsConstructor-&gt;globalObject(), WTFMove(worker))));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -1534,7 +1534,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (HasCustomConstructor($interface)) {
</span><span class="cx">         push(@headerContent, &quot;// Custom constructor\n&quot;);
</span><del>-        push(@headerContent, &quot;JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState*);\n\n&quot;);
</del><ins>+        push(@headerContent, &quot;JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState&amp;);\n\n&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($codeGenerator-&gt;IsConstructorTemplate($interface, &quot;Event&quot;)) {
</span><span class="lines">@@ -5089,9 +5089,10 @@
</span><span class="cx"> 
</span><span class="cx"> END
</span><span class="cx">          } elsif ($interface-&gt;extendedAttributes-&gt;{&quot;CustomConstructor&quot;}) {
</span><del>-            push(@$outputArray, &quot;template&lt;&gt; JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* state)\n&quot;);
</del><ins>+            push(@$outputArray, &quot;template&lt;&gt; JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* exec)\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;{\n&quot;);
</span><del>-            push(@$outputArray, &quot;    return construct${className}(state);\n&quot;);
</del><ins>+            push(@$outputArray, &quot;    ASSERT(exec);\n&quot;);
+            push(@$outputArray, &quot;    return construct${className}(*exec);\n&quot;);
</ins><span class="cx">             push(@$outputArray, &quot;}\n\n&quot;);
</span><span class="cx">          } elsif (!HasCustomConstructor($interface) &amp;&amp; (!$interface-&gt;extendedAttributes-&gt;{&quot;NamedConstructor&quot;} || $generatingNamedConstructor)) {
</span><span class="cx">             if ($function-&gt;{overloadedIndex} &amp;&amp; $function-&gt;{overloadedIndex} &gt; 0) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -62,9 +62,10 @@
</span><span class="cx"> 
</span><span class="cx"> typedef JSDOMConstructor&lt;JSTestCustomConstructorWithNoInterfaceObject&gt; JSTestCustomConstructorWithNoInterfaceObjectConstructor;
</span><span class="cx"> 
</span><del>-template&lt;&gt; JSC::EncodedJSValue JSC_HOST_CALL JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct(JSC::ExecState* state)
</del><ins>+template&lt;&gt; JSC::EncodedJSValue JSC_HOST_CALL JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct(JSC::ExecState* exec)
</ins><span class="cx"> {
</span><del>-    return constructJSTestCustomConstructorWithNoInterfaceObject(state);
</del><ins>+    ASSERT(exec);
+    return constructJSTestCustomConstructorWithNoInterfaceObject(*exec);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt; JSValue JSTestCustomConstructorWithNoInterfaceObjectConstructor::prototypeForStructure(JSC::VM&amp; vm, const JSDOMGlobalObject&amp; globalObject)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr&lt;TestCustomConstructorWithNoInterfaceObject&gt;&amp;&amp; impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</span><span class="cx"> 
</span><span class="cx"> // Custom constructor
</span><del>-JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState*);
</del><ins>+JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState&amp;);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>