<!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>[190739] trunk/Source</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Clean up Marked classes
https://bugs.webkit.org/show_bug.cgi?id=149853

Reviewed by Darin Adler.

Source/JavaScriptCore:

* heap/Heap.h:
Move include here where it is really needed.

* heap/HeapStatistics.cpp:
* heap/HeapStatistics.h:
Simplify includes.

* heap/MarkedAllocator.h:
Add missing copyright header.

* heap/MarkedBlock.cpp:
* heap/MarkedBlock.h:
(JSC::MarkedBlock::needsSweeping):
Remove unused constants. Add some static asserts. Add some `const` ness.

* heap/MarkedSpace.h:
(JSC::MarkedSpace::isIterating):
Update comments to better reflect actual values.
Remove unimplemented method (moved to Heap).

* heap/MarkedSpace.cpp:
(JSC::Free::Free):
(JSC::Free::operator()):
(JSC::Free::returnValue): Deleted.
(JSC::FreeOrShrink::FreeOrShrink):
(JSC::FreeOrShrink::operator()):
(JSC::MarkedSpace::~MarkedSpace):
(JSC::MarkedSpace::shrink):
Replace conditional Functor that was not using return value
with simplified targeted VoidFunctors.

(JSC::Shrink::operator()): Deleted.
Remove unused functor.

* heap/WeakBlock.cpp:
* heap/WeakBlock.h:
* runtime/Options.cpp:
Remove dead code.

Source/WTF:

* wtf/PageBlock.h:
Remove duplicate using statement.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapStatisticscpp">trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapStatisticsh">trunk/Source/JavaScriptCore/heap/HeapStatistics.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMarkedAllocatorh">trunk/Source/JavaScriptCore/heap/MarkedAllocator.h</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="#trunkSourceJavaScriptCoreheapMarkedSpacecpp">trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapMarkedSpaceh">trunk/Source/JavaScriptCore/heap/MarkedSpace.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="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionscpp">trunk/Source/JavaScriptCore/runtime/Options.cpp</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPageBlockh">trunk/Source/WTF/wtf/PageBlock.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-10-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Clean up Marked classes
+        https://bugs.webkit.org/show_bug.cgi?id=149853
+
+        Reviewed by Darin Adler.
+
+        * heap/Heap.h:
+        Move include here where it is really needed.
+
+        * heap/HeapStatistics.cpp:
+        * heap/HeapStatistics.h:
+        Simplify includes.
+
+        * heap/MarkedAllocator.h:
+        Add missing copyright header.
+
+        * heap/MarkedBlock.cpp:
+        * heap/MarkedBlock.h:
+        (JSC::MarkedBlock::needsSweeping):
+        Remove unused constants. Add some static asserts. Add some `const` ness.
+
+        * heap/MarkedSpace.h:
+        (JSC::MarkedSpace::isIterating):
+        Update comments to better reflect actual values.
+        Remove unimplemented method (moved to Heap).
+
+        * heap/MarkedSpace.cpp:
+        (JSC::Free::Free):
+        (JSC::Free::operator()):
+        (JSC::Free::returnValue): Deleted.
+        (JSC::FreeOrShrink::FreeOrShrink):
+        (JSC::FreeOrShrink::operator()):
+        (JSC::MarkedSpace::~MarkedSpace):
+        (JSC::MarkedSpace::shrink):
+        Replace conditional Functor that was not using return value
+        with simplified targeted VoidFunctors.
+
+        (JSC::Shrink::operator()): Deleted.
+        Remove unused functor.
+
+        * heap/WeakBlock.cpp:
+        * heap/WeakBlock.h:
+        * runtime/Options.cpp:
+        Remove dead code.
+
</ins><span class="cx"> 2015-10-08  Saam barati  &lt;sbarati@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         We should be able to inline getter/setter calls inside an inline cache even when the SpillRegistersMode is NeedsToSpill
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;HeapOperation.h&quot;
</span><span class="cx"> #include &quot;JITStubRoutineSet.h&quot;
</span><span class="cx"> #include &quot;ListableHandler.h&quot;
</span><ins>+#include &quot;MachineStackMarker.h&quot;
</ins><span class="cx"> #include &quot;MarkedAllocator.h&quot;
</span><span class="cx"> #include &quot;MarkedBlock.h&quot;
</span><span class="cx"> #include &quot;MarkedBlockSet.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -32,12 +32,13 @@
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;Options.h&quot;
</span><span class="cx"> #include &lt;stdlib.h&gt;
</span><ins>+#include &lt;wtf/CurrentTime.h&gt;
+#include &lt;wtf/DataLog.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+
</ins><span class="cx"> #if OS(UNIX)
</span><span class="cx"> #include &lt;sys/resource.h&gt;
</span><span class="cx"> #endif
</span><del>-#include &lt;wtf/CurrentTime.h&gt;
-#include &lt;wtf/DataLog.h&gt;
-#include &lt;wtf/Deque.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapStatisticsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapStatistics.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapStatistics.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/HeapStatistics.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #define HeapStatistics_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSExportMacros.h&quot;
</span><del>-#include &lt;wtf/Deque.h&gt;
</del><ins>+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -43,10 +43,6 @@
</span><span class="cx"> 
</span><span class="cx">     static void showObjectStatistics(Heap*);
</span><span class="cx"> 
</span><del>-    static const size_t KB = 1024;
-    static const size_t MB = 1024 * KB;
-    static const size_t GB = 1024 * MB;
-
</del><span class="cx"> private:
</span><span class="cx">     static void logStatistics();
</span><span class="cx">     static Vector&lt;double&gt;* s_pauseTimeStarts;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedAllocatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedAllocator.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedAllocator.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/MarkedAllocator.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+/*
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
</ins><span class="cx"> #ifndef MarkedAllocator_h
</span><span class="cx"> #define MarkedAllocator_h
</span><span class="cx"> 
</span><span class="lines">@@ -10,10 +35,6 @@
</span><span class="cx"> class MarkedSpace;
</span><span class="cx"> class LLIntOffsetsExtractor;
</span><span class="cx"> 
</span><del>-namespace DFG {
-class SpeculativeJIT;
-}
-
</del><span class="cx"> class MarkedAllocator {
</span><span class="cx">     friend class LLIntOffsetsExtractor;
</span><span class="cx"> 
</span><span class="lines">@@ -145,4 +166,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><del>-#endif
</del><ins>+#endif // MarkedAllocator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;MarkedBlock.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;IncrementalSweeper.h&quot;
</del><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="cx"> #include &quot;JSDestructibleObject.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedBlock.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedBlock.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/MarkedBlock.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include &lt;wtf/DoublyLinkedList.h&gt;
</span><span class="cx"> #include &lt;wtf/HashFunctions.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><del>-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> // Set to log state transitions of blocks.
</span><span class="cx"> #define HEAP_LOG_BLOCK_STATE_TRANSITIONS 0
</span><span class="lines">@@ -54,8 +53,6 @@
</span><span class="cx"> 
</span><span class="cx">     typedef uintptr_t Bits;
</span><span class="cx"> 
</span><del>-    static const size_t MB = 1024 * 1024;
-    
</del><span class="cx">     bool isZapped(const JSCell*);
</span><span class="cx">     
</span><span class="cx">     // A marked block is a page-aligned container for heap-allocated objects.
</span><span class="lines">@@ -72,14 +69,13 @@
</span><span class="cx">         friend struct VerifyMarkedOrRetired;
</span><span class="cx">     public:
</span><span class="cx">         static const size_t atomSize = 16; // bytes
</span><del>-        static const size_t atomShiftAmount = 4; // log_2(atomSize) FIXME: Change atomSize to 16.
</del><span class="cx">         static const size_t blockSize = 16 * KB;
</span><span class="cx">         static const size_t blockMask = ~(blockSize - 1); // blockSize must be a power of two.
</span><span class="cx"> 
</span><span class="cx">         static const size_t atomsPerBlock = blockSize / atomSize;
</span><del>-        static const size_t atomMask = atomsPerBlock - 1;
</del><span class="cx"> 
</span><del>-        static const size_t markByteShiftAmount = 3; // log_2(word size for m_marks) FIXME: Change word size for m_marks to uint8_t.
</del><ins>+        static_assert(!(MarkedBlock::atomSize &amp; (MarkedBlock::atomSize - 1)), &quot;MarkedBlock::atomSize must be a power of two.&quot;);
+        static_assert(!(MarkedBlock::blockSize &amp; (MarkedBlock::blockSize - 1)), &quot;MarkedBlock::blockSize must be a power of two.&quot;);
</ins><span class="cx"> 
</span><span class="cx">         struct FreeCell {
</span><span class="cx">             FreeCell* next;
</span><span class="lines">@@ -168,7 +164,7 @@
</span><span class="cx">         void clearNewlyAllocated(const void*);
</span><span class="cx"> 
</span><span class="cx">         bool isAllocated() const;
</span><del>-        bool needsSweeping();
</del><ins>+        bool needsSweeping() const;
</ins><span class="cx">         void didRetireBlock(const FreeList&amp;);
</span><span class="cx">         void willRemoveBlock();
</span><span class="cx"> 
</span><span class="lines">@@ -177,7 +173,7 @@
</span><span class="cx">         template &lt;typename Functor&gt; IterationStatus forEachDeadCell(Functor&amp;);
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        static const size_t atomAlignmentMask = atomSize - 1; // atomSize must be a power of two.
</del><ins>+        static const size_t atomAlignmentMask = atomSize - 1;
</ins><span class="cx"> 
</span><span class="cx">         enum BlockState { New, FreeListed, Allocated, Marked, Retired };
</span><span class="cx">         template&lt;bool callDestructors&gt; FreeList sweepHelper(SweepMode = SweepOnly);
</span><span class="lines">@@ -442,7 +438,7 @@
</span><span class="cx">         return IterationStatus::Continue;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    inline bool MarkedBlock::needsSweeping()
</del><ins>+    inline bool MarkedBlock::needsSweeping() const
</ins><span class="cx">     {
</span><span class="cx">         return m_state == Marked;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedSpacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -22,50 +22,25 @@
</span><span class="cx"> #include &quot;MarkedSpace.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IncrementalSweeper.h&quot;
</span><del>-#include &quot;JSGlobalObject.h&quot;
-#include &quot;JSLock.h&quot;
</del><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class Structure;
</del><ins>+struct Free : MarkedBlock::VoidFunctor {
+    Free(MarkedSpace&amp; space) : m_markedSpace(space) { }
+    void operator()(MarkedBlock* block) { m_markedSpace.freeBlock(block); }
+private:
+    MarkedSpace&amp; m_markedSpace;
+};
</ins><span class="cx"> 
</span><del>-class Free {
-public:
-    typedef MarkedBlock* ReturnType;
-
-    enum FreeMode { FreeOrShrink, FreeAll };
-
-    Free(FreeMode, MarkedSpace*);
-    void operator()(MarkedBlock*);
-    ReturnType returnValue();
-    
</del><ins>+struct FreeOrShrink : MarkedBlock::VoidFunctor {
+    FreeOrShrink(MarkedSpace&amp; space) : m_markedSpace(space) { }
+    void operator()(MarkedBlock* block) { m_markedSpace.freeOrShrinkBlock(block); }
</ins><span class="cx"> private:
</span><del>-    FreeMode m_freeMode;
-    MarkedSpace* m_markedSpace;
-    DoublyLinkedList&lt;MarkedBlock&gt; m_blocks;
</del><ins>+    MarkedSpace&amp; m_markedSpace;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline Free::Free(FreeMode freeMode, MarkedSpace* newSpace)
-    : m_freeMode(freeMode)
-    , m_markedSpace(newSpace)
-{
-}
-
-inline void Free::operator()(MarkedBlock* block)
-{
-    if (m_freeMode == FreeOrShrink)
-        m_markedSpace-&gt;freeOrShrinkBlock(block);
-    else
-        m_markedSpace-&gt;freeBlock(block);
-}
-
-inline Free::ReturnType Free::returnValue()
-{
-    return m_blocks.head();
-}
-
</del><span class="cx"> struct VisitWeakSet : MarkedBlock::VoidFunctor {
</span><span class="cx">     VisitWeakSet(HeapRootVisitor&amp; heapRootVisitor) : m_heapRootVisitor(heapRootVisitor) { }
</span><span class="cx">     void operator()(MarkedBlock* block) { block-&gt;visitWeakSet(m_heapRootVisitor); }
</span><span class="lines">@@ -98,7 +73,7 @@
</span><span class="cx"> 
</span><span class="cx"> MarkedSpace::~MarkedSpace()
</span><span class="cx"> {
</span><del>-    Free free(Free::FreeAll, this);
</del><ins>+    Free free(*this);
</ins><span class="cx">     forEachBlock(free);
</span><span class="cx">     ASSERT(!m_blocks.set().size());
</span><span class="cx"> }
</span><span class="lines">@@ -247,13 +222,9 @@
</span><span class="cx">     freeBlock(block);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-struct Shrink : MarkedBlock::VoidFunctor {
-    void operator()(MarkedBlock* block) { block-&gt;shrink(); }
-};
-
</del><span class="cx"> void MarkedSpace::shrink()
</span><span class="cx"> {
</span><del>-    Free freeOrShrink(Free::FreeOrShrink, this);
</del><ins>+    FreeOrShrink freeOrShrink(*this);
</ins><span class="cx">     forEachBlock(freeOrShrink);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapMarkedSpaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/MarkedSpace.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/MarkedSpace.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/MarkedSpace.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -22,13 +22,10 @@
</span><span class="cx"> #ifndef MarkedSpace_h
</span><span class="cx"> #define MarkedSpace_h
</span><span class="cx"> 
</span><del>-#include &quot;MachineStackMarker.h&quot;
</del><span class="cx"> #include &quot;MarkedAllocator.h&quot;
</span><span class="cx"> #include &quot;MarkedBlock.h&quot;
</span><span class="cx"> #include &quot;MarkedBlockSet.h&quot;
</span><span class="cx"> #include &lt;array&gt;
</span><del>-#include &lt;wtf/Bitmap.h&gt;
-#include &lt;wtf/DoublyLinkedList.h&gt;
</del><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="lines">@@ -38,11 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> class Heap;
</span><span class="cx"> class HeapIterationScope;
</span><del>-class JSCell;
</del><span class="cx"> class LiveObjectIterator;
</span><span class="cx"> class LLIntOffsetsExtractor;
</span><del>-class WeakGCHandle;
-class SlotVisitor;
</del><span class="cx"> 
</span><span class="cx"> struct ClearMarks : MarkedBlock::VoidFunctor {
</span><span class="cx">     void operator()(MarkedBlock* block)
</span><span class="lines">@@ -74,12 +68,12 @@
</span><span class="cx"> class MarkedSpace {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(MarkedSpace);
</span><span class="cx"> public:
</span><del>-    // [ 32... 128 ]
</del><ins>+    // [ 16 ... 128 ]
</ins><span class="cx">     static const size_t preciseStep = MarkedBlock::atomSize;
</span><span class="cx">     static const size_t preciseCutoff = 128;
</span><span class="cx">     static const size_t preciseCount = preciseCutoff / preciseStep;
</span><span class="cx"> 
</span><del>-    // [ 1024... blockSize ]
</del><ins>+    // [ 256 ... blockSize/2 ]
</ins><span class="cx">     static const size_t impreciseStep = 2 * preciseCutoff;
</span><span class="cx">     static const size_t impreciseCutoff = MarkedBlock::blockSize / 2;
</span><span class="cx">     static const size_t impreciseCount = impreciseCutoff / impreciseStep;
</span><span class="lines">@@ -110,21 +104,21 @@
</span><span class="cx">     MarkedBlockSet&amp; blocks() { return m_blocks; }
</span><span class="cx"> 
</span><span class="cx">     void willStartIterating();
</span><del>-    bool isIterating() { return m_isIterating; }
</del><ins>+    bool isIterating() const { return m_isIterating; }
</ins><span class="cx">     void didFinishIterating();
</span><span class="cx"> 
</span><span class="cx">     void stopAllocating();
</span><span class="cx">     void resumeAllocating(); // If we just stopped allocation but we didn't do a collection, we need to resume allocation.
</span><span class="cx"> 
</span><span class="cx">     typedef HashSet&lt;MarkedBlock*&gt;::iterator BlockIterator;
</span><del>-    
</del><ins>+
</ins><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachLiveCell(HeapIterationScope&amp;, Functor&amp;);
</span><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachLiveCell(HeapIterationScope&amp;);
</span><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachDeadCell(HeapIterationScope&amp;, Functor&amp;);
</span><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachDeadCell(HeapIterationScope&amp;);
</span><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachBlock(Functor&amp;);
</span><span class="cx">     template&lt;typename Functor&gt; typename Functor::ReturnType forEachBlock();
</span><del>-    
</del><ins>+
</ins><span class="cx">     void shrink();
</span><span class="cx">     void freeBlock(MarkedBlock*);
</span><span class="cx">     void freeOrShrinkBlock(MarkedBlock*);
</span><span class="lines">@@ -143,10 +137,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool isPagedOut(double deadline);
</span><span class="cx"> 
</span><del>-#if USE(CF)
-    template&lt;typename T&gt; void releaseSoon(RetainPtr&lt;T&gt;&amp;&amp;);
-#endif
-
</del><span class="cx">     const Vector&lt;MarkedBlock*&gt;&amp; blocksWithNewObjects() const { return m_blocksWithNewObjects; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakBlock.cpp (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakBlock.cpp        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/WeakBlock.cpp        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -28,9 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Heap.h&quot;
</span><span class="cx"> #include &quot;HeapRootVisitor.h&quot;
</span><ins>+#include &quot;JSCInlines.h&quot;
</ins><span class="cx"> #include &quot;JSObject.h&quot;
</span><del>-#include &quot;JSCInlines.h&quot;
-#include &quot;Structure.h&quot;
</del><ins>+#include &quot;WeakHandleOwner.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapWeakBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/WeakBlock.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/WeakBlock.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/heap/WeakBlock.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -26,8 +26,6 @@
</span><span class="cx"> #ifndef WeakBlock_h
</span><span class="cx"> #define WeakBlock_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/DoublyLinkedList.h&gt;
-#include &quot;WeakHandleOwner.h&quot;
</del><span class="cx"> #include &quot;WeakImpl.h&quot;
</span><span class="cx"> #include &lt;wtf/DoublyLinkedList.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="lines">@@ -35,9 +33,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class HeapRootVisitor;
</span><del>-class JSValue;
</del><span class="cx"> class MarkedBlock;
</span><del>-class WeakHandleOwner;
</del><span class="cx"> 
</span><span class="cx"> class WeakBlock : public DoublyLinkedListNode&lt;WeakBlock&gt; {
</span><span class="cx"> public:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -369,9 +369,6 @@
</span><span class="cx"> 
</span><span class="cx"> const MarkedBlockSize = 16 * 1024
</span><span class="cx"> const MarkedBlockMask = ~(MarkedBlockSize - 1)
</span><del>-# Constants for checking mark bits.
-const AtomNumberShift = 3
-const BitMapWordShift = 4
</del><span class="cx"> 
</span><span class="cx"> # Allocation constants
</span><span class="cx"> if JSVALUE64
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.cpp (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.cpp        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/JavaScriptCore/runtime/Options.cpp        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Options.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;HeapStatistics.h&quot;
</del><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="lines">@@ -36,15 +35,10 @@
</span><span class="cx"> #include &lt;wtf/ASCIICType.h&gt;
</span><span class="cx"> #include &lt;wtf/DataLog.h&gt;
</span><span class="cx"> #include &lt;wtf/NumberOfCores.h&gt;
</span><del>-#include &lt;wtf/PageBlock.h&gt;
</del><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/StringExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><del>-#if OS(DARWIN)
-#include &lt;sys/sysctl.h&gt;
-#endif
-
</del><span class="cx"> #if OS(WINDOWS)
</span><span class="cx"> #include &quot;MacroAssemblerX86.h&quot;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/WTF/ChangeLog        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2015-10-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Clean up Marked classes
+        https://bugs.webkit.org/show_bug.cgi?id=149853
+
+        Reviewed by Darin Adler.
+
+        * wtf/PageBlock.h:
+        Remove duplicate using statement.
+
+2015-10-08  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Remove PageReservation.h clang fixme that has been fixed for a while
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=149908
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWTFwtfPageBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PageBlock.h (190738 => 190739)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PageBlock.h        2015-10-08 20:17:32 UTC (rev 190738)
+++ trunk/Source/WTF/wtf/PageBlock.h        2015-10-08 20:19:02 UTC (rev 190739)
</span><span class="lines">@@ -82,7 +82,6 @@
</span><span class="cx"> 
</span><span class="cx"> using WTF::pageSize;
</span><span class="cx"> using WTF::isPageAligned;
</span><del>-using WTF::isPageAligned;
</del><span class="cx"> using WTF::isPowerOfTwo;
</span><span class="cx"> 
</span><span class="cx"> #endif // PageBlock_h
</span></span></pre>
</div>
</div>

</body>
</html>