<!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>[183769] trunk/Source/JavaScriptCore</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/183769">183769</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2015-05-04 13:42:10 -0700 (Mon, 04 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Optimize WeakBlock's &quot;reap&quot; and &quot;visit&quot; operations.
&lt;https://webkit.org/b/144585&gt;

Reviewed by Geoffrey Garen.

WeakBlock was using Heap::isLive(void*) to determine the liveness of weak pointees.
That function was really written with conservative roots marking in mind, and will do a bunch
of sanity and bounds checks.

For weaks, we know that the pointer will have been a valid cell pointer into a block
of appropriate cell size, so we can skip a lot of the checks.

We now keep a pointer to the MarkedBlock in each WeakBlock. That way we no longer have to do
MarkedBlock::blockFor() for every single cell when iterating.

Note that a WeakBlock's MarkedBlock pointer becomes null when we detach a logically empty
WeakBlock from its WeakSet and transfer ownership to Heap. At that point, the block will never
be pointing to any live cells, and the only operation that will run on the block is sweep().

Finally, MarkedBlock allows liveness queries in three states: Marked, Retired, and Allocated.
In Allocated state, all cells are reported as live. This state will reset to Marked on next GC.
This patch uses that knowledge to avoid branching on the MarkedBlock's state for every cell.

This is a ~3x speedup of visit() and a ~2x speedup of reap() on Dromaeo/dom-modify, netting
what looks like a 1% speedup locally.

* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::MarkedBlock): Pass *this to the WeakSet's ctor.

* heap/MarkedBlock.h:
(JSC::MarkedBlock::isMarkedOrNewlyAllocated): Added, stripped-down version of isLive() when the
block's state is known to be either Marked or Retired.

(JSC::MarkedBlock::isAllocated): Added, tells WeakBlock it's okay to skip reap/visit since isLive()
would report that all cells are live anyway.

* heap/WeakBlock.cpp:
(JSC::WeakBlock::create):
(JSC::WeakBlock::WeakBlock): Stash a MarkedBlock* on each WeakBlock.

(JSC::WeakBlock::visit):
(JSC::WeakBlock::reap): Optimized these two to avoid a bunch of pointer arithmetic and branches.

* heap/WeakBlock.h:
(JSC::WeakBlock::disconnectMarkedBlock): Added.
* heap/WeakSet.cpp:
(JSC::WeakSet::sweep): Call the above when removing a WeakBlock from WeakSet and transferring
ownership to Heap until it can die peacefully.

(JSC::WeakSet::addAllocator):
* heap/WeakSet.h:
(JSC::WeakSet::WeakSet): Give WeakSet a MarkedBlock&amp; for passing on to WeakBlocks.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMarkedBlockcpp">trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMarkedBlockh">trunk/Source/JavaScriptCore/heap/MarkedBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapWeakBlockcpp">trunk/Source/JavaScriptCore/heap/WeakBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapWeakBlockh">trunk/Source/JavaScriptCore/heap/WeakBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapWeakSetcpp">trunk/Source/JavaScriptCore/heap/WeakSet.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapWeakSeth">trunk/Source/JavaScriptCore/heap/WeakSet.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2015-05-04  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Optimize WeakBlock's &quot;reap&quot; and &quot;visit&quot; operations.
+        &lt;https://webkit.org/b/144585&gt;
+
+        Reviewed by Geoffrey Garen.
+
+        WeakBlock was using Heap::isLive(void*) to determine the liveness of weak pointees.
+        That function was really written with conservative roots marking in mind, and will do a bunch
+        of sanity and bounds checks.
+
+        For weaks, we know that the pointer will have been a valid cell pointer into a block
+        of appropriate cell size, so we can skip a lot of the checks.
+
+        We now keep a pointer to the MarkedBlock in each WeakBlock. That way we no longer have to do
+        MarkedBlock::blockFor() for every single cell when iterating.
+
+        Note that a WeakBlock's MarkedBlock pointer becomes null when we detach a logically empty
+        WeakBlock from its WeakSet and transfer ownership to Heap. At that point, the block will never
+        be pointing to any live cells, and the only operation that will run on the block is sweep().
+
+        Finally, MarkedBlock allows liveness queries in three states: Marked, Retired, and Allocated.
+        In Allocated state, all cells are reported as live. This state will reset to Marked on next GC.
+        This patch uses that knowledge to avoid branching on the MarkedBlock's state for every cell.
+
+        This is a ~3x speedup of visit() and a ~2x speedup of reap() on Dromaeo/dom-modify, netting
+        what looks like a 1% speedup locally.
+
+        * heap/MarkedBlock.cpp:
+        (JSC::MarkedBlock::MarkedBlock): Pass *this to the WeakSet's ctor.
+
+        * heap/MarkedBlock.h:
+        (JSC::MarkedBlock::isMarkedOrNewlyAllocated): Added, stripped-down version of isLive() when the
+        block's state is known to be either Marked or Retired.
+
+        (JSC::MarkedBlock::isAllocated): Added, tells WeakBlock it's okay to skip reap/visit since isLive()
+        would report that all cells are live anyway.
+
+        * heap/WeakBlock.cpp:
+        (JSC::WeakBlock::create):
+        (JSC::WeakBlock::WeakBlock): Stash a MarkedBlock* on each WeakBlock.
+
+        (JSC::WeakBlock::visit):
+        (JSC::WeakBlock::reap): Optimized these two to avoid a bunch of pointer arithmetic and branches.
+
+        * heap/WeakBlock.h:
+        (JSC::WeakBlock::disconnectMarkedBlock): Added.
+        * heap/WeakSet.cpp:
+        (JSC::WeakSet::sweep): Call the above when removing a WeakBlock from WeakSet and transferring
+        ownership to Heap until it can die peacefully.
+
+        (JSC::WeakSet::addAllocator):
+        * heap/WeakSet.h:
+        (JSC::WeakSet::WeakSet): Give WeakSet a MarkedBlock&amp; for passing on to WeakBlocks.
+
</ins><span class="cx"> 2015-05-04  Basile Clement  &lt;basile_clement@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allocation sinking is prohibiting the creation of phis between a Phantom object and its materialization
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx">     , m_needsDestruction(needsDestruction)
</span><span class="cx">     , m_allocator(allocator)
</span><span class="cx">     , m_state(New) // All cells start out unmarked.
</span><del>-    , m_weakSet(allocator-&gt;heap()-&gt;vm())
</del><ins>+    , m_weakSet(allocator-&gt;heap()-&gt;vm(), *this)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(allocator);
</span><span class="cx">     HEAP_LOG_BLOCK_STATE_TRANSITION(this);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedBlock.h (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedBlock.h        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/MarkedBlock.h        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx">         bool testAndSetMarked(const void*);
</span><span class="cx">         bool isLive(const JSCell*);
</span><span class="cx">         bool isLiveCell(const void*);
</span><ins>+        bool isMarkedOrNewlyAllocated(const JSCell*);
</ins><span class="cx">         void setMarked(const void*);
</span><span class="cx">         void clearMarked(const void*);
</span><span class="cx"> 
</span><span class="lines">@@ -176,6 +177,7 @@
</span><span class="cx">         void setNewlyAllocated(const void*);
</span><span class="cx">         void clearNewlyAllocated(const void*);
</span><span class="cx"> 
</span><ins>+        bool isAllocated() const;
</ins><span class="cx">         bool needsSweeping();
</span><span class="cx">         void didRetireBlock(const FreeList&amp;);
</span><span class="cx">         void willRemoveBlock();
</span><span class="lines">@@ -410,6 +412,12 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    inline bool MarkedBlock::isMarkedOrNewlyAllocated(const JSCell* cell)
+    {
+        ASSERT(m_state == Retired || m_state == Marked);
+        return m_marks.get(atomNumber(cell)) || (m_newlyAllocated &amp;&amp; isNewlyAllocated(cell));
+    }
+
</ins><span class="cx">     inline bool MarkedBlock::isLive(const JSCell* cell)
</span><span class="cx">     {
</span><span class="cx">         switch (m_state) {
</span><span class="lines">@@ -418,7 +426,7 @@
</span><span class="cx"> 
</span><span class="cx">         case Retired:
</span><span class="cx">         case Marked:
</span><del>-            return m_marks.get(atomNumber(cell)) || (m_newlyAllocated &amp;&amp; isNewlyAllocated(cell));
</del><ins>+            return isMarkedOrNewlyAllocated(cell);
</ins><span class="cx"> 
</span><span class="cx">         case New:
</span><span class="cx">         case FreeListed:
</span><span class="lines">@@ -486,6 +494,11 @@
</span><span class="cx">         return m_state == Marked;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    inline bool MarkedBlock::isAllocated() const
+    {
+        return m_state == Allocated;
+    }
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakBlock.cpp (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakBlock.cpp        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/WeakBlock.cpp        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -34,9 +34,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-WeakBlock* WeakBlock::create()
</del><ins>+WeakBlock* WeakBlock::create(MarkedBlock&amp; markedBlock)
</ins><span class="cx"> {
</span><del>-    return new (NotNull, fastMalloc(blockSize)) WeakBlock();
</del><ins>+    return new (NotNull, fastMalloc(blockSize)) WeakBlock(markedBlock);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WeakBlock::destroy(WeakBlock* block)
</span><span class="lines">@@ -45,8 +45,9 @@
</span><span class="cx">     fastFree(block);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WeakBlock::WeakBlock()
</del><ins>+WeakBlock::WeakBlock(MarkedBlock&amp; markedBlock)
</ins><span class="cx">     : DoublyLinkedListNode&lt;WeakBlock&gt;()
</span><ins>+    , m_markedBlock(&amp;markedBlock)
</ins><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; weakImplCount(); ++i) {
</span><span class="cx">         WeakImpl* weakImpl = &amp;weakImpls()[i];
</span><span class="lines">@@ -98,6 +99,12 @@
</span><span class="cx">     if (isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here.
+    ASSERT(m_markedBlock);
+
+    if (m_markedBlock-&gt;isAllocated())
+        return;
+
</ins><span class="cx">     SlotVisitor&amp; visitor = heapRootVisitor.visitor();
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; weakImplCount(); ++i) {
</span><span class="lines">@@ -106,7 +113,7 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         const JSValue&amp; jsValue = weakImpl-&gt;jsValue();
</span><del>-        if (Heap::isLive(jsValue.asCell()))
</del><ins>+        if (m_markedBlock-&gt;isMarkedOrNewlyAllocated(jsValue.asCell()))
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         WeakHandleOwner* weakHandleOwner = weakImpl-&gt;weakHandleOwner();
</span><span class="lines">@@ -126,12 +133,18 @@
</span><span class="cx">     if (isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    // If this WeakBlock doesn't belong to a MarkedBlock, we won't even be here.
+    ASSERT(m_markedBlock);
+
+    if (m_markedBlock-&gt;isAllocated())
+        return;
+
</ins><span class="cx">     for (size_t i = 0; i &lt; weakImplCount(); ++i) {
</span><span class="cx">         WeakImpl* weakImpl = &amp;weakImpls()[i];
</span><span class="cx">         if (weakImpl-&gt;state() &gt; WeakImpl::Dead)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (Heap::isLive(weakImpl-&gt;jsValue().asCell())) {
</del><ins>+        if (m_markedBlock-&gt;isMarkedOrNewlyAllocated(weakImpl-&gt;jsValue().asCell())) {
</ins><span class="cx">             ASSERT(weakImpl-&gt;state() == WeakImpl::Live);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakBlock.h (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakBlock.h        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/WeakBlock.h        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> class HeapRootVisitor;
</span><span class="cx"> class JSValue;
</span><ins>+class MarkedBlock;
</ins><span class="cx"> class WeakHandleOwner;
</span><span class="cx"> 
</span><span class="cx"> class WeakBlock : public DoublyLinkedListNode&lt;WeakBlock&gt; {
</span><span class="lines">@@ -55,7 +56,7 @@
</span><span class="cx">         FreeCell* freeList { nullptr };
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    static WeakBlock* create();
</del><ins>+    static WeakBlock* create(MarkedBlock&amp;);
</ins><span class="cx">     static void destroy(WeakBlock*);
</span><span class="cx"> 
</span><span class="cx">     static WeakImpl* asWeakImpl(FreeCell*);
</span><span class="lines">@@ -70,17 +71,19 @@
</span><span class="cx">     void reap();
</span><span class="cx"> 
</span><span class="cx">     void lastChanceToFinalize();
</span><ins>+    void disconnectMarkedBlock() { m_markedBlock = nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     static FreeCell* asFreeCell(WeakImpl*);
</span><span class="cx"> 
</span><del>-    WeakBlock();
</del><ins>+    explicit WeakBlock(MarkedBlock&amp;);
</ins><span class="cx">     WeakImpl* firstWeakImpl();
</span><span class="cx">     void finalize(WeakImpl*);
</span><span class="cx">     WeakImpl* weakImpls();
</span><span class="cx">     size_t weakImplCount();
</span><span class="cx">     void addToFreeList(FreeCell**, WeakImpl*);
</span><span class="cx"> 
</span><ins>+    MarkedBlock* m_markedBlock;
</ins><span class="cx">     WeakBlock* m_prev;
</span><span class="cx">     WeakBlock* m_next;
</span><span class="cx">     SweepResult m_sweepResult;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakSetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakSet.cpp (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakSet.cpp        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/WeakSet.cpp        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">             // to the Heap so we don't pin down the entire 64kB MarkedBlock.
</span><span class="cx">             m_blocks.remove(block);
</span><span class="cx">             heap()-&gt;addLogicallyEmptyWeakBlock(block);
</span><ins>+            block-&gt;disconnectMarkedBlock();
</ins><span class="cx">         }
</span><span class="cx">         block = nextBlock;
</span><span class="cx">     }
</span><span class="lines">@@ -84,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx"> WeakBlock::FreeCell* WeakSet::addAllocator()
</span><span class="cx"> {
</span><del>-    WeakBlock* block = WeakBlock::create();
</del><ins>+    WeakBlock* block = WeakBlock::create(m_markedBlock);
</ins><span class="cx">     heap()-&gt;didAllocate(WeakBlock::blockSize);
</span><span class="cx">     m_blocks.append(block);
</span><span class="cx">     WeakBlock::SweepResult sweepResult = block-&gt;takeSweepResult();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakSet.h (183768 => 183769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakSet.h        2015-05-04 20:36:31 UTC (rev 183768)
+++ trunk/Source/JavaScriptCore/heap/WeakSet.h        2015-05-04 20:42:10 UTC (rev 183769)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class Heap;
</span><ins>+class MarkedBlock;
</ins><span class="cx"> class WeakImpl;
</span><span class="cx"> 
</span><span class="cx"> class WeakSet {
</span><span class="lines">@@ -40,7 +41,7 @@
</span><span class="cx">     static WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
</span><span class="cx">     static void deallocate(WeakImpl*);
</span><span class="cx"> 
</span><del>-    WeakSet(VM*);
</del><ins>+    WeakSet(VM*, MarkedBlock&amp;);
</ins><span class="cx">     ~WeakSet();
</span><span class="cx">     void lastChanceToFinalize();
</span><span class="cx"> 
</span><span class="lines">@@ -65,12 +66,14 @@
</span><span class="cx">     WeakBlock* m_nextAllocator;
</span><span class="cx">     DoublyLinkedList&lt;WeakBlock&gt; m_blocks;
</span><span class="cx">     VM* m_vm;
</span><ins>+    MarkedBlock&amp; m_markedBlock;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline WeakSet::WeakSet(VM* vm)
</del><ins>+inline WeakSet::WeakSet(VM* vm, MarkedBlock&amp; markedBlock)
</ins><span class="cx">     : m_allocator(0)
</span><span class="cx">     , m_nextAllocator(0)
</span><span class="cx">     , m_vm(vm)
</span><ins>+    , m_markedBlock(markedBlock)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>