<!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>[183523] 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/183523">183523</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2015-04-28 19:12:31 -0700 (Tue, 28 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Simplify DOM wrapper destruction, don't deref() in finalizers.
&lt;https://webkit.org/b/144183&gt;

Reviewed by Darin Adler.

DOM JS bindings had two mechanisms to call deref() on the WebCore object,
once through a weak finalizer, and once through the JSCell's regular destructor.

That was once believed to be an optimization, but these days the finalizer will
run just moments before the destructor anyway, all in the same call stack.
And more importantly, the finalizer is not guaranteed to run, for instance in the
case where a Weak is assigned to after going dead, but before the WeakBlock
has been swept by the incremental sweeper.

Simplify this by just removing the deref() from the generated finalizers.
This makes it easier to reason about DOM wrapper destruction, and eliminates
the awkward time window  where a DOM wrapper could have a null impl().

We could spend more time on figuring out a way to have finalizers manage the
destruction of these wrappers, but that would require fundamental changes to
our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
However the risk:reward ratio does not seem justified at this point in time.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/js/JSCSSValueCustom.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
(WebCore::JSTestActiveDOMObjectOwner::finalize):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetterOwner::finalize):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::~JSTestEventConstructor):
(WebCore::JSTestEventConstructorOwner::finalize):
* bindings/scripts/test/JS/JSTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::~JSTestEventTarget):
(WebCore::JSTestEventTargetOwner::finalize):
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::~JSTestException):
(WebCore::JSTestExceptionOwner::finalize):
* bindings/scripts/test/JS/JSTestException.h:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
(WebCore::JSTestGenerateIsReachableOwner::finalize):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::~JSTestInterface):
(WebCore::JSTestInterfaceOwner::finalize):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
(WebCore::JSTestMediaQueryListListenerOwner::finalize):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
(WebCore::JSTestNamedConstructorOwner::finalize):
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministic::~JSTestNondeterministic):
(WebCore::JSTestNondeterministicOwner::finalize):
* bindings/scripts/test/JS/JSTestNondeterministic.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::~JSTestObj):
(WebCore::JSTestObjOwner::finalize):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
(WebCore::JSTestOverloadedConstructorsOwner::finalize):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
(WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::~JSTestTypedefs):
(WebCore::JSTestTypedefsOwner::finalize):
* bindings/scripts/test/JS/JSTestTypedefs.h:
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattribute::~JSattribute):
(WebCore::JSattributeOwner::finalize):
* bindings/scripts/test/JS/JSattribute.h:
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonly::~JSreadonly):
(WebCore::JSreadonlyOwner::finalize):
* bindings/scripts/test/JS/JSreadonly.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCSSValueCustomcpp">trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestExceptioncpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachablecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenercpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSattributecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSattributeh">trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSreadonlycpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSreadonlyh">trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/ChangeLog        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -1,3 +1,98 @@
</span><ins>+2015-04-28  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Simplify DOM wrapper destruction, don't deref() in finalizers.
+        &lt;https://webkit.org/b/144183&gt;
+
+        Reviewed by Darin Adler.
+
+        DOM JS bindings had two mechanisms to call deref() on the WebCore object,
+        once through a weak finalizer, and once through the JSCell's regular destructor.
+
+        That was once believed to be an optimization, but these days the finalizer will
+        run just moments before the destructor anyway, all in the same call stack.
+        And more importantly, the finalizer is not guaranteed to run, for instance in the
+        case where a Weak is assigned to after going dead, but before the WeakBlock
+        has been swept by the incremental sweeper.
+
+        Simplify this by just removing the deref() from the generated finalizers.
+        This makes it easier to reason about DOM wrapper destruction, and eliminates
+        the awkward time window  where a DOM wrapper could have a null impl().
+
+        We could spend more time on figuring out a way to have finalizers manage the
+        destruction of these wrappers, but that would require fundamental changes to
+        our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
+        destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
+        However the risk:reward ratio does not seem justified at this point in time.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/js/JSCSSValueCustom.cpp:
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
+        (WebCore::JSTestActiveDOMObjectOwner::finalize):
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+        (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
+        (WebCore::JSTestCustomNamedGetterOwner::finalize):
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
+        (WebCore::JSTestEventConstructorOwner::finalize):
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::JSTestEventTarget::~JSTestEventTarget):
+        (WebCore::JSTestEventTargetOwner::finalize):
+        * bindings/scripts/test/JS/JSTestEventTarget.h:
+        * bindings/scripts/test/JS/JSTestException.cpp:
+        (WebCore::JSTestException::~JSTestException):
+        (WebCore::JSTestExceptionOwner::finalize):
+        * bindings/scripts/test/JS/JSTestException.h:
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
+        (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
+        (WebCore::JSTestGenerateIsReachableOwner::finalize):
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterface::~JSTestInterface):
+        (WebCore::JSTestInterfaceOwner::finalize):
+        * bindings/scripts/test/JS/JSTestInterface.h:
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
+        (WebCore::JSTestMediaQueryListListenerOwner::finalize):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
+        (WebCore::JSTestNamedConstructorOwner::finalize):
+        * bindings/scripts/test/JS/JSTestNamedConstructor.h:
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
+        (WebCore::JSTestNondeterministicOwner::finalize):
+        * bindings/scripts/test/JS/JSTestNondeterministic.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObj::~JSTestObj):
+        (WebCore::JSTestObjOwner::finalize):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
+        (WebCore::JSTestOverloadedConstructorsOwner::finalize):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
+        (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::JSTestTypedefs::~JSTestTypedefs):
+        (WebCore::JSTestTypedefsOwner::finalize):
+        * bindings/scripts/test/JS/JSTestTypedefs.h:
+        * bindings/scripts/test/JS/JSattribute.cpp:
+        (WebCore::JSattribute::~JSattribute):
+        (WebCore::JSattributeOwner::finalize):
+        * bindings/scripts/test/JS/JSattribute.h:
+        * bindings/scripts/test/JS/JSreadonly.cpp:
+        (WebCore::JSreadonly::~JSreadonly):
+        (WebCore::JSreadonlyOwner::finalize):
+        * bindings/scripts/test/JS/JSreadonly.h:
+
</ins><span class="cx"> 2015-04-28  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build WinCairo without cygwin.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCSSValueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/js/JSCSSValueCustom.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx">     DOMWrapperWorld&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     world.m_cssValueRoots.remove(&amp;jsCSSValue-&gt;impl());
</span><span class="cx">     uncacheWrapper(world, &amp;jsCSSValue-&gt;impl(), jsCSSValue);
</span><del>-    jsCSSValue-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue toJS(ExecState*, JSDOMGlobalObject* globalObject, CSSValue* value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -1086,14 +1086,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!$hasParent) {
</span><span class="cx">         push(@headerContent, &quot;    $implType&amp; impl() const { return *m_impl; }\n&quot;);
</span><del>-        push(@headerContent, &quot;    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }\n\n&quot;);
-        push(@headerContent, &quot;    void releaseImplIfNotNull()\n&quot;);
-        push(@headerContent, &quot;    {\n&quot;);
-        push(@headerContent, &quot;        if (m_impl) {\n&quot;);
-        push(@headerContent, &quot;            m_impl-&gt;deref();\n&quot;);
-        push(@headerContent, &quot;            m_impl = 0;\n&quot;);
-        push(@headerContent, &quot;        }\n&quot;);
-        push(@headerContent, &quot;    }\n\n&quot;);
</del><ins>+        push(@headerContent, &quot;    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }\n\n&quot;);
</ins><span class="cx">         push(@headerContent, &quot;private:\n&quot;);
</span><span class="cx">         push(@headerContent, &quot;    $implType* m_impl;\n&quot;);
</span><span class="cx">     } else {
</span><span class="lines">@@ -2077,23 +2070,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!$hasParent) {
</span><del>-        # FIXME: This destroy function should not be necessary, as 
-        # a finalizer should be called for each DOM object wrapper.
-        # However, that seems not to be the case, so this has been
-        # added back to avoid leaking while we figure out why the
-        # finalizers are not always getting called. The work tracking
-        # the finalizer issue is being tracked in http://webkit.org/b/75451
</del><span class="cx">         push(@implContent, &quot;void ${className}::destroy(JSC::JSCell* cell)\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    ${className}* thisObject = static_cast&lt;${className}*&gt;(cell);\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    thisObject-&gt;${className}::~${className}();\n&quot;);
</span><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx"> 
</span><del>-        # We also need a destructor for the allocateCell to work properly with the destructor-free part of the heap.
-        # Otherwise, these destroy functions/destructors won't get called.
</del><span class="cx">         push(@implContent, &quot;${className}::~${className}()\n&quot;);
</span><span class="cx">         push(@implContent, &quot;{\n&quot;);
</span><del>-        push(@implContent, &quot;    releaseImplIfNotNull();\n&quot;);
</del><ins>+        push(@implContent, &quot;    releaseImpl();\n&quot;);
</ins><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -3004,7 +2989,6 @@
</span><span class="cx">         push(@implContent, &quot;    auto* js${interfaceName} = jsCast&lt;JS${interfaceName}*&gt;(handle.slot()-&gt;asCell());\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);\n&quot;);
</span><span class="cx">         push(@implContent, &quot;    uncacheWrapper(world, &amp;js${interfaceName}-&gt;impl(), js${interfaceName});\n&quot;);
</span><del>-        push(@implContent, &quot;    js${interfaceName}-&gt;releaseImpl();\n&quot;);
</del><span class="cx">         push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -163,7 +163,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestActiveDOMObject::~JSTestActiveDOMObject()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestActiveDOMObject::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -250,7 +250,6 @@
</span><span class="cx">     auto* jsTestActiveDOMObject = jsCast&lt;JSTestActiveDOMObject*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestActiveDOMObject-&gt;impl(), jsTestActiveDOMObject);
</span><del>-    jsTestActiveDOMObject-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestActiveDOMObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -53,16 +53,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestActiveDOMObject&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestActiveDOMObject* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGettercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -156,7 +156,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestCustomNamedGetter::~JSTestCustomNamedGetter()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestCustomNamedGetter::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -224,7 +224,6 @@
</span><span class="cx">     auto* jsTestCustomNamedGetter = jsCast&lt;JSTestCustomNamedGetter*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestCustomNamedGetter-&gt;impl(), jsTestCustomNamedGetter);
</span><del>-    jsTestCustomNamedGetter-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomNamedGetterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -54,16 +54,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestCustomNamedGetter&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestCustomNamedGetter* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestEventConstructor::~JSTestEventConstructor()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestEventConstructorAttr1(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -253,7 +253,6 @@
</span><span class="cx">     auto* jsTestEventConstructor = jsCast&lt;JSTestEventConstructor*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestEventConstructor-&gt;impl(), jsTestEventConstructor);
</span><del>-    jsTestEventConstructor-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -54,16 +54,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestEventConstructor&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestEventConstructor* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestEventTarget::~JSTestEventTarget()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestEventTarget::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -326,7 +326,6 @@
</span><span class="cx">     auto* jsTestEventTarget = jsCast&lt;JSTestEventTarget*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestEventTarget-&gt;impl(), jsTestEventTarget);
</span><del>-    jsTestEventTarget-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestEventTargeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -58,16 +58,8 @@
</span><span class="cx">     static void visitChildren(JSCell*, JSC::SlotVisitor&amp;);
</span><span class="cx"> 
</span><span class="cx">     TestEventTarget&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestEventTarget* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestExceptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestException::~JSTestException()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestException::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -200,7 +200,6 @@
</span><span class="cx">     auto* jsTestException = jsCast&lt;JSTestException*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestException-&gt;impl(), jsTestException);
</span><del>-    jsTestException-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestExceptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestException.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -54,16 +54,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestException&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestException* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestGenerateIsReachable::~JSTestGenerateIsReachable()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestGenerateIsReachableConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
</span><span class="lines">@@ -172,7 +172,6 @@
</span><span class="cx">     auto* jsTestGenerateIsReachable = jsCast&lt;JSTestGenerateIsReachable*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestGenerateIsReachable-&gt;impl(), jsTestGenerateIsReachable);
</span><del>-    jsTestGenerateIsReachable-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGenerateIsReachableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -52,16 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestGenerateIsReachable&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestGenerateIsReachable* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -434,7 +434,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestInterface::~JSTestInterface()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestInterface::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -951,7 +951,6 @@
</span><span class="cx">     auto* jsTestInterface = jsCast&lt;JSTestInterface*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestInterface-&gt;impl(), jsTestInterface);
</span><del>-    jsTestInterface-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface* impl)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -80,16 +80,8 @@
</span><span class="cx">     JSC::JSValue supplementalMethod3(JSC::ExecState*);
</span><span class="cx"> #endif
</span><span class="cx">     TestInterface&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestInterface* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestMediaQueryListListenerConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
</span><span class="lines">@@ -188,7 +188,6 @@
</span><span class="cx">     auto* jsTestMediaQueryListListener = jsCast&lt;JSTestMediaQueryListListener*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestMediaQueryListListener-&gt;impl(), jsTestMediaQueryListListener);
</span><del>-    jsTestMediaQueryListListener-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestMediaQueryListListenerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -52,16 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestMediaQueryListListener&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestMediaQueryListListener* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestNamedConstructor::~JSTestNamedConstructor()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestNamedConstructorConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
</span><span class="lines">@@ -242,7 +242,6 @@
</span><span class="cx">     auto* jsTestNamedConstructor = jsCast&lt;JSTestNamedConstructor*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestNamedConstructor-&gt;impl(), jsTestNamedConstructor);
</span><del>-    jsTestNamedConstructor-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNamedConstructorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -53,16 +53,8 @@
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     static JSC::JSValue getNamedConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestNamedConstructor&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestNamedConstructor* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministiccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestNondeterministic::~JSTestNondeterministic()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -495,7 +495,6 @@
</span><span class="cx">     auto* jsTestNondeterministic = jsCast&lt;JSTestNondeterministic*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestNondeterministic-&gt;impl(), jsTestNondeterministic);
</span><del>-    jsTestNondeterministic-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestNondeterministich"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -52,16 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestNondeterministic&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestNondeterministic* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -682,7 +682,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestObj::~JSTestObj()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestObj::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -4430,7 +4430,6 @@
</span><span class="cx">     auto* jsTestObj = jsCast&lt;JSTestObj*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestObj-&gt;impl(), jsTestObj);
</span><del>-    jsTestObj-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -66,16 +66,8 @@
</span><span class="cx">     JSC::JSValue customMethodWithArgs(JSC::ExecState*);
</span><span class="cx">     static JSC::JSValue classMethod2(JSC::ExecState*);
</span><span class="cx">     TestObj&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestObj* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -216,7 +216,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestOverloadedConstructors::~JSTestOverloadedConstructors()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestOverloadedConstructorsConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
</span><span class="lines">@@ -244,7 +244,6 @@
</span><span class="cx">     auto* jsTestOverloadedConstructors = jsCast&lt;JSTestOverloadedConstructors*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestOverloadedConstructors-&gt;impl(), jsTestOverloadedConstructors);
</span><del>-    jsTestOverloadedConstructors-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestOverloadedConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -52,16 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestOverloadedConstructors&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestOverloadedConstructors* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -323,7 +323,6 @@
</span><span class="cx">     auto* jsTestSerializedScriptValueInterface = jsCast&lt;JSTestSerializedScriptValueInterface*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestSerializedScriptValueInterface-&gt;impl(), jsTestSerializedScriptValueInterface);
</span><del>-    jsTestSerializedScriptValueInterface-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestSerializedScriptValueInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -58,16 +58,8 @@
</span><span class="cx">     static void visitChildren(JSCell*, JSC::SlotVisitor&amp;);
</span><span class="cx"> 
</span><span class="cx">     TestSerializedScriptValueInterface&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestSerializedScriptValueInterface* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSTestTypedefs::~JSTestTypedefs()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool JSTestTypedefs::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot&amp; slot)
</span><span class="lines">@@ -730,7 +730,6 @@
</span><span class="cx">     auto* jsTestTypedefs = jsCast&lt;JSTestTypedefs*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsTestTypedefs-&gt;impl(), jsTestTypedefs);
</span><del>-    jsTestTypedefs-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestTypedefsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -53,16 +53,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     TestTypedefs&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     TestTypedefs* m_impl;
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSattributecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSattribute::~JSattribute()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsattributeReadonly(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="lines">@@ -185,7 +185,6 @@
</span><span class="cx">     auto* jsattribute = jsCast&lt;JSattribute*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsattribute-&gt;impl(), jsattribute);
</span><del>-    jsattribute-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(BINDING_INTEGRITY)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSattributeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSattribute.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -53,16 +53,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     attribute&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     attribute* m_impl;
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSreadonlycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSreadonly::~JSreadonly()
</span><span class="cx"> {
</span><del>-    releaseImplIfNotNull();
</del><ins>+    releaseImpl();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue jsreadonlyConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
</span><span class="lines">@@ -163,7 +163,6 @@
</span><span class="cx">     auto* jsreadonly = jsCast&lt;JSreadonly*&gt;(handle.slot()-&gt;asCell());
</span><span class="cx">     auto&amp; world = *static_cast&lt;DOMWrapperWorld*&gt;(context);
</span><span class="cx">     uncacheWrapper(world, &amp;jsreadonly-&gt;impl(), jsreadonly);
</span><del>-    jsreadonly-&gt;releaseImpl();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, readonly* impl)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSreadonlyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h (183522 => 183523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2015-04-29 01:24:47 UTC (rev 183522)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSreadonly.h        2015-04-29 02:12:31 UTC (rev 183523)
</span><span class="lines">@@ -52,16 +52,8 @@
</span><span class="cx"> 
</span><span class="cx">     static JSC::JSValue getConstructor(JSC::VM&amp;, JSC::JSGlobalObject*);
</span><span class="cx">     readonly&amp; impl() const { return *m_impl; }
</span><del>-    void releaseImpl() { m_impl-&gt;deref(); m_impl = 0; }
</del><ins>+    void releaseImpl() { std::exchange(m_impl, nullptr)-&gt;deref(); }
</ins><span class="cx"> 
</span><del>-    void releaseImplIfNotNull()
-    {
-        if (m_impl) {
-            m_impl-&gt;deref();
-            m_impl = 0;
-        }
-    }
-
</del><span class="cx"> private:
</span><span class="cx">     readonly* m_impl;
</span><span class="cx"> protected:
</span></span></pre>
</div>
</div>

</body>
</html>