<!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>[165926] 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/165926">165926</a></dd>
<dt>Author</dt> <dd>mhahnenberg@apple.com</dd>
<dt>Date</dt> <dd>2014-03-19 15:21:51 -0700 (Wed, 19 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>GC timer should intelligently choose between EdenCollections and FullCollections
https://bugs.webkit.org/show_bug.cgi?id=128261

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer 
always does FullCollections. To reduce the impact of the GC timer on the system this patch
changes Heap so that it has two timers, one for each type of collection. The FullCollection
timer is notified at the end of EdenCollections how much the Heap has grown since the last 
FullCollection and when somebody notifies the Heap of abandoned memory (which wouldn't be 
detected by an EdenCollection).

* heap/GCActivityCallback.cpp:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::doWork):
(JSC::FullGCActivityCallback::FullGCActivityCallback):
(JSC::FullGCActivityCallback::doCollection):
(JSC::EdenGCActivityCallback::EdenGCActivityCallback):
(JSC::EdenGCActivityCallback::doCollection):
(JSC::GCActivityCallback::scheduleTimer):
(JSC::GCActivityCallback::cancelTimer):
(JSC::GCActivityCallback::didAllocate):
(JSC::GCActivityCallback::willCollect):
(JSC::GCActivityCallback::cancel):
* heap/GCActivityCallback.h:
(JSC::GCActivityCallback::GCActivityCallback):
(JSC::GCActivityCallback::createFullTimer):
(JSC::GCActivityCallback::createEdenTimer):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::didAbandon):
(JSC::Heap::willStartCollection):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::setFullActivityCallback):
(JSC::Heap::setEdenActivityCallback):
(JSC::Heap::fullActivityCallback):
(JSC::Heap::edenActivityCallback):
(JSC::Heap::setGarbageCollectionTimerEnabled):
(JSC::Heap::didAllocate):
* heap/Heap.h:
* heap/HeapTimer.cpp:
(JSC::HeapTimer::timerDidFire):

Source/WebCore: 

No new tests.

* platform/ios/WebSafeGCActivityCallbackIOS.h: Update WebSafeGCActivityCallback
appropriately for the introduction of another type of GCActivityCallback.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreGNUmakefilelistam">trunk/Source/JavaScriptCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCActivityCallbackcpp">trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/GCActivityCallback.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapOperationh">trunk/Source/JavaScriptCore/heap/HeapOperation.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapStatisticscpp">trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapTimercpp">trunk/Source/JavaScriptCore/heap/HeapTimer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionsh">trunk/Source/JavaScriptCore/runtime/Options.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebSafeGCActivityCallbackIOSh">trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreheapEdenGCActivityCallbackcpp">trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapEdenGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapFullGCActivityCallbackcpp">trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapFullGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -215,6 +215,8 @@
</span><span class="cx">     heap/CopiedSpace.cpp
</span><span class="cx">     heap/CopyVisitor.cpp
</span><span class="cx">     heap/DeferGC.cpp
</span><ins>+    heap/EdenGCActivityCallback.cpp
+    heap/FullGCActivityCallback.cpp
</ins><span class="cx">     heap/GCActivityCallback.cpp
</span><span class="cx">     heap/GCThread.cpp
</span><span class="cx">     heap/GCThreadSharedData.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -1,3 +1,131 @@
</span><ins>+2014-03-13  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        GC timer should intelligently choose between EdenCollections and FullCollections
+        https://bugs.webkit.org/show_bug.cgi?id=128261
+
+        Reviewed by Geoffrey Garen.
+
+        Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer 
+        always does FullCollections. To reduce the impact of the GC timer on the system this patch
+        changes Heap so that it has two timers, one for each type of collection. The FullCollection
+        timer is notified at the end of EdenCollections how much the Heap has grown since the last 
+        FullCollection and when somebody notifies the Heap of abandoned memory (which wouldn't be 
+        detected by an EdenCollection).
+
+        * heap/GCActivityCallback.cpp:
+        (JSC::GCActivityCallback::GCActivityCallback):
+        (JSC::GCActivityCallback::doWork):
+        (JSC::FullGCActivityCallback::FullGCActivityCallback):
+        (JSC::FullGCActivityCallback::doCollection):
+        (JSC::EdenGCActivityCallback::EdenGCActivityCallback):
+        (JSC::EdenGCActivityCallback::doCollection):
+        (JSC::GCActivityCallback::scheduleTimer):
+        (JSC::GCActivityCallback::cancelTimer):
+        (JSC::GCActivityCallback::didAllocate):
+        (JSC::GCActivityCallback::willCollect):
+        (JSC::GCActivityCallback::cancel):
+        * heap/GCActivityCallback.h:
+        (JSC::GCActivityCallback::GCActivityCallback):
+        (JSC::GCActivityCallback::createFullTimer):
+        (JSC::GCActivityCallback::createEdenTimer):
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::didAbandon):
+        (JSC::Heap::willStartCollection):
+        (JSC::Heap::updateAllocationLimits):
+        (JSC::Heap::setFullActivityCallback):
+        (JSC::Heap::setEdenActivityCallback):
+        (JSC::Heap::fullActivityCallback):
+        (JSC::Heap::edenActivityCallback):
+        (JSC::Heap::setGarbageCollectionTimerEnabled):
+        (JSC::Heap::didAllocate):
+        * heap/Heap.h:
+        * heap/HeapTimer.cpp:
+        (JSC::HeapTimer::timerDidFire):
+
+&lt;&lt;&lt;&lt;&lt;&lt;&lt; .mine
+2014-03-18  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        GC timer should intelligently choose between EdenCollections and FullCollections
+        https://bugs.webkit.org/show_bug.cgi?id=128261
+
+        Reviewed by Geoffrey Garen.
+
+        Most of the GCs while browsing the web are due to the GC timer. Currently the GC timer 
+        always does FullCollections. To reduce the impact of the GC timer on the system this patch
+        changes Heap so that it has two timers, one for each type of collection. The FullCollection
+        timer is notified at the end of EdenCollections how much the Heap has grown since the last 
+        FullCollection and when somebody notifies the Heap of abandoned memory (which usually wouldn't 
+        be detected by an EdenCollection).
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * heap/EdenGCActivityCallback.cpp: Added.
+        (JSC::EdenGCActivityCallback::EdenGCActivityCallback):
+        (JSC::EdenGCActivityCallback::doCollection):
+        (JSC::EdenGCActivityCallback::lastGCLength):
+        (JSC::EdenGCActivityCallback::deathRate):
+        (JSC::EdenGCActivityCallback::gcTimeSlice):
+        * heap/EdenGCActivityCallback.h: Added.
+        (JSC::EdenGCActivityCallback::EdenGCActivityCallback):
+        (JSC::GCActivityCallback::createEdenTimer):
+        * heap/FullGCActivityCallback.cpp: Added.
+        (JSC::FullGCActivityCallback::FullGCActivityCallback):
+        (JSC::FullGCActivityCallback::doCollection):
+        (JSC::FullGCActivityCallback::lastGCLength):
+        (JSC::FullGCActivityCallback::deathRate):
+        (JSC::FullGCActivityCallback::gcTimeSlice):
+        * heap/FullGCActivityCallback.h: Added.
+        (JSC::FullGCActivityCallback::FullGCActivityCallback):
+        (JSC::GCActivityCallback::createFullTimer):
+        * heap/GCActivityCallback.cpp:
+        (JSC::GCActivityCallback::GCActivityCallback):
+        (JSC::GCActivityCallback::doWork):
+        (JSC::GCActivityCallback::scheduleTimer):
+        (JSC::GCActivityCallback::cancelTimer):
+        (JSC::GCActivityCallback::didAllocate):
+        (JSC::GCActivityCallback::willCollect):
+        (JSC::GCActivityCallback::cancel):
+        * heap/GCActivityCallback.h:
+        (JSC::GCActivityCallback::GCActivityCallback):
+        * heap/Heap.cpp:
+        (JSC::Heap::Heap):
+        (JSC::Heap::reportAbandonedObjectGraph):
+        (JSC::Heap::didAbandon):
+        (JSC::Heap::collectAllGarbage):
+        (JSC::Heap::collect):
+        (JSC::Heap::willStartCollection):
+        (JSC::Heap::updateAllocationLimits):
+        (JSC::Heap::didFinishCollection):
+        (JSC::Heap::setFullActivityCallback):
+        (JSC::Heap::setEdenActivityCallback):
+        (JSC::Heap::fullActivityCallback):
+        (JSC::Heap::edenActivityCallback):
+        (JSC::Heap::setGarbageCollectionTimerEnabled):
+        (JSC::Heap::didAllocate):
+        (JSC::Heap::shouldDoFullCollection):
+        * heap/Heap.h:
+        (JSC::Heap::lastFullGCLength):
+        (JSC::Heap::lastEdenGCLength):
+        (JSC::Heap::increaseLastFullGCLength):
+        (JSC::Heap::sizeBeforeLastEdenCollection):
+        (JSC::Heap::sizeAfterLastEdenCollection):
+        (JSC::Heap::sizeBeforeLastFullCollection):
+        (JSC::Heap::sizeAfterLastFullCollection):
+        * heap/HeapOperation.h:
+        * heap/HeapStatistics.cpp:
+        (JSC::HeapStatistics::showObjectStatistics):
+        * heap/HeapTimer.cpp:
+        (JSC::HeapTimer::timerDidFire):
+        * jsc.cpp:
+        (functionFullGC):
+        (functionEdenGC):
+        * runtime/Options.h:
+
+=======
</ins><span class="cx"> 2014-03-19  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r165459): It broke 109 jsc stress test on ARM Thumb2 and Mac 32 bit
</span><span class="lines">@@ -36,6 +164,7 @@
</span><span class="cx">         * runtime/JSStringJoiner.cpp:
</span><span class="cx">         (JSC::JSStringJoiner::join):
</span><span class="cx"> 
</span><ins>+&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r165925
</ins><span class="cx"> 2014-03-18  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Get rid of Flush in SSA
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/GNUmakefile.list.am (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -557,6 +557,10 @@
</span><span class="cx">     Source/JavaScriptCore/heap/DeferGC.cpp \
</span><span class="cx">         Source/JavaScriptCore/heap/DeferGC.h \
</span><span class="cx">     Source/JavaScriptCore/heap/DelayedReleaseScope.h \
</span><ins>+        Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp \
+        Source/JavaScriptCore/heap/EdenGCActivityCallback.h \
+        Source/JavaScriptCore/heap/FullGCActivityCallback.cpp \
+        Source/JavaScriptCore/heap/FullGCActivityCallback.h \
</ins><span class="cx">         Source/JavaScriptCore/heap/GCActivityCallback.cpp \
</span><span class="cx">         Source/JavaScriptCore/heap/GCActivityCallback.h \
</span><span class="cx">         Source/JavaScriptCore/heap/GCSegmentedArray.h \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -463,6 +463,8 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\CopiedSpace.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\CopyVisitor.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\DeferGC.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\heap\EdenGCActivityCallback.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\heap\FullGCActivityCallback.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\heap\GCActivityCallback.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\GCThread.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\GCThreadSharedData.cpp&quot; /&gt;
</span><span class="lines">@@ -1044,6 +1046,8 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\CopyWriteBarrier.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\DeferGC.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\DelayedReleaseScope.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\heap\EdenGCActivityCallback.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\heap\FullGCActivityCallback.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\heap\GCActivityCallback.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\GCSegmentedArray.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\GCSegmentedArrayInlines.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -228,6 +228,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\heap\CopyVisitor.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;heap&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\heap\EdenGCActivityCallback.cpp&quot;&gt;
+      &lt;Filter&gt;heap&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\heap\FullGCActivityCallback.cpp&quot;&gt;
+      &lt;Filter&gt;heap&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\heap\GCActivityCallback.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;heap&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -1685,6 +1691,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\heap\DeferGC.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;heap&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\heap\EdenGCActivityCallback.h&quot;&gt;
+      &lt;Filter&gt;heap&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\heap\FullGCActivityCallback.h&quot;&gt;
+      &lt;Filter&gt;heap&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\heap\GCActivityCallback.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;heap&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -786,6 +786,10 @@
</span><span class="cx">                 2A68295B1875F80500B6C3E2 /* CopyWriteBarrier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A68295A1875F80500B6C3E2 /* CopyWriteBarrier.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2A6F462617E959CE00C45C98 /* HeapOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A6F462517E959CE00C45C98 /* HeapOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2A7A58EF1808A4C40020BDF7 /* DeferGC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */; };
</span><ins>+                2A83638518D7D0EE0000EBCC /* EdenGCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A83638318D7D0EE0000EBCC /* EdenGCActivityCallback.cpp */; };
+                2A83638618D7D0EE0000EBCC /* EdenGCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A83638418D7D0EE0000EBCC /* EdenGCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                2A83638918D7D0FE0000EBCC /* FullGCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A83638718D7D0FE0000EBCC /* FullGCActivityCallback.cpp */; };
+                2A83638A18D7D0FE0000EBCC /* FullGCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A83638818D7D0FE0000EBCC /* FullGCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2AAAA31218BD49D100394CC8 /* StructureIDBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAAA31018BD49D100394CC8 /* StructureIDBlob.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2AACE63C18CA5A0300ED0191 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */; };
</span><span class="cx">                 2AACE63D18CA5A0300ED0191 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AACE63B18CA5A0300ED0191 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2268,6 +2272,10 @@
</span><span class="cx">                 2A68295A1875F80500B6C3E2 /* CopyWriteBarrier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CopyWriteBarrier.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2A6F462517E959CE00C45C98 /* HeapOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapOperation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeferGC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2A83638318D7D0EE0000EBCC /* EdenGCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EdenGCActivityCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2A83638418D7D0EE0000EBCC /* EdenGCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EdenGCActivityCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2A83638718D7D0FE0000EBCC /* FullGCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FullGCActivityCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2A83638818D7D0FE0000EBCC /* FullGCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullGCActivityCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2AAAA31018BD49D100394CC8 /* StructureIDBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureIDBlob.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCActivityCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2AACE63B18CA5A0300ED0191 /* GCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCActivityCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3601,6 +3609,10 @@
</span><span class="cx">                                 2A4EC90A1860D6C20094F782 /* WriteBarrierBuffer.h */,
</span><span class="cx">                                 0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */,
</span><span class="cx">                                 0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */,
</span><ins>+                                2A83638318D7D0EE0000EBCC /* EdenGCActivityCallback.cpp */,
+                                2A83638418D7D0EE0000EBCC /* EdenGCActivityCallback.h */,
+                                2A83638718D7D0FE0000EBCC /* FullGCActivityCallback.cpp */,
+                                2A83638818D7D0FE0000EBCC /* FullGCActivityCallback.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = heap;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -4920,6 +4932,8 @@
</span><span class="cx">                                 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
</span><span class="cx">                                 A584032018BFFBE1005A0811 /* InspectorAgent.h in Headers */,
</span><span class="cx">                                 2AACE63D18CA5A0300ED0191 /* GCActivityCallback.h in Headers */,
</span><ins>+                                2A83638618D7D0EE0000EBCC /* EdenGCActivityCallback.h in Headers */,
+                                2A83638A18D7D0FE0000EBCC /* FullGCActivityCallback.h in Headers */,
</ins><span class="cx">                                 2AAAA31218BD49D100394CC8 /* StructureIDBlob.h in Headers */,
</span><span class="cx">                                 A54E8EB118BFFBBE00556D28 /* GCSegmentedArrayInlines.h in Headers */,
</span><span class="cx">                                 86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
</span><span class="lines">@@ -6223,6 +6237,7 @@
</span><span class="cx">                                 147F39C2107EC37600427A48 /* Completion.cpp in Sources */,
</span><span class="cx">                                 146B16D812EB5B59001BEC1B /* ConservativeRoots.cpp in Sources */,
</span><span class="cx">                                 A5FD0079189B051000633231 /* ConsoleMessage.cpp in Sources */,
</span><ins>+                                2A83638518D7D0EE0000EBCC /* EdenGCActivityCallback.cpp in Sources */,
</ins><span class="cx">                                 1428082E107EC0570013E7B2 /* ConstructData.cpp in Sources */,
</span><span class="cx">                                 A57D23F11891B5B40031C7FA /* ContentSearchUtilities.cpp in Sources */,
</span><span class="cx">                                 C240305514B404E60079EB64 /* CopiedSpace.cpp in Sources */,
</span><span class="lines">@@ -6523,6 +6538,7 @@
</span><span class="cx">                                 0F919D10157F3329004A4E7D /* JSSegmentedVariableObject.cpp in Sources */,
</span><span class="cx">                                 A7299D9D17D12837005F5FF9 /* JSSet.cpp in Sources */,
</span><span class="cx">                                 A790DD6F182F499700588807 /* JSSetIterator.cpp in Sources */,
</span><ins>+                                2A83638918D7D0FE0000EBCC /* FullGCActivityCallback.cpp in Sources */,
</ins><span class="cx">                                 1428083A107EC0750013E7B2 /* JSStack.cpp in Sources */,
</span><span class="cx">                                 147F39D5107EC37600427A48 /* JSString.cpp in Sources */,
</span><span class="cx">                                 2600B5A6152BAAA70091EE5F /* JSStringJoiner.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapEdenGCActivityCallbackcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp (0 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -0,0 +1,93 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;EdenGCActivityCallback.h&quot;
+
+#include &quot;VM.h&quot;
+
+namespace JSC {
+
+#if USE(CF) || PLATFORM(EFL)
+
+EdenGCActivityCallback::EdenGCActivityCallback(Heap* heap)
+    : GCActivityCallback(heap)
+{
+}
+
+void EdenGCActivityCallback::doCollection()
+{
+    m_vm-&gt;heap.collect(EdenCollection);
+}
+
+double EdenGCActivityCallback::lastGCLength()
+{
+    return m_vm-&gt;heap.lastEdenGCLength();
+}
+
+double EdenGCActivityCallback::deathRate()
+{
+    Heap* heap = &amp;m_vm-&gt;heap;
+    size_t sizeBefore = heap-&gt;sizeBeforeLastEdenCollection();
+    size_t sizeAfter = heap-&gt;sizeAfterLastEdenCollection();
+    if (!sizeBefore)
+        return 1.0;
+    return static_cast&lt;double&gt;(sizeBefore - sizeAfter) / static_cast&lt;double&gt;(sizeBefore);
+}
+
+double EdenGCActivityCallback::gcTimeSlice(size_t bytes)
+{
+    return std::min((static_cast&lt;double&gt;(bytes) / MB) * Options::percentCPUPerMBForEdenTimer(), Options::collectionTimerMaxPercentCPU());
+}
+
+#else
+
+EdenGCActivityCallback::EdenGCActivityCallback(Heap* heap)
+    : GCActivityCallback(heap-&gt;vm())
+{
+}
+
+void EdenGCActivityCallback::doCollection()
+{
+}
+
+double EdenGCActivityCallback::lastGCLength()
+{
+    return 0;
+}
+
+double EdenGCActivityCallback::deathRate()
+{
+    return 0;
+}
+
+double EdenGCActivityCallback::gcTimeSlice(size_t)
+{
+    return 0;
+}
+
+#endif // USE(CF) || PLATFORM(EFL)
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapEdenGCActivityCallbackh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h (0 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/heap/EdenGCActivityCallback.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef EdenGCActivityCallback_h
+#define EdenGCActivityCallback_h
+
+#include &quot;GCActivityCallback.h&quot;
+
+namespace JSC {
+
+class EdenGCActivityCallback : public GCActivityCallback {
+public:
+    EdenGCActivityCallback(Heap*);
+
+    virtual void doCollection() override;
+
+protected:
+#if USE(CF)
+    EdenGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
+        : GCActivityCallback(heap, runLoop)
+    {
+    }
+#endif
+
+    virtual double lastGCLength() override;
+    virtual double gcTimeSlice(size_t bytes) override;
+    virtual double deathRate() override;
+};
+
+inline PassRefPtr&lt;GCActivityCallback&gt; GCActivityCallback::createEdenTimer(Heap* heap)
+{
+    return s_shouldCreateGCTimer ? adoptRef(new EdenGCActivityCallback(heap)) : nullptr;
+}
+
+} // namespace JSC
+
+#endif // EdenGCActivityCallback_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapFullGCActivityCallbackcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.cpp (0 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;FullGCActivityCallback.h&quot;
+
+#include &quot;VM.h&quot;
+
+namespace JSC {
+
+#if USE(CF) || PLATFORM(EFL)
+
+#if !PLATFORM(IOS)
+const double pagingTimeOut = 0.1; // Time in seconds to allow opportunistic timer to iterate over all blocks to see if the Heap is paged out.
+#endif
+
+FullGCActivityCallback::FullGCActivityCallback(Heap* heap)
+    : GCActivityCallback(heap)
+{
+}
+
+void FullGCActivityCallback::doCollection()
+{
+    Heap* heap = &amp;m_vm-&gt;heap;
+
+#if !PLATFORM(IOS)
+    double startTime = WTF::monotonicallyIncreasingTime();
+    if (heap-&gt;isPagedOut(startTime + pagingTimeOut)) {
+        cancel();
+        heap-&gt;increaseLastFullGCLength(pagingTimeOut);
+        return;
+    }
+#endif
+
+    heap-&gt;collect(FullCollection);
+}
+
+double FullGCActivityCallback::lastGCLength()
+{
+    return m_vm-&gt;heap.lastFullGCLength();
+}
+
+double FullGCActivityCallback::deathRate()
+{
+    Heap* heap = &amp;m_vm-&gt;heap;
+    size_t sizeBefore = heap-&gt;sizeBeforeLastFullCollection();
+    size_t sizeAfter = heap-&gt;sizeAfterLastFullCollection();
+    if (!sizeBefore)
+        return 1.0;
+    return static_cast&lt;double&gt;(sizeBefore - sizeAfter) / static_cast&lt;double&gt;(sizeBefore);
+}
+
+double FullGCActivityCallback::gcTimeSlice(size_t bytes)
+{
+    return std::min((static_cast&lt;double&gt;(bytes) / MB) * Options::percentCPUPerMBForFullTimer(), Options::collectionTimerMaxPercentCPU());
+}
+
+#else
+
+FullGCActivityCallback::FullGCActivityCallback(Heap* heap)
+    : GCActivityCallback(heap)
+{
+}
+
+void FullGCActivityCallback::doCollection()
+{
+}
+
+double FullGCActivityCallback::lastGCLength()
+{
+    return 0;
+}
+
+double FullGCActivityCallback::deathRate()
+{
+    return 0;
+}
+
+double FullGCActivityCallback::gcTimeSlice(size_t)
+{
+    return 0;
+}
+
+#endif // USE(CF) || PLATFORM(EFL)
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapFullGCActivityCallbackh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h (0 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/heap/FullGCActivityCallback.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2014 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef FullGCActivityCallback_h
+#define FullGCActivityCallback_h
+
+#include &quot;GCActivityCallback.h&quot;
+
+namespace JSC {
+
+class FullGCActivityCallback : public GCActivityCallback {
+public:
+    FullGCActivityCallback(Heap*);
+
+    virtual void doCollection() override;
+
+protected:
+#if USE(CF)
+    FullGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
+        : GCActivityCallback(heap, runLoop)
+    {
+    }
+#endif
+
+    virtual double lastGCLength() override;
+    virtual double gcTimeSlice(size_t bytes) override;
+    virtual double deathRate() override;
+};
+
+inline PassRefPtr&lt;GCActivityCallback&gt; GCActivityCallback::createFullTimer(Heap* heap)
+{
+    return s_shouldCreateGCTimer ? adoptRef(new FullGCActivityCallback(heap)) : nullptr;
+}
+
+} // namespace JSC
+
+#endif // FullGCActivityCallback_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCActivityCallbackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -47,39 +47,26 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CF) || PLATFORM(EFL)
</span><span class="cx"> 
</span><del>-const double gcTimeSlicePerMB = 0.01; // Percentage of CPU time we will spend to reclaim 1 MB
-const double maxGCTimeSlice = 0.05; // The maximum amount of CPU time we want to use for opportunistic timer-triggered collections.
</del><span class="cx"> const double timerSlop = 2.0; // Fudge factor to avoid performance cost of resetting timer.
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
-const double pagingTimeOut = 0.1; // Time in seconds to allow opportunistic timer to iterate over all blocks to see if the Heap is paged out.
-#endif
-
-#if !USE(CF)
-const double hour = 60 * 60;
-#endif
-
</del><span class="cx"> #if USE(CF)
</span><del>-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
</del><ins>+GCActivityCallback::GCActivityCallback(Heap* heap)
</ins><span class="cx">     : GCActivityCallback(heap-&gt;vm(), CFRunLoopGetCurrent())
</span><del>-    , m_delay(s_decade)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
</del><ins>+GCActivityCallback::GCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
</ins><span class="cx">     : GCActivityCallback(heap-&gt;vm(), runLoop)
</span><del>-    , m_delay(s_decade)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> #elif PLATFORM(EFL)
</span><del>-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
</del><ins>+GCActivityCallback::GCActivityCallback(Heap* heap)
</ins><span class="cx">     : GCActivityCallback(heap-&gt;vm(), WTF::isMainThread())
</span><del>-    , m_delay(hour)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::doWork()
</del><ins>+void GCActivityCallback::doWork()
</ins><span class="cx"> {
</span><span class="cx">     Heap* heap = &amp;m_vm-&gt;heap;
</span><span class="cx">     if (!isEnabled())
</span><span class="lines">@@ -91,20 +78,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
-    double startTime = WTF::monotonicallyIncreasingTime();
-    if (heap-&gt;isPagedOut(startTime + pagingTimeOut)) {
-        heap-&gt;activityCallback()-&gt;cancel();
-        heap-&gt;increaseLastGCLength(pagingTimeOut);
-        return;
-    }
-#endif
-    heap-&gt;gcTimerDidFire();
-    heap-&gt;collect();
</del><ins>+    doCollection();
</ins><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> #if USE(CF)
</span><del>-void DefaultGCActivityCallback::scheduleTimer(double newDelay)
</del><ins>+void GCActivityCallback::scheduleTimer(double newDelay)
</ins><span class="cx"> {
</span><span class="cx">     if (newDelay * timerSlop &gt; m_delay)
</span><span class="cx">         return;
</span><span class="lines">@@ -113,13 +91,13 @@
</span><span class="cx">     CFRunLoopTimerSetNextFireDate(m_timer.get(), CFRunLoopTimerGetNextFireDate(m_timer.get()) - delta);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::cancelTimer()
</del><ins>+void GCActivityCallback::cancelTimer()
</ins><span class="cx"> {
</span><span class="cx">     m_delay = s_decade;
</span><span class="cx">     CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade);
</span><span class="cx"> }
</span><span class="cx"> #elif PLATFORM(EFL)
</span><del>-void DefaultGCActivityCallback::scheduleTimer(double newDelay)
</del><ins>+void GCActivityCallback::scheduleTimer(double newDelay)
</ins><span class="cx"> {
</span><span class="cx">     if (newDelay * timerSlop &gt; m_delay)
</span><span class="cx">         return;
</span><span class="lines">@@ -131,14 +109,14 @@
</span><span class="cx">     m_timer = add(newDelay, this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::cancelTimer()
</del><ins>+void GCActivityCallback::cancelTimer()
</ins><span class="cx"> {
</span><del>-    m_delay = hour;
</del><ins>+    m_delay = s_hour;
</ins><span class="cx">     stop();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::didAllocate(size_t bytes)
</del><ins>+void GCActivityCallback::didAllocate(size_t bytes)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(EFL)
</span><span class="cx">     if (!isEnabled())
</span><span class="lines">@@ -151,42 +129,41 @@
</span><span class="cx">     // We pretend it's one byte so that we don't ignore this allocation entirely.
</span><span class="cx">     if (!bytes)
</span><span class="cx">         bytes = 1;
</span><del>-    Heap* heap = static_cast&lt;Heap*&gt;(&amp;m_vm-&gt;heap);
-    double gcTimeSlice = std::min((static_cast&lt;double&gt;(bytes) / MB) * gcTimeSlicePerMB, maxGCTimeSlice);
-    double newDelay = heap-&gt;lastGCLength() / gcTimeSlice;
</del><ins>+    double bytesExpectedToReclaim = static_cast&lt;double&gt;(bytes) * deathRate();
+    double newDelay = lastGCLength() / gcTimeSlice(bytesExpectedToReclaim);
</ins><span class="cx">     scheduleTimer(newDelay);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::willCollect()
</del><ins>+void GCActivityCallback::willCollect()
</ins><span class="cx"> {
</span><span class="cx">     cancelTimer();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::cancel()
</del><ins>+void GCActivityCallback::cancel()
</ins><span class="cx"> {
</span><span class="cx">     cancelTimer();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #else
</span><span class="cx"> 
</span><del>-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
</del><ins>+GCActivityCallback::GCActivityCallback(Heap* heap)
</ins><span class="cx">     : GCActivityCallback(heap-&gt;vm())
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::doWork()
</del><ins>+void GCActivityCallback::doWork()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::didAllocate(size_t)
</del><ins>+void GCActivityCallback::didAllocate(size_t)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::willCollect()
</del><ins>+void GCActivityCallback::willCollect()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DefaultGCActivityCallback::cancel()
</del><ins>+void GCActivityCallback::cancel()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCActivityCallbackh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/GCActivityCallback.h (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCActivityCallback.h        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/GCActivityCallback.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HeapTimer.h&quot;
</span><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><del>-#include &lt;wtf/PassOwnPtr.h&gt;
</del><ins>+#include &lt;wtf/PassRefPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CF)
</span><span class="cx"> #include &lt;CoreFoundation/CoreFoundation.h&gt;
</span><span class="lines">@@ -41,28 +41,44 @@
</span><span class="cx"> 
</span><span class="cx"> class Heap;
</span><span class="cx"> 
</span><del>-class GCActivityCallback : public HeapTimer {
</del><ins>+class GCActivityCallback : public HeapTimer, public ThreadSafeRefCounted&lt;GCActivityCallback&gt; {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    virtual void didAllocate(size_t) { }
-    virtual void willCollect() { }
-    virtual void cancel() { }
</del><ins>+    static PassRefPtr&lt;GCActivityCallback&gt; createFullTimer(Heap*);
+    static PassRefPtr&lt;GCActivityCallback&gt; createEdenTimer(Heap*);
+
+    GCActivityCallback(Heap*);
+
+    virtual void doWork() override;
+
+    virtual void doCollection() = 0;
+
+    virtual void didAllocate(size_t);
+    virtual void willCollect();
+    virtual void cancel();
</ins><span class="cx">     bool isEnabled() const { return m_enabled; }
</span><span class="cx">     void setEnabled(bool enabled) { m_enabled = enabled; }
</span><span class="cx"> 
</span><span class="cx">     static bool s_shouldCreateGCTimer;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    virtual double lastGCLength() = 0;
+    virtual double gcTimeSlice(size_t bytes) = 0;
+    virtual double deathRate() = 0;
+
</ins><span class="cx"> #if USE(CF)
</span><span class="cx">     GCActivityCallback(VM* vm, CFRunLoopRef runLoop)
</span><span class="cx">         : HeapTimer(vm, runLoop)
</span><span class="cx">         , m_enabled(true)
</span><ins>+        , m_delay(s_decade)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> #elif PLATFORM(EFL)
</span><ins>+    static constexpr double s_hour = 3600;
</ins><span class="cx">     GCActivityCallback(VM* vm, bool flag)
</span><span class="cx">         : HeapTimer(vm)
</span><span class="cx">         , m_enabled(flag)
</span><ins>+        , m_delay(s_hour)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> #else
</span><span class="lines">@@ -74,23 +90,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool m_enabled;
</span><del>-};
</del><span class="cx"> 
</span><del>-class DefaultGCActivityCallback : public GCActivityCallback {
-public:
-    static PassOwnPtr&lt;DefaultGCActivityCallback&gt; create(Heap*);
-
-    DefaultGCActivityCallback(Heap*);
-
-    JS_EXPORT_PRIVATE virtual void didAllocate(size_t) override;
-    JS_EXPORT_PRIVATE virtual void willCollect() override;
-    JS_EXPORT_PRIVATE virtual void cancel() override;
-
-    JS_EXPORT_PRIVATE virtual void doWork() override;
-
</del><span class="cx"> #if USE(CF)
</span><span class="cx"> protected:
</span><del>-    JS_EXPORT_PRIVATE DefaultGCActivityCallback(Heap*, CFRunLoopRef);
</del><ins>+    JS_EXPORT_PRIVATE GCActivityCallback(Heap*, CFRunLoopRef);
</ins><span class="cx"> #endif
</span><span class="cx"> #if USE(CF) || PLATFORM(EFL)
</span><span class="cx"> protected:
</span><span class="lines">@@ -102,11 +105,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-inline PassOwnPtr&lt;DefaultGCActivityCallback&gt; DefaultGCActivityCallback::create(Heap* heap)
-{
-    return GCActivityCallback::s_shouldCreateGCTimer ? adoptPtr(new DefaultGCActivityCallback(heap)) : nullptr;
-}
</del><ins>+} // namespace JSC
</ins><span class="cx"> 
</span><del>-}
-
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> #include &quot;CopyVisitorInlines.h&quot;
</span><span class="cx"> #include &quot;DFGWorklist.h&quot;
</span><span class="cx"> #include &quot;DelayedReleaseScope.h&quot;
</span><ins>+#include &quot;EdenGCActivityCallback.h&quot;
+#include &quot;FullGCActivityCallback.h&quot;
</ins><span class="cx"> #include &quot;GCActivityCallback.h&quot;
</span><span class="cx"> #include &quot;GCIncomingRefCountedSetInlines.h&quot;
</span><span class="cx"> #include &quot;HeapIterationScope.h&quot;
</span><span class="lines">@@ -253,8 +255,12 @@
</span><span class="cx">     , m_ramSize(ramSize())
</span><span class="cx">     , m_minBytesPerCycle(minHeapSize(m_heapType, m_ramSize))
</span><span class="cx">     , m_sizeAfterLastCollect(0)
</span><ins>+    , m_sizeAfterLastFullCollect(0)
+    , m_sizeBeforeLastFullCollect(0)
+    , m_sizeAfterLastEdenCollect(0)
+    , m_sizeBeforeLastEdenCollect(0)
</ins><span class="cx">     , m_bytesAllocatedThisCycle(0)
</span><del>-    , m_bytesAbandonedThisCycle(0)
</del><ins>+    , m_bytesAbandonedSinceLastFullCollect(0)
</ins><span class="cx">     , m_maxEdenSize(m_minBytesPerCycle)
</span><span class="cx">     , m_maxHeapSize(m_minBytesPerCycle)
</span><span class="cx">     , m_shouldDoFullCollection(false)
</span><span class="lines">@@ -274,9 +280,15 @@
</span><span class="cx">     , m_isSafeToCollect(false)
</span><span class="cx">     , m_writeBarrierBuffer(256)
</span><span class="cx">     , m_vm(vm)
</span><del>-    , m_lastGCLength(0)
</del><ins>+    , m_lastFullGCLength(0)
+    , m_lastEdenGCLength(0)
</ins><span class="cx">     , m_lastCodeDiscardTime(WTF::monotonicallyIncreasingTime())
</span><del>-    , m_activityCallback(DefaultGCActivityCallback::create(this))
</del><ins>+    , m_fullActivityCallback(GCActivityCallback::createFullTimer(this))
+#if ENABLE(GGC)
+    , m_edenActivityCallback(GCActivityCallback::createEdenTimer(this))
+#else
+    , m_edenActivityCallback(m_fullActivityCallback)
+#endif
</ins><span class="cx">     , m_sweeper(IncrementalSweeper::create(this))
</span><span class="cx">     , m_deferralDepth(0)
</span><span class="cx"> {
</span><span class="lines">@@ -323,7 +335,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Our clients don't know exactly how much memory they
</span><span class="cx">     // are abandoning so we just guess for them.
</span><del>-    double abandonedBytes = 0.10 * m_sizeAfterLastCollect;
</del><ins>+    double abandonedBytes = 0.1 * m_sizeAfterLastCollect;
</ins><span class="cx"> 
</span><span class="cx">     // We want to accelerate the next collection. Because memory has just 
</span><span class="cx">     // been abandoned, the next collection has the potential to 
</span><span class="lines">@@ -334,9 +346,11 @@
</span><span class="cx"> 
</span><span class="cx"> void Heap::didAbandon(size_t bytes)
</span><span class="cx"> {
</span><del>-    if (m_activityCallback)
-        m_activityCallback-&gt;didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle);
-    m_bytesAbandonedThisCycle += bytes;
</del><ins>+    if (m_fullActivityCallback) {
+        m_fullActivityCallback-&gt;didAllocate(
+            m_sizeAfterLastCollect - m_sizeAfterLastFullCollect + m_bytesAllocatedThisCycle + m_bytesAbandonedSinceLastFullCollect);
+    }
+    m_bytesAbandonedSinceLastFullCollect += bytes;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Heap::protect(JSValue k)
</span><span class="lines">@@ -846,8 +860,7 @@
</span><span class="cx">     if (!m_isSafeToCollect)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_shouldDoFullCollection = true;
-    collect();
</del><ins>+    collect(FullCollection);
</ins><span class="cx"> 
</span><span class="cx">     SamplingRegion samplingRegion(&quot;Garbage Collection: Sweeping&quot;);
</span><span class="cx">     DelayedReleaseScope delayedReleaseScope(m_objectSpace);
</span><span class="lines">@@ -857,7 +870,7 @@
</span><span class="cx"> 
</span><span class="cx"> static double minute = 60.0;
</span><span class="cx"> 
</span><del>-void Heap::collect()
</del><ins>+void Heap::collect(HeapOperation collectionType)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(ALLOCATION_LOGGING)
</span><span class="cx">     dataLogF(&quot;JSC GC starting collection.\n&quot;);
</span><span class="lines">@@ -880,7 +893,7 @@
</span><span class="cx">     RELEASE_ASSERT(m_operationInProgress == NoOperation);
</span><span class="cx"> 
</span><span class="cx">     suspendCompilerThreads();
</span><del>-    willStartCollection();
</del><ins>+    willStartCollection(collectionType);
</ins><span class="cx"> 
</span><span class="cx">     double gcStartTime = WTF::monotonicallyIncreasingTime();
</span><span class="cx"> 
</span><span class="lines">@@ -927,10 +940,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::willStartCollection()
</del><ins>+void Heap::willStartCollection(HeapOperation collectionType)
</ins><span class="cx"> {
</span><span class="cx">     GCPHASE(StartingCollection);
</span><del>-    if (shouldDoFullCollection()) {
</del><ins>+    if (shouldDoFullCollection(collectionType)) {
</ins><span class="cx">         m_operationInProgress = FullCollection;
</span><span class="cx">         m_slotVisitor.clearMarkStack();
</span><span class="cx">         m_shouldDoFullCollection = false;
</span><span class="lines">@@ -941,11 +954,19 @@
</span><span class="cx">         if (Options::logGC())
</span><span class="cx">             dataLog(&quot;EdenCollection, &quot;);
</span><span class="cx">     }
</span><del>-    if (m_operationInProgress == FullCollection)
</del><ins>+    if (m_operationInProgress == FullCollection) {
+        m_sizeBeforeLastFullCollect = m_sizeAfterLastCollect + m_bytesAllocatedThisCycle;
</ins><span class="cx">         m_extraMemoryUsage = 0;
</span><span class="cx"> 
</span><del>-    if (m_activityCallback)
-        m_activityCallback-&gt;willCollect();
</del><ins>+        if (m_fullActivityCallback)
+            m_fullActivityCallback-&gt;willCollect();
+    } else {
+        ASSERT(m_operationInProgress == EdenCollection);
+        m_sizeBeforeLastEdenCollect = m_sizeAfterLastCollect + m_bytesAllocatedThisCycle;
+    }
+
+    if (m_edenActivityCallback)
+        m_edenActivityCallback-&gt;willCollect();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Heap::deleteOldCode(double gcStartTime)
</span><span class="lines">@@ -1043,20 +1064,26 @@
</span><span class="cx">         // fixed minimum.
</span><span class="cx">         m_maxHeapSize = max(minHeapSize(m_heapType, m_ramSize), proportionalHeapSize(currentHeapSize, m_ramSize));
</span><span class="cx">         m_maxEdenSize = m_maxHeapSize - currentHeapSize;
</span><ins>+        m_sizeAfterLastFullCollect = currentHeapSize;
+        m_bytesAbandonedSinceLastFullCollect = 0;
</ins><span class="cx">     } else {
</span><span class="cx">         ASSERT(currentHeapSize &gt;= m_sizeAfterLastCollect);
</span><span class="cx">         m_maxEdenSize = m_maxHeapSize - currentHeapSize;
</span><ins>+        m_sizeAfterLastEdenCollect = currentHeapSize;
</ins><span class="cx">         double edenToOldGenerationRatio = (double)m_maxEdenSize / (double)m_maxHeapSize;
</span><span class="cx">         double minEdenToOldGenerationRatio = 1.0 / 3.0;
</span><span class="cx">         if (edenToOldGenerationRatio &lt; minEdenToOldGenerationRatio)
</span><span class="cx">             m_shouldDoFullCollection = true;
</span><span class="cx">         m_maxHeapSize += currentHeapSize - m_sizeAfterLastCollect;
</span><span class="cx">         m_maxEdenSize = m_maxHeapSize - currentHeapSize;
</span><ins>+        if (m_fullActivityCallback) {
+            ASSERT(currentHeapSize &gt;= m_sizeAfterLastFullCollect);
+            m_fullActivityCallback-&gt;didAllocate(currentHeapSize - m_sizeAfterLastFullCollect);
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_sizeAfterLastCollect = currentHeapSize;
</span><span class="cx">     m_bytesAllocatedThisCycle = 0;
</span><del>-    m_bytesAbandonedThisCycle = 0;
</del><span class="cx"> 
</span><span class="cx">     if (Options::logGC())
</span><span class="cx">         dataLog(currentHeapSize / 1024, &quot; kb, &quot;);
</span><span class="lines">@@ -1066,7 +1093,10 @@
</span><span class="cx"> {
</span><span class="cx">     GCPHASE(FinishingCollection);
</span><span class="cx">     double gcEndTime = WTF::monotonicallyIncreasingTime();
</span><del>-    m_lastGCLength = gcEndTime - gcStartTime;
</del><ins>+    if (m_operationInProgress == FullCollection)
+        m_lastFullGCLength = gcEndTime - gcStartTime;
+    else
+        m_lastEdenGCLength = gcEndTime - gcStartTime;
</ins><span class="cx"> 
</span><span class="cx">     if (Options::recordGCPauseTimes())
</span><span class="cx">         HeapStatistics::recordGCPauseTime(gcStartTime, gcEndTime);
</span><span class="lines">@@ -1102,16 +1132,26 @@
</span><span class="cx">     m_objectSpace.forEachDeadCell&lt;MarkObject&gt;(iterationScope);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Heap::setActivityCallback(PassOwnPtr&lt;GCActivityCallback&gt; activityCallback)
</del><ins>+void Heap::setFullActivityCallback(PassRefPtr&lt;FullGCActivityCallback&gt; activityCallback)
</ins><span class="cx"> {
</span><del>-    m_activityCallback = activityCallback;
</del><ins>+    m_fullActivityCallback = activityCallback;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-GCActivityCallback* Heap::activityCallback()
</del><ins>+void Heap::setEdenActivityCallback(PassRefPtr&lt;EdenGCActivityCallback&gt; activityCallback)
</ins><span class="cx"> {
</span><del>-    return m_activityCallback.get();
</del><ins>+    m_edenActivityCallback = activityCallback;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GCActivityCallback* Heap::fullActivityCallback()
+{
+    return m_fullActivityCallback.get();
+}
+
+GCActivityCallback* Heap::edenActivityCallback()
+{
+    return m_edenActivityCallback.get();
+}
+
</ins><span class="cx"> void Heap::setIncrementalSweeper(PassOwnPtr&lt;IncrementalSweeper&gt; sweeper)
</span><span class="cx"> {
</span><span class="cx">     m_sweeper = sweeper;
</span><span class="lines">@@ -1124,14 +1164,16 @@
</span><span class="cx"> 
</span><span class="cx"> void Heap::setGarbageCollectionTimerEnabled(bool enable)
</span><span class="cx"> {
</span><del>-    if (m_activityCallback)
-        m_activityCallback-&gt;setEnabled(enable);
</del><ins>+    if (m_fullActivityCallback)
+        m_fullActivityCallback-&gt;setEnabled(enable);
+    if (m_edenActivityCallback)
+        m_edenActivityCallback-&gt;setEnabled(enable);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Heap::didAllocate(size_t bytes)
</span><span class="cx"> {
</span><del>-    if (m_activityCallback)
-        m_activityCallback-&gt;didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedThisCycle);
</del><ins>+    if (m_edenActivityCallback)
+        m_edenActivityCallback-&gt;didAllocate(m_bytesAllocatedThisCycle + m_bytesAbandonedSinceLastFullCollect);
</ins><span class="cx">     m_bytesAllocatedThisCycle += bytes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1214,11 +1256,27 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Heap::shouldDoFullCollection() const
</del><ins>+bool Heap::shouldDoFullCollection(HeapOperation requestedCollectionType) const
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(GGC)
</span><del>-    return Options::alwaysDoFullCollection() || m_shouldDoFullCollection;
</del><ins>+    if (Options::alwaysDoFullCollection())
+        return true;
+
+    switch (requestedCollectionType) {
+    case EdenCollection:
+        return false;
+    case FullCollection:
+        return true;
+    case AnyCollection:
+        return m_shouldDoFullCollection;
+    default:
+        RELEASE_ASSERT_NOT_REACHED();
+        return false;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+    return false;
</ins><span class="cx"> #else
</span><ins>+    UNUSED_PARAM(requestedCollectionType);
</ins><span class="cx">     return true;
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx">     class CopiedSpace;
</span><span class="cx">     class CodeBlock;
</span><span class="cx">     class ExecutableBase;
</span><ins>+    class EdenGCActivityCallback;
+    class FullGCActivityCallback;
</ins><span class="cx">     class GCActivityCallback;
</span><span class="cx">     class GCAwareJITStubRoutine;
</span><span class="cx">     class GlobalCodeBlock;
</span><span class="lines">@@ -118,8 +120,10 @@
</span><span class="cx">         MarkedSpace&amp; objectSpace() { return m_objectSpace; }
</span><span class="cx">         MachineThreads&amp; machineThreads() { return m_machineThreads; }
</span><span class="cx"> 
</span><del>-        JS_EXPORT_PRIVATE GCActivityCallback* activityCallback();
-        JS_EXPORT_PRIVATE void setActivityCallback(PassOwnPtr&lt;GCActivityCallback&gt;);
</del><ins>+        JS_EXPORT_PRIVATE GCActivityCallback* fullActivityCallback();
+        JS_EXPORT_PRIVATE GCActivityCallback* edenActivityCallback();
+        JS_EXPORT_PRIVATE void setFullActivityCallback(PassRefPtr&lt;FullGCActivityCallback&gt;);
+        JS_EXPORT_PRIVATE void setEdenActivityCallback(PassRefPtr&lt;EdenGCActivityCallback&gt;);
</ins><span class="cx">         JS_EXPORT_PRIVATE void setGarbageCollectionTimerEnabled(bool);
</span><span class="cx"> 
</span><span class="cx">         JS_EXPORT_PRIVATE IncrementalSweeper* sweeper();
</span><span class="lines">@@ -148,9 +152,7 @@
</span><span class="cx"> 
</span><span class="cx">         JS_EXPORT_PRIVATE void collectAllGarbage();
</span><span class="cx">         bool shouldCollect();
</span><del>-        void gcTimerDidFire() { m_shouldDoFullCollection = true; }
-        void setShouldDoFullCollection(bool shouldDoFullCollection) { m_shouldDoFullCollection = shouldDoFullCollection; }
-        JS_EXPORT_PRIVATE void collect();
</del><ins>+        JS_EXPORT_PRIVATE void collect(HeapOperation collectionType = AnyCollection);
</ins><span class="cx">         bool collectIfNecessaryOrDefer(); // Returns true if it did collect.
</span><span class="cx"> 
</span><span class="cx">         void reportExtraMemoryCost(size_t cost);
</span><span class="lines">@@ -186,9 +188,15 @@
</span><span class="cx">         void didFinishIterating();
</span><span class="cx">         void getConservativeRegisterRoots(HashSet&lt;JSCell*&gt;&amp; roots);
</span><span class="cx"> 
</span><del>-        double lastGCLength() { return m_lastGCLength; }
-        void increaseLastGCLength(double amount) { m_lastGCLength += amount; }
</del><ins>+        double lastFullGCLength() const { return m_lastFullGCLength; }
+        double lastEdenGCLength() const { return m_lastEdenGCLength; }
+        void increaseLastFullGCLength(double amount) { m_lastFullGCLength += amount; }
</ins><span class="cx"> 
</span><ins>+        size_t sizeBeforeLastEdenCollection() const { return m_sizeBeforeLastEdenCollect; }
+        size_t sizeAfterLastEdenCollection() const { return m_sizeAfterLastEdenCollect; }
+        size_t sizeBeforeLastFullCollection() const { return m_sizeBeforeLastFullCollect; }
+        size_t sizeAfterLastFullCollection() const { return m_sizeAfterLastFullCollect; }
+
</ins><span class="cx">         JS_EXPORT_PRIVATE void deleteAllCompiledCode();
</span><span class="cx">         void deleteAllUnlinkedFunctionCode();
</span><span class="cx"> 
</span><span class="lines">@@ -252,7 +260,7 @@
</span><span class="cx">         JS_EXPORT_PRIVATE void reportExtraMemoryCostSlowCase(size_t);
</span><span class="cx"> 
</span><span class="cx">         void suspendCompilerThreads();
</span><del>-        void willStartCollection();
</del><ins>+        void willStartCollection(HeapOperation collectionType);
</ins><span class="cx">         void deleteOldCode(double gcStartTime);
</span><span class="cx">         void flushOldStructureIDTables();
</span><span class="cx">         void flushWriteBarrierBuffer();
</span><span class="lines">@@ -296,7 +304,7 @@
</span><span class="cx">         void zombifyDeadObjects();
</span><span class="cx">         void markDeadObjects();
</span><span class="cx"> 
</span><del>-        bool shouldDoFullCollection() const;
</del><ins>+        bool shouldDoFullCollection(HeapOperation requestedCollectionType) const;
</ins><span class="cx">         size_t sizeAfterCollect();
</span><span class="cx"> 
</span><span class="cx">         JSStack&amp; stack();
</span><span class="lines">@@ -309,9 +317,13 @@
</span><span class="cx">         const size_t m_ramSize;
</span><span class="cx">         const size_t m_minBytesPerCycle;
</span><span class="cx">         size_t m_sizeAfterLastCollect;
</span><ins>+        size_t m_sizeAfterLastFullCollect;
+        size_t m_sizeBeforeLastFullCollect;
+        size_t m_sizeAfterLastEdenCollect;
+        size_t m_sizeBeforeLastEdenCollect;
</ins><span class="cx"> 
</span><span class="cx">         size_t m_bytesAllocatedThisCycle;
</span><del>-        size_t m_bytesAbandonedThisCycle;
</del><ins>+        size_t m_bytesAbandonedSinceLastFullCollect;
</ins><span class="cx">         size_t m_maxEdenSize;
</span><span class="cx">         size_t m_maxHeapSize;
</span><span class="cx">         bool m_shouldDoFullCollection;
</span><span class="lines">@@ -349,12 +361,14 @@
</span><span class="cx">         WriteBarrierBuffer m_writeBarrierBuffer;
</span><span class="cx"> 
</span><span class="cx">         VM* m_vm;
</span><del>-        double m_lastGCLength;
</del><ins>+        double m_lastFullGCLength;
+        double m_lastEdenGCLength;
</ins><span class="cx">         double m_lastCodeDiscardTime;
</span><span class="cx"> 
</span><span class="cx">         DoublyLinkedList&lt;ExecutableBase&gt; m_compiledCode;
</span><span class="cx">         
</span><del>-        OwnPtr&lt;GCActivityCallback&gt; m_activityCallback;
</del><ins>+        RefPtr&lt;GCActivityCallback&gt; m_fullActivityCallback;
+        RefPtr&lt;GCActivityCallback&gt; m_edenActivityCallback;
</ins><span class="cx">         OwnPtr&lt;IncrementalSweeper&gt; m_sweeper;
</span><span class="cx">         Vector&lt;MarkedBlock*&gt; m_blockSnapshot;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapOperation.h (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapOperation.h        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/HeapOperation.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-enum HeapOperation { NoOperation, Allocation, FullCollection, EdenCollection };
</del><ins>+enum HeapOperation { NoOperation, Allocation, FullCollection, EdenCollection, AnyCollection };
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/HeapStatistics.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx">     dataLogF(&quot;\n=== Heap Statistics: ===\n&quot;);
</span><span class="cx">     dataLogF(&quot;size: %ldkB\n&quot;, static_cast&lt;long&gt;(heap-&gt;m_sizeAfterLastCollect / KB));
</span><span class="cx">     dataLogF(&quot;capacity: %ldkB\n&quot;, static_cast&lt;long&gt;(heap-&gt;capacity() / KB));
</span><del>-    dataLogF(&quot;pause time: %lfms\n\n&quot;, heap-&gt;m_lastGCLength);
</del><ins>+    dataLogF(&quot;pause time: %lfms\n\n&quot;, heap-&gt;m_lastFullGCLength);
</ins><span class="cx"> 
</span><span class="cx">     StorageStatistics storageStatistics;
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/HeapTimer.cpp (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/HeapTimer.cpp        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/heap/HeapTimer.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -85,8 +85,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     HeapTimer* heapTimer = 0;
</span><del>-    if (vm-&gt;heap.activityCallback() &amp;&amp; vm-&gt;heap.activityCallback()-&gt;m_timer.get() == timer)
-        heapTimer = vm-&gt;heap.activityCallback();
</del><ins>+    if (vm-&gt;heap.fullActivityCallback() &amp;&amp; vm-&gt;heap.fullActivityCallback()-&gt;m_timer.get() == timer)
+        heapTimer = vm-&gt;heap.fullActivityCallback();
+    else if (vm-&gt;heap.edenActivityCallback() &amp;&amp; vm-&gt;heap.edenActivityCallback()-&gt;m_timer.get() == timer)
+        heapTimer = vm-&gt;heap.edenActivityCallback();
</ins><span class="cx">     else if (vm-&gt;heap.sweeper()-&gt;m_timer.get() == timer)
</span><span class="cx">         heapTimer = vm-&gt;heap.sweeper();
</span><span class="cx">     else
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -577,18 +577,14 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionFullGC(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(exec);
</span><del>-    Heap* heap = exec-&gt;heap();
-    heap-&gt;setShouldDoFullCollection(true);
-    exec-&gt;heap()-&gt;collect();
</del><ins>+    exec-&gt;heap()-&gt;collect(FullCollection);
</ins><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionEdenGC(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(exec);
</span><del>-    Heap* heap = exec-&gt;heap();
-    heap-&gt;setShouldDoFullCollection(false);
-    heap-&gt;collect();
</del><ins>+    exec-&gt;heap()-&gt;collect(EdenCollection);
</ins><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.h (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.h        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/JavaScriptCore/runtime/Options.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -242,6 +242,10 @@
</span><span class="cx">     v(double, minCopiedBlockUtilization, 0.9) \
</span><span class="cx">     v(double, minMarkedBlockUtilization, 0.9) \
</span><span class="cx">     \
</span><ins>+    v(double, percentCPUPerMBForFullTimer, 0.0003125) \
+    v(double, percentCPUPerMBForEdenTimer, 0.0025) \
+    v(double, collectionTimerMaxPercentCPU, 0.05) \
+    \
</ins><span class="cx">     v(bool, forceWeakRandomSeed, false) \
</span><span class="cx">     v(unsigned, forcedWeakRandomSeed, 0) \
</span><span class="cx">     \
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/WebCore/ChangeLog        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-03-13  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        GC timer should intelligently choose between EdenCollections and FullCollections
+        https://bugs.webkit.org/show_bug.cgi?id=128261
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests.
+
+        * platform/ios/WebSafeGCActivityCallbackIOS.h: Update WebSafeGCActivityCallback
+        appropriately for the introduction of another type of GCActivityCallback.
+
+&lt;&lt;&lt;&lt;&lt;&lt;&lt; .mine
+2014-03-18  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        GC timer should intelligently choose between EdenCollections and FullCollections
+        https://bugs.webkit.org/show_bug.cgi?id=128261
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests.
+
+        Updated WebSafeGCActivityCallbacks for both Eden and Full timers.
+
+        * platform/ios/WebSafeGCActivityCallbackIOS.h:
+
+=======
</ins><span class="cx"> 2014-03-19  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Crash with long selector list
</span><span class="lines">@@ -1095,6 +1122,7 @@
</span><span class="cx">         (WebCore::RTCPeerConnection::hasLocalStreamWithTrackId):
</span><span class="cx">         * Modules/mediastream/RTCPeerConnection.h:
</span><span class="cx"> 
</span><ins>+&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r165925
</ins><span class="cx"> 2014-03-18  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r165815.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebSafeGCActivityCallbackIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h (165925 => 165926)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h        2014-03-19 21:57:01 UTC (rev 165925)
+++ trunk/Source/WebCore/platform/ios/WebSafeGCActivityCallbackIOS.h        2014-03-19 22:21:51 UTC (rev 165926)
</span><span class="lines">@@ -27,26 +27,42 @@
</span><span class="cx"> #define WebSafeGCActivityCallbackIOS_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebCoreThread.h&quot;
</span><del>-#include &lt;JavaScriptCore/GCActivityCallback.h&gt;
</del><ins>+#include &lt;JavaScriptCore/EdenGCActivityCallback.h&gt;
+#include &lt;JavaScriptCore/FullGCActivityCallback.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class WebSafeGCActivityCallback final : public JSC::DefaultGCActivityCallback {
</del><ins>+class WebSafeFullGCActivityCallback final : public JSC::FullGCActivityCallback {
</ins><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;WebSafeGCActivityCallback&gt; create(JSC::Heap* heap)
</del><ins>+    static PassOwnPtr&lt;WebSafeFullGCActivityCallback&gt; create(JSC::Heap* heap)
</ins><span class="cx">     {
</span><del>-        return adoptPtr(new WebSafeGCActivityCallback(heap));
</del><ins>+        return adoptPtr(new WebSafeFullGCActivityCallback(heap));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual ~WebSafeGCActivityCallback() override { }
</del><ins>+    virtual ~WebSafeFullGCActivityCallback() override { }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    WebSafeGCActivityCallback(JSC::Heap* heap)
-        : JSC::DefaultGCActivityCallback(heap, WebThreadRunLoop())
</del><ins>+    WebSafeFullGCActivityCallback(JSC::Heap* heap)
+        : JSC::FullGCActivityCallback(heap, WebThreadRunLoop())
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class WebSafeEdenGCActivityCallback final : public JSC::EdenGCActivityCallback {
+public:
+    static PassOwnPtr&lt;WebSafeEdenGCActivityCallback&gt; create(JSC::Heap* heap)
+    {
+        return adoptPtr(new WebSafeEdenGCActivityCallback(heap));
+    }
+
+    virtual ~WebSafeEdenGCActivityCallback() override { }
+
+private:
+    WebSafeEdenGCActivityCallback(JSC::Heap* heap)
+        : JSC::EdenGCActivityCallback(heap, WebThreadRunLoop())
+    {
+    }
+};
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // WebSafeGCActivityCallbackIOS_h
</span></span></pre>
</div>
</div>

</body>
</html>