<!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>[165282] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165282">165282</a></dd>
<dt>Author</dt> <dd>mhahnenberg@apple.com</dd>
<dt>Date</dt> <dd>2014-03-07 13:28:43 -0800 (Fri, 07 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move GCActivityCallback to heap
https://bugs.webkit.org/show_bug.cgi?id=129457
Reviewed by Geoffrey Garen.
All the other GC timer related stuff is there already.
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/GCActivityCallback.cpp: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.cpp.
* heap/GCActivityCallback.h: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.h.
* runtime/GCActivityCallback.cpp: Removed.
* runtime/GCActivityCallback.h: Removed.</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>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreheapGCActivityCallbackcpp">trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapGCActivityCallbackh">trunk/Source/JavaScriptCore/heap/GCActivityCallback.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreruntimeGCActivityCallbackcpp">trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeGCActivityCallbackh">trunk/Source/JavaScriptCore/runtime/GCActivityCallback.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 (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -215,6 +215,7 @@
</span><span class="cx"> heap/CopiedSpace.cpp
</span><span class="cx"> heap/CopyVisitor.cpp
</span><span class="cx"> heap/DeferGC.cpp
</span><ins>+ heap/GCActivityCallback.cpp
</ins><span class="cx"> heap/GCThread.cpp
</span><span class="cx"> heap/GCThreadSharedData.cpp
</span><span class="cx"> heap/HandleSet.cpp
</span><span class="lines">@@ -372,7 +373,6 @@
</span><span class="cx"> runtime/FunctionConstructor.cpp
</span><span class="cx"> runtime/FunctionExecutableDump.cpp
</span><span class="cx"> runtime/FunctionPrototype.cpp
</span><del>- runtime/GCActivityCallback.cpp
</del><span class="cx"> runtime/GetterSetter.cpp
</span><span class="cx"> runtime/Identifier.cpp
</span><span class="cx"> runtime/IndexingType.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-03-07 Mark Hahnenberg <mhahnenberg@apple.com>
+
+ Move GCActivityCallback to heap
+ https://bugs.webkit.org/show_bug.cgi?id=129457
+
+ Reviewed by Geoffrey Garen.
+
+ All the other GC timer related stuff is there already.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * heap/GCActivityCallback.cpp: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.cpp.
+ * heap/GCActivityCallback.h: Copied from Source/JavaScriptCore/runtime/GCActivityCallback.h.
+ * runtime/GCActivityCallback.cpp: Removed.
+ * runtime/GCActivityCallback.h: Removed.
+
</ins><span class="cx"> 2014-03-07 Andrew Trick <atrick@apple.com>
</span><span class="cx">
</span><span class="cx"> Correct a comment typo from:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/GNUmakefile.list.am (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/GNUmakefile.list.am        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -557,6 +557,8 @@
</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/GCActivityCallback.cpp \
+        Source/JavaScriptCore/heap/GCActivityCallback.h \
</ins><span class="cx">         Source/JavaScriptCore/heap/GCSegmentedArray.h \
</span><span class="cx">         Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h \
</span><span class="cx">         Source/JavaScriptCore/heap/GCAssertions.h \
</span><span class="lines">@@ -995,8 +997,6 @@
</span><span class="cx">         Source/JavaScriptCore/runtime/FunctionExecutableDump.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/FunctionPrototype.cpp \
</span><span class="cx">         Source/JavaScriptCore/runtime/FunctionPrototype.h \
</span><del>-        Source/JavaScriptCore/runtime/GCActivityCallback.cpp \
-        Source/JavaScriptCore/runtime/GCActivityCallback.h \
</del><span class="cx">         Source/JavaScriptCore/runtime/GenericTypedArrayView.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/GenericTypedArrayViewInlines.h \
</span><span class="cx">         Source/JavaScriptCore/runtime/GetterSetter.cpp \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -463,6 +463,7 @@
</span><span class="cx"> <ClCompile Include="..\heap\CopiedSpace.cpp" />
</span><span class="cx"> <ClCompile Include="..\heap\CopyVisitor.cpp" />
</span><span class="cx"> <ClCompile Include="..\heap\DeferGC.cpp" />
</span><ins>+ <ClCompile Include="..\heap\GCActivityCallback.cpp" />
</ins><span class="cx"> <ClCompile Include="..\heap\GCThread.cpp" />
</span><span class="cx"> <ClCompile Include="..\heap\GCThreadSharedData.cpp" />
</span><span class="cx"> <ClCompile Include="..\heap\HandleSet.cpp" />
</span><span class="lines">@@ -619,7 +620,6 @@
</span><span class="cx"> <ClCompile Include="..\runtime\FunctionConstructor.cpp" />
</span><span class="cx"> <ClCompile Include="..\runtime\FunctionExecutableDump.cpp" />
</span><span class="cx"> <ClCompile Include="..\runtime\FunctionPrototype.cpp" />
</span><del>- <ClCompile Include="..\runtime\GCActivityCallback.cpp" />
</del><span class="cx"> <ClCompile Include="..\runtime\GetterSetter.cpp" />
</span><span class="cx"> <ClCompile Include="..\runtime\Identifier.cpp" />
</span><span class="cx"> <ClCompile Include="..\runtime\IndexingType.cpp" />
</span><span class="lines">@@ -1043,6 +1043,7 @@
</span><span class="cx"> <ClInclude Include="..\heap\CopyWriteBarrier.h" />
</span><span class="cx"> <ClInclude Include="..\heap\DeferGC.h" />
</span><span class="cx"> <ClInclude Include="..\heap\DelayedReleaseScope.h" />
</span><ins>+ <ClInclude Include="..\heap\GCActivityCallback.h" />
</ins><span class="cx"> <ClInclude Include="..\heap\GCSegmentedArray.h" />
</span><span class="cx"> <ClInclude Include="..\heap\GCSegmentedArrayInlines.h" />
</span><span class="cx"> <ClInclude Include="..\heap\GCAssertions.h" />
</span><span class="lines">@@ -1267,7 +1268,6 @@
</span><span class="cx"> <ClInclude Include="..\runtime\FunctionConstructor.h" />
</span><span class="cx"> <ClInclude Include="..\runtime\FunctionExecutableDump.h" />
</span><span class="cx"> <ClInclude Include="..\runtime\FunctionPrototype.h" />
</span><del>- <ClInclude Include="..\runtime\GCActivityCallback.h" />
</del><span class="cx"> <ClInclude Include="..\runtime\GenericTypedArrayView.h" />
</span><span class="cx"> <ClInclude Include="..\runtime\GenericTypedArrayViewInlines.h" />
</span><span class="cx"> <ClInclude Include="..\runtime\GetterSetter.h" />
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -228,6 +228,9 @@
</span><span class="cx"> <ClCompile Include="..\heap\CopyVisitor.cpp">
</span><span class="cx"> <Filter>heap</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\heap\GCActivityCallback.cpp">
+ <Filter>heap</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\heap\GCThread.cpp">
</span><span class="cx"> <Filter>heap</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -570,9 +573,6 @@
</span><span class="cx"> <ClCompile Include="..\runtime\FunctionPrototype.cpp">
</span><span class="cx"> <Filter>runtime</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="..\runtime\GCActivityCallback.cpp">
- <Filter>runtime</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\runtime\GetterSetter.cpp">
</span><span class="cx"> <Filter>runtime</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -1685,6 +1685,9 @@
</span><span class="cx"> <ClInclude Include="..\heap\DeferGC.h">
</span><span class="cx"> <Filter>heap</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\heap\GCActivityCallback.h">
+ <Filter>heap</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\heap\GCSegmentedArray.h">
</span><span class="cx"> <Filter>heap</Filter>
</span><span class="cx"> </ClInclude>
</span><span class="lines">@@ -2198,9 +2201,6 @@
</span><span class="cx"> <ClInclude Include="..\runtime\FunctionPrototype.h">
</span><span class="cx"> <Filter>runtime</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="..\runtime\GCActivityCallback.h">
- <Filter>runtime</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\runtime\GetterSetter.h">
</span><span class="cx"> <Filter>runtime</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -784,6 +784,8 @@
</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><span class="cx">                 2AAAA31218BD49D100394CC8 /* StructureIDBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAAA31018BD49D100394CC8 /* StructureIDBlob.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                2AACE63C18CA5A0300ED0191 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */; };
+                2AACE63D18CA5A0300ED0191 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AACE63B18CA5A0300ED0191 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2AAD964A18569417001F93BE /* RecursiveAllocationScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAD964918569417001F93BE /* RecursiveAllocationScope.h */; };
</span><span class="cx">                 2AC922BB18A16182003CE0FB /* FTLDWARFDebugLineInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AC922B918A16182003CE0FB /* FTLDWARFDebugLineInfo.cpp */; };
</span><span class="cx">                 2AC922BC18A16182003CE0FB /* FTLDWARFDebugLineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AC922BA18A16182003CE0FB /* FTLDWARFDebugLineInfo.h */; };
</span><span class="lines">@@ -1423,7 +1425,6 @@
</span><span class="cx">                 C2C8D03114A3CEFC00578E65 /* HeapBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */; };
</span><span class="cx">                 C2CF39C216E15A8100DD69BE /* JSAPIWrapperObject.h in Headers */ = {isa = PBXBuildFile; fileRef = C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */; };
</span><del>-                C2D58C3415912FEE0021A844 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */; };
</del><span class="cx">                 C2DF442F1707AC0100A5CA96 /* SuperRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */; };
</span><span class="cx">                 C2DF44301707AC0100A5CA96 /* SuperRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = C2DF442E1707AC0100A5CA96 /* SuperRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2E526BD1590EF000054E48D /* HeapTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2E526BB1590EF000054E48D /* HeapTimer.cpp */; };
</span><span class="lines">@@ -1437,7 +1438,6 @@
</span><span class="cx">                 C2FCAE1217A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */; };
</span><span class="cx">                 C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C2FE18A416BAEC4000AF3061 /* StructureRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = C2FE18A316BAEC4000AF3061 /* StructureRareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */ = {isa = PBXBuildFile; fileRef = E124A8F50E555775003091F1 /* OpaqueJSString.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E124A8F60E555775003091F1 /* OpaqueJSString.cpp */; };
</span><span class="cx">                 E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */; };
</span><span class="lines">@@ -2263,6 +2263,8 @@
</span><span class="cx">                 2A6F462517E959CE00C45C98 /* HeapOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapOperation.h; sourceTree = "<group>"; };
</span><span class="cx">                 2A7A58EE1808A4C40020BDF7 /* DeferGC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeferGC.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2AAAA31018BD49D100394CC8 /* StructureIDBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureIDBlob.h; sourceTree = "<group>"; };
</span><ins>+                2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCActivityCallback.cpp; sourceTree = "<group>"; };
+                2AACE63B18CA5A0300ED0191 /* GCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCActivityCallback.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2AAD964918569417001F93BE /* RecursiveAllocationScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecursiveAllocationScope.h; sourceTree = "<group>"; };
</span><span class="cx">                 2AC922B918A16182003CE0FB /* FTLDWARFDebugLineInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLDWARFDebugLineInfo.cpp; path = ftl/FTLDWARFDebugLineInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2AC922BA18A16182003CE0FB /* FTLDWARFDebugLineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLDWARFDebugLineInfo.h; path = ftl/FTLDWARFDebugLineInfo.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -2955,7 +2957,6 @@
</span><span class="cx">                 C2C8D02F14A3CEFC00578E65 /* HeapBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapBlock.h; sourceTree = "<group>"; };
</span><span class="cx">                 C2CF39BF16E15A8100DD69BE /* JSAPIWrapperObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JSAPIWrapperObject.mm; sourceTree = "<group>"; };
</span><span class="cx">                 C2CF39C016E15A8100DD69BE /* JSAPIWrapperObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAPIWrapperObject.h; sourceTree = "<group>"; };
</span><del>-                C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCActivityCallback.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 C2DF442D1707AC0100A5CA96 /* SuperRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SuperRegion.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 C2DF442E1707AC0100A5CA96 /* SuperRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuperRegion.h; sourceTree = "<group>"; };
</span><span class="cx">                 C2E526BB1590EF000054E48D /* HeapTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapTimer.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -2971,7 +2972,6 @@
</span><span class="cx">                 C2FE18A316BAEC4000AF3061 /* StructureRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureRareData.h; sourceTree = "<group>"; };
</span><span class="cx">                 D21202280AD4310C00ED79B6 /* DateConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DateConversion.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 D21202290AD4310C00ED79B6 /* DateConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DateConversion.h; sourceTree = "<group>"; };
</span><del>-                DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCActivityCallback.h; sourceTree = "<group>"; };
</del><span class="cx">                 E124A8F50E555775003091F1 /* OpaqueJSString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpaqueJSString.h; sourceTree = "<group>"; };
</span><span class="cx">                 E124A8F60E555775003091F1 /* OpaqueJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpaqueJSString.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E178633F0D9BEC0000D74E75 /* InitializeThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeThreading.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -3497,6 +3497,8 @@
</span><span class="cx">                 142E312A134FF0A600AFADB5 /* heap */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */,
+                                2AACE63B18CA5A0300ED0191 /* GCActivityCallback.h */,
</ins><span class="cx">                                 14816E19154CC56C00B8054C /* BlockAllocator.cpp */,
</span><span class="cx">                                 14816E1A154CC56C00B8054C /* BlockAllocator.h */,
</span><span class="cx">                                 0FD8A31117D4326C00CA2C40 /* CodeBlockSet.cpp */,
</span><span class="lines">@@ -3923,8 +3925,6 @@
</span><span class="cx">                                 0FB4B52216B6278D003F696B /* FunctionExecutableDump.h */,
</span><span class="cx">                                 F692A85C0255597D01FF60F7 /* FunctionPrototype.cpp */,
</span><span class="cx">                                 F692A85D0255597D01FF60F7 /* FunctionPrototype.h */,
</span><del>-                                C2D58C3315912FEE0021A844 /* GCActivityCallback.cpp */,
-                                DDF7ABD211F60ED200108E36 /* GCActivityCallback.h */,
</del><span class="cx">                                 0F2B66B217B6B5AB00A7AE3F /* GenericTypedArrayView.h */,
</span><span class="cx">                                 0F2B66B317B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h */,
</span><span class="cx">                                 BC02E9B80E184545000F9297 /* GetterSetter.cpp */,
</span><span class="lines">@@ -4912,6 +4912,7 @@
</span><span class="cx">                                 A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
</span><span class="cx">                                 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
</span><span class="cx">                                 A584032018BFFBE1005A0811 /* InspectorAgent.h in Headers */,
</span><ins>+                                2AACE63D18CA5A0300ED0191 /* GCActivityCallback.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">@@ -5229,7 +5230,6 @@
</span><span class="cx">                                 BC18C4040E16F5CD00B34460 /* FunctionConstructor.h in Headers */,
</span><span class="cx">                                 0FF0F1A016B72A1A005DF95B /* FunctionExecutableDump.h in Headers */,
</span><span class="cx">                                 BC18C4050E16F5CD00B34460 /* FunctionPrototype.h in Headers */,
</span><del>-                                DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */,
</del><span class="cx">                                 BCBE2CAE14E985AA000593AD /* GCAssertions.h in Headers */,
</span><span class="cx">                                 0F766D3015A8DCE2008F363E /* GCAwareJITStubRoutine.h in Headers */,
</span><span class="cx">                                 0F2B66AC17B6B53F00A7AE3F /* GCIncomingRefCounted.h in Headers */,
</span><span class="lines">@@ -6217,6 +6217,7 @@
</span><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><ins>+                                2AACE63C18CA5A0300ED0191 /* GCActivityCallback.cpp in Sources */,
</ins><span class="cx">                                 C2239D1716262BDD005AC5FD /* CopyVisitor.cpp in Sources */,
</span><span class="cx">                                 0F2B66DE17B6B5AB00A7AE3F /* DataView.cpp in Sources */,
</span><span class="cx">                                 147F39C3107EC37600427A48 /* DateConstructor.cpp in Sources */,
</span><span class="lines">@@ -6391,7 +6392,6 @@
</span><span class="cx">                                 147F39CB107EC37600427A48 /* FunctionConstructor.cpp in Sources */,
</span><span class="cx">                                 0FF0F19F16B72A17005DF95B /* FunctionExecutableDump.cpp in Sources */,
</span><span class="cx">                                 147F39CC107EC37600427A48 /* FunctionPrototype.cpp in Sources */,
</span><del>-                                C2D58C3415912FEE0021A844 /* GCActivityCallback.cpp in Sources */,
</del><span class="cx">                                 0F766D2F15A8DCE0008F363E /* GCAwareJITStubRoutine.cpp in Sources */,
</span><span class="cx">                                 C2239D1A16262BDD005AC5FD /* GCThread.cpp in Sources */,
</span><span class="cx">                                 C21122E115DD9AB300790E3A /* GCThreadSharedData.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCActivityCallbackcppfromrev165280trunkSourceJavaScriptCoreruntimeGCActivityCallbackcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp (from rev 165280, trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp) (0 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp         (rev 0)
+++ trunk/Source/JavaScriptCore/heap/GCActivityCallback.cpp        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -0,0 +1,196 @@
</span><ins>+/*
+ * Copyright (C) 2010 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
+#include "GCActivityCallback.h"
+
+#include "Heap.h"
+#include "JSLock.h"
+#include "JSObject.h"
+#include "VM.h"
+
+#include <wtf/RetainPtr.h>
+#include <wtf/WTFThreadData.h>
+
+#if PLATFORM(EFL)
+#include <wtf/MainThread.h>
+#endif
+
+namespace JSC {
+
+bool GCActivityCallback::s_shouldCreateGCTimer = true;
+
+#if USE(CF) || PLATFORM(EFL)
+
+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.
+const double timerSlop = 2.0; // Fudge factor to avoid performance cost of resetting timer.
+
+#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
+
+#if USE(CF)
+DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
+ : GCActivityCallback(heap->vm(), CFRunLoopGetCurrent())
+ , m_delay(s_decade)
+{
+}
+
+DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
+ : GCActivityCallback(heap->vm(), runLoop)
+ , m_delay(s_decade)
+{
+}
+#elif PLATFORM(EFL)
+DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
+ : GCActivityCallback(heap->vm(), WTF::isMainThread())
+ , m_delay(hour)
+{
+}
+#endif
+
+void DefaultGCActivityCallback::doWork()
+{
+ Heap* heap = &m_vm->heap;
+ if (!isEnabled())
+ return;
+
+ JSLockHolder locker(m_vm);
+ if (heap->isDeferred()) {
+ scheduleTimer(0);
+ return;
+ }
+
+#if !PLATFORM(IOS)
+ double startTime = WTF::monotonicallyIncreasingTime();
+ if (heap->isPagedOut(startTime + pagingTimeOut)) {
+ heap->activityCallback()->cancel();
+ heap->increaseLastGCLength(pagingTimeOut);
+ return;
+ }
+#endif
+ heap->gcTimerDidFire();
+ heap->collect();
+}
+
+#if USE(CF)
+void DefaultGCActivityCallback::scheduleTimer(double newDelay)
+{
+ if (newDelay * timerSlop > m_delay)
+ return;
+ double delta = m_delay - newDelay;
+ m_delay = newDelay;
+ CFRunLoopTimerSetNextFireDate(m_timer.get(), CFRunLoopTimerGetNextFireDate(m_timer.get()) - delta);
+}
+
+void DefaultGCActivityCallback::cancelTimer()
+{
+ m_delay = s_decade;
+ CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade);
+}
+#elif PLATFORM(EFL)
+void DefaultGCActivityCallback::scheduleTimer(double newDelay)
+{
+ if (newDelay * timerSlop > m_delay)
+ return;
+
+ stop();
+ m_delay = newDelay;
+
+ ASSERT(!m_timer);
+ m_timer = add(newDelay, this);
+}
+
+void DefaultGCActivityCallback::cancelTimer()
+{
+ m_delay = hour;
+ stop();
+}
+#endif
+
+void DefaultGCActivityCallback::didAllocate(size_t bytes)
+{
+#if PLATFORM(EFL)
+ if (!isEnabled())
+ return;
+
+ ASSERT(WTF::isMainThread());
+#endif
+
+ // The first byte allocated in an allocation cycle will report 0 bytes to didAllocate.
+ // We pretend it's one byte so that we don't ignore this allocation entirely.
+ if (!bytes)
+ bytes = 1;
+ Heap* heap = static_cast<Heap*>(&m_vm->heap);
+ double gcTimeSlice = std::min((static_cast<double>(bytes) / MB) * gcTimeSlicePerMB, maxGCTimeSlice);
+ double newDelay = heap->lastGCLength() / gcTimeSlice;
+ scheduleTimer(newDelay);
+}
+
+void DefaultGCActivityCallback::willCollect()
+{
+ cancelTimer();
+}
+
+void DefaultGCActivityCallback::cancel()
+{
+ cancelTimer();
+}
+
+#else
+
+DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
+ : GCActivityCallback(heap->vm())
+{
+}
+
+void DefaultGCActivityCallback::doWork()
+{
+}
+
+void DefaultGCActivityCallback::didAllocate(size_t)
+{
+}
+
+void DefaultGCActivityCallback::willCollect()
+{
+}
+
+void DefaultGCActivityCallback::cancel()
+{
+}
+
+#endif
+
+}
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapGCActivityCallbackhfromrev165280trunkSourceJavaScriptCoreruntimeGCActivityCallbackh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/heap/GCActivityCallback.h (from rev 165280, trunk/Source/JavaScriptCore/runtime/GCActivityCallback.h) (0 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/GCActivityCallback.h         (rev 0)
+++ trunk/Source/JavaScriptCore/heap/GCActivityCallback.h        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+/*
+ * Copyright (C) 2010 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 GCActivityCallback_h
+#define GCActivityCallback_h
+
+#include "HeapTimer.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+#if USE(CF)
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+namespace JSC {
+
+class Heap;
+
+class GCActivityCallback : public HeapTimer {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ virtual void didAllocate(size_t) { }
+ virtual void willCollect() { }
+ virtual void cancel() { }
+ bool isEnabled() const { return m_enabled; }
+ void setEnabled(bool enabled) { m_enabled = enabled; }
+
+ static bool s_shouldCreateGCTimer;
+
+protected:
+#if USE(CF)
+ GCActivityCallback(VM* vm, CFRunLoopRef runLoop)
+ : HeapTimer(vm, runLoop)
+ , m_enabled(true)
+ {
+ }
+#elif PLATFORM(EFL)
+ GCActivityCallback(VM* vm, bool flag)
+ : HeapTimer(vm)
+ , m_enabled(flag)
+ {
+ }
+#else
+ GCActivityCallback(VM* vm)
+ : HeapTimer(vm)
+ , m_enabled(true)
+ {
+ }
+#endif
+
+ bool m_enabled;
+};
+
+class DefaultGCActivityCallback : public GCActivityCallback {
+public:
+ static PassOwnPtr<DefaultGCActivityCallback> 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;
+
+#if USE(CF)
+protected:
+ JS_EXPORT_PRIVATE DefaultGCActivityCallback(Heap*, CFRunLoopRef);
+#endif
+#if USE(CF) || PLATFORM(EFL)
+protected:
+ void cancelTimer();
+ void scheduleTimer(double);
+
+private:
+ double m_delay;
+#endif
+};
+
+inline PassOwnPtr<DefaultGCActivityCallback> DefaultGCActivityCallback::create(Heap* heap)
+{
+ return GCActivityCallback::s_shouldCreateGCTimer ? adoptPtr(new DefaultGCActivityCallback(heap)) : nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGCActivityCallbackcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/runtime/GCActivityCallback.cpp        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -1,196 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
-#include "GCActivityCallback.h"
-
-#include "Heap.h"
-#include "VM.h"
-#include "JSLock.h"
-#include "JSObject.h"
-
-#include <wtf/RetainPtr.h>
-#include <wtf/WTFThreadData.h>
-
-#if PLATFORM(EFL)
-#include <wtf/MainThread.h>
-#endif
-
-namespace JSC {
-
-bool GCActivityCallback::s_shouldCreateGCTimer = true;
-
-#if USE(CF) || PLATFORM(EFL)
-
-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.
-const double timerSlop = 2.0; // Fudge factor to avoid performance cost of resetting timer.
-
-#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
-
-#if USE(CF)
-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
- : GCActivityCallback(heap->vm(), CFRunLoopGetCurrent())
- , m_delay(s_decade)
-{
-}
-
-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap, CFRunLoopRef runLoop)
- : GCActivityCallback(heap->vm(), runLoop)
- , m_delay(s_decade)
-{
-}
-#elif PLATFORM(EFL)
-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
- : GCActivityCallback(heap->vm(), WTF::isMainThread())
- , m_delay(hour)
-{
-}
-#endif
-
-void DefaultGCActivityCallback::doWork()
-{
- Heap* heap = &m_vm->heap;
- if (!isEnabled())
- return;
-
- JSLockHolder locker(m_vm);
- if (heap->isDeferred()) {
- scheduleTimer(0);
- return;
- }
-
-#if !PLATFORM(IOS)
- double startTime = WTF::monotonicallyIncreasingTime();
- if (heap->isPagedOut(startTime + pagingTimeOut)) {
- heap->activityCallback()->cancel();
- heap->increaseLastGCLength(pagingTimeOut);
- return;
- }
-#endif
- heap->gcTimerDidFire();
- heap->collect();
-}
-
-#if USE(CF)
-void DefaultGCActivityCallback::scheduleTimer(double newDelay)
-{
- if (newDelay * timerSlop > m_delay)
- return;
- double delta = m_delay - newDelay;
- m_delay = newDelay;
- CFRunLoopTimerSetNextFireDate(m_timer.get(), CFRunLoopTimerGetNextFireDate(m_timer.get()) - delta);
-}
-
-void DefaultGCActivityCallback::cancelTimer()
-{
- m_delay = s_decade;
- CFRunLoopTimerSetNextFireDate(m_timer.get(), CFAbsoluteTimeGetCurrent() + s_decade);
-}
-#elif PLATFORM(EFL)
-void DefaultGCActivityCallback::scheduleTimer(double newDelay)
-{
- if (newDelay * timerSlop > m_delay)
- return;
-
- stop();
- m_delay = newDelay;
-
- ASSERT(!m_timer);
- m_timer = add(newDelay, this);
-}
-
-void DefaultGCActivityCallback::cancelTimer()
-{
- m_delay = hour;
- stop();
-}
-#endif
-
-void DefaultGCActivityCallback::didAllocate(size_t bytes)
-{
-#if PLATFORM(EFL)
- if (!isEnabled())
- return;
-
- ASSERT(WTF::isMainThread());
-#endif
-
- // The first byte allocated in an allocation cycle will report 0 bytes to didAllocate.
- // We pretend it's one byte so that we don't ignore this allocation entirely.
- if (!bytes)
- bytes = 1;
- Heap* heap = static_cast<Heap*>(&m_vm->heap);
- double gcTimeSlice = std::min((static_cast<double>(bytes) / MB) * gcTimeSlicePerMB, maxGCTimeSlice);
- double newDelay = heap->lastGCLength() / gcTimeSlice;
- scheduleTimer(newDelay);
-}
-
-void DefaultGCActivityCallback::willCollect()
-{
- cancelTimer();
-}
-
-void DefaultGCActivityCallback::cancel()
-{
- cancelTimer();
-}
-
-#else
-
-DefaultGCActivityCallback::DefaultGCActivityCallback(Heap* heap)
- : GCActivityCallback(heap->vm())
-{
-}
-
-void DefaultGCActivityCallback::doWork()
-{
-}
-
-void DefaultGCActivityCallback::didAllocate(size_t)
-{
-}
-
-void DefaultGCActivityCallback::willCollect()
-{
-}
-
-void DefaultGCActivityCallback::cancel()
-{
-}
-
-#endif
-
-}
-
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeGCActivityCallbackh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/runtime/GCActivityCallback.h (165281 => 165282)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/GCActivityCallback.h        2014-03-07 21:15:15 UTC (rev 165281)
+++ trunk/Source/JavaScriptCore/runtime/GCActivityCallback.h        2014-03-07 21:28:43 UTC (rev 165282)
</span><span class="lines">@@ -1,112 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 GCActivityCallback_h
-#define GCActivityCallback_h
-
-#include "HeapTimer.h"
-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
-
-#if USE(CF)
-#include <CoreFoundation/CoreFoundation.h>
-#endif
-
-namespace JSC {
-
-class Heap;
-
-class GCActivityCallback : public HeapTimer {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- virtual void didAllocate(size_t) { }
- virtual void willCollect() { }
- virtual void cancel() { }
- bool isEnabled() const { return m_enabled; }
- void setEnabled(bool enabled) { m_enabled = enabled; }
-
- static bool s_shouldCreateGCTimer;
-
-protected:
-#if USE(CF)
- GCActivityCallback(VM* vm, CFRunLoopRef runLoop)
- : HeapTimer(vm, runLoop)
- , m_enabled(true)
- {
- }
-#elif PLATFORM(EFL)
- GCActivityCallback(VM* vm, bool flag)
- : HeapTimer(vm)
- , m_enabled(flag)
- {
- }
-#else
- GCActivityCallback(VM* vm)
- : HeapTimer(vm)
- , m_enabled(true)
- {
- }
-#endif
-
- bool m_enabled;
-};
-
-class DefaultGCActivityCallback : public GCActivityCallback {
-public:
- static PassOwnPtr<DefaultGCActivityCallback> 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;
-
-#if USE(CF)
-protected:
- JS_EXPORT_PRIVATE DefaultGCActivityCallback(Heap*, CFRunLoopRef);
-#endif
-#if USE(CF) || PLATFORM(EFL)
-protected:
- void cancelTimer();
- void scheduleTimer(double);
-
-private:
- double m_delay;
-#endif
-};
-
-inline PassOwnPtr<DefaultGCActivityCallback> DefaultGCActivityCallback::create(Heap* heap)
-{
- return GCActivityCallback::s_shouldCreateGCTimer ? adoptPtr(new DefaultGCActivityCallback(heap)) : nullptr;
-}
-
-}
-
-#endif
</del></span></pre>
</div>
</div>
</body>
</html>