<!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>[168178] 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/168178">168178</a></dd>
<dt>Author</dt> <dd>mhahnenberg@apple.com</dd>
<dt>Date</dt> <dd>2014-05-02 11:52:10 -0700 (Fri, 02 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a DFG function whitelist
https://bugs.webkit.org/show_bug.cgi?id=132437

Reviewed by Geoffrey Garen.

Often times when debugging, using bytecode ranges isn't enough to narrow down to the 
particular DFG block that's causing issues. This patch adds the ability to whitelist 
specific functions specified in a file to enable further filtering without having to recompile.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCapabilities.cpp:
(JSC::DFG::isSupported):
(JSC::DFG::mightInlineFunctionForCall):
(JSC::DFG::mightInlineFunctionForClosureCall):
(JSC::DFG::mightInlineFunctionForConstruct):
* dfg/DFGFunctionWhitelist.cpp: Added.
(JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist):
(JSC::DFG::FunctionWhitelist::FunctionWhitelist):
(JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
(JSC::DFG::FunctionWhitelist::contains):
* dfg/DFGFunctionWhitelist.h: Added.
* runtime/Options.cpp:
(JSC::parse):
(JSC::Options::dumpOption):
* runtime/Options.h:</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="#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="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockh">trunk/Source/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCapabilitiescpp">trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCapabilitiesh">trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionscpp">trunk/Source/JavaScriptCore/runtime/Options.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionsh">trunk/Source/JavaScriptCore/runtime/Options.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoredfgDFGFunctionWhitelistcpp">trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGFunctionWhitelisth">trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.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 (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -144,6 +144,7 @@
</span><span class="cx">     dfg/DFGFixupPhase.cpp
</span><span class="cx">     dfg/DFGFlushFormat.cpp
</span><span class="cx">     dfg/DFGFlushedAt.cpp
</span><ins>+    dfg/DFGFunctionWhitelist.cpp
</ins><span class="cx">     dfg/DFGGraph.cpp
</span><span class="cx">     dfg/DFGGraphSafepoint.cpp
</span><span class="cx">     dfg/DFGInPlaceAbstractState.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-05-01  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
+
+        Add a DFG function whitelist
+        https://bugs.webkit.org/show_bug.cgi?id=132437
+
+        Reviewed by Geoffrey Garen.
+
+        Often times when debugging, using bytecode ranges isn't enough to narrow down to the 
+        particular DFG block that's causing issues. This patch adds the ability to whitelist 
+        specific functions specified in a file to enable further filtering without having to recompile.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * dfg/DFGCapabilities.cpp:
+        (JSC::DFG::isSupported):
+        (JSC::DFG::mightInlineFunctionForCall):
+        (JSC::DFG::mightInlineFunctionForClosureCall):
+        (JSC::DFG::mightInlineFunctionForConstruct):
+        * dfg/DFGFunctionWhitelist.cpp: Added.
+        (JSC::DFG::FunctionWhitelist::ensureGlobalWhitelist):
+        (JSC::DFG::FunctionWhitelist::FunctionWhitelist):
+        (JSC::DFG::FunctionWhitelist::parseFunctionNamesInFile):
+        (JSC::DFG::FunctionWhitelist::contains):
+        * dfg/DFGFunctionWhitelist.h: Added.
+        * runtime/Options.cpp:
+        (JSC::parse):
+        (JSC::Options::dumpOption):
+        * runtime/Options.h:
+
</ins><span class="cx"> 2014-05-02  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DFGAbstractInterpreter should not claim Int52 arithmetic creates Int52s
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -395,6 +395,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFixupPhase.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFlushedAt.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFlushFormat.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dfg\DFGFunctionWhitelist.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGGraph.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGGraphSafepoint.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGInPlaceAbstractState.cpp&quot; /&gt;
</span><span class="lines">@@ -954,6 +955,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFlushedAt.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFlushFormat.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFPRInfo.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dfg\DFGFunctionWhitelist.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGGenerationInfo.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGGPRInfo.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGGraph.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -1089,6 +1089,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGFlushLivenessAnalysisPhase.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dfg\DFGFunctionWhitelist.cpp&quot;&gt;
+      &lt;Filter&gt;dfg&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dfg\DFGGraph.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -3042,6 +3045,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGFPRInfo.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dfg\DFGFunctionWhitelist.h&quot;&gt;
+      &lt;Filter&gt;dfg&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dfg\DFGGenerationInfo.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;dfg&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 (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -801,6 +801,8 @@
</span><span class="cx">                 2A83638618D7D0EE0000EBCC /* EdenGCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A83638418D7D0EE0000EBCC /* EdenGCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2A83638918D7D0FE0000EBCC /* FullGCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A83638718D7D0FE0000EBCC /* FullGCActivityCallback.cpp */; };
</span><span class="cx">                 2A83638A18D7D0FE0000EBCC /* FullGCActivityCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A83638818D7D0FE0000EBCC /* FullGCActivityCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                2A88067819107D5500CB0BBB /* DFGFunctionWhitelist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2A88067619107D5500CB0BBB /* DFGFunctionWhitelist.cpp */; };
+                2A88067919107D5500CB0BBB /* DFGFunctionWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A88067719107D5500CB0BBB /* DFGFunctionWhitelist.h */; };
</ins><span class="cx">                 2AAAA31218BD49D100394CC8 /* StructureIDBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AAAA31018BD49D100394CC8 /* StructureIDBlob.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2AABCDE718EF294200002096 /* GCLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AABCDE618EF294200002096 /* GCLogging.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2AACE63C18CA5A0300ED0191 /* GCActivityCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AACE63A18CA5A0300ED0191 /* GCActivityCallback.cpp */; };
</span><span class="lines">@@ -2569,6 +2571,8 @@
</span><span class="cx">                 2A83638418D7D0EE0000EBCC /* EdenGCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EdenGCActivityCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2A83638718D7D0FE0000EBCC /* FullGCActivityCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FullGCActivityCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2A83638818D7D0FE0000EBCC /* FullGCActivityCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullGCActivityCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2A88067619107D5500CB0BBB /* DFGFunctionWhitelist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGFunctionWhitelist.cpp; path = dfg/DFGFunctionWhitelist.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2A88067719107D5500CB0BBB /* DFGFunctionWhitelist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGFunctionWhitelist.h; path = dfg/DFGFunctionWhitelist.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">                 2AABCDE618EF294200002096 /* GCLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCLogging.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="lines">@@ -4826,6 +4830,8 @@
</span><span class="cx">                                 0FC97F3C18202119002C9B26 /* DFGWatchpointCollectionPhase.h */,
</span><span class="cx">                                 0FDB2CE5174830A2007B3C1B /* DFGWorklist.cpp */,
</span><span class="cx">                                 0FDB2CE6174830A2007B3C1B /* DFGWorklist.h */,
</span><ins>+                                2A88067619107D5500CB0BBB /* DFGFunctionWhitelist.cpp */,
+                                2A88067719107D5500CB0BBB /* DFGFunctionWhitelist.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = dfg;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -5475,6 +5481,7 @@
</span><span class="cx">                                 2A48D1911772365B00C65A5F /* APICallbackFunction.h in Headers */,
</span><span class="cx">                                 BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */,
</span><span class="cx">                                 BCF605140E203EF800B9A64D /* ArgList.h in Headers */,
</span><ins>+                                2A88067919107D5500CB0BBB /* DFGFunctionWhitelist.h in Headers */,
</ins><span class="cx">                                 BC257DE80E1F51C50016B6C9 /* Arguments.h in Headers */,
</span><span class="cx">                                 A76140CE182982CB00750624 /* ArgumentsIteratorConstructor.h in Headers */,
</span><span class="cx">                                 A76140D0182982CB00750624 /* ArgumentsIteratorPrototype.h in Headers */,
</span><span class="lines">@@ -6886,6 +6893,7 @@
</span><span class="cx">                                 0F714CA416EA92F000F3EBEB /* DFGBackwardsPropagationPhase.cpp in Sources */,
</span><span class="cx">                                 A7D89CF217A0B8CC00773AD8 /* DFGBasicBlock.cpp in Sources */,
</span><span class="cx">                                 A70B083217A0B79B00DAF14B /* DFGBinarySwitch.cpp in Sources */,
</span><ins>+                                2A88067819107D5500CB0BBB /* DFGFunctionWhitelist.cpp in Sources */,
</ins><span class="cx">                                 A7D89CF317A0B8CC00773AD8 /* DFGBlockInsertionSet.cpp in Sources */,
</span><span class="cx">                                 86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
</span><span class="cx">                                 0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -3587,4 +3587,18 @@
</span><span class="cx">         jettison(Profiler::JettisonDueToDebuggerStepping);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RareCaseProfile* CodeBlock::rareCaseProfileForBytecodeOffset(int bytecodeOffset)
+{
+    return tryBinarySearch&lt;RareCaseProfile, int&gt;(
+        m_rareCaseProfiles, m_rareCaseProfiles.size(), bytecodeOffset,
+        getRareCaseProfileBytecodeOffset);
+}
+
+DFG::CapabilityLevel CodeBlock::capabilityLevel()
+{
+    DFG::CapabilityLevel result = capabilityLevelInternal();
+    m_capabilityLevelState = result;
+    return result;
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.h (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.h        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -301,12 +301,7 @@
</span><span class="cx">     virtual CodeBlock* replacement() = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual DFG::CapabilityLevel capabilityLevelInternal() = 0;
</span><del>-    DFG::CapabilityLevel capabilityLevel()
-    {
-        DFG::CapabilityLevel result = capabilityLevelInternal();
-        m_capabilityLevelState = result;
-        return result;
-    }
</del><ins>+    DFG::CapabilityLevel capabilityLevel();
</ins><span class="cx">     DFG::CapabilityLevel capabilityLevelState() { return m_capabilityLevelState; }
</span><span class="cx"> 
</span><span class="cx">     bool hasOptimizedReplacement(JITCode::JITType typeToReplace);
</span><span class="lines">@@ -466,12 +461,7 @@
</span><span class="cx">     }
</span><span class="cx">     unsigned numberOfRareCaseProfiles() { return m_rareCaseProfiles.size(); }
</span><span class="cx">     RareCaseProfile* rareCaseProfile(int index) { return &amp;m_rareCaseProfiles[index]; }
</span><del>-    RareCaseProfile* rareCaseProfileForBytecodeOffset(int bytecodeOffset)
-    {
-        return tryBinarySearch&lt;RareCaseProfile, int&gt;(
-            m_rareCaseProfiles, m_rareCaseProfiles.size(), bytecodeOffset,
-            getRareCaseProfileBytecodeOffset);
-    }
</del><ins>+    RareCaseProfile* rareCaseProfileForBytecodeOffset(int bytecodeOffset);
</ins><span class="cx"> 
</span><span class="cx">     bool likelyToTakeSlowCase(int bytecodeOffset)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;DFGCommon.h&quot;
</span><ins>+#include &quot;DFGFunctionWhitelist.h&quot;
</ins><span class="cx"> #include &quot;Interpreter.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;Options.h&quot;
</span><span class="lines">@@ -40,7 +41,8 @@
</span><span class="cx"> {
</span><span class="cx">     return Options::useDFGJIT()
</span><span class="cx">         &amp;&amp; MacroAssembler::supportsFloatingPoint()
</span><del>-        &amp;&amp; Options::bytecodeRangeToDFGCompile().isInRange(codeBlock-&gt;instructionCount());
</del><ins>+        &amp;&amp; Options::bytecodeRangeToDFGCompile().isInRange(codeBlock-&gt;instructionCount())
+        &amp;&amp; FunctionWhitelist::ensureGlobalWhitelist().contains(codeBlock);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool mightCompileEval(CodeBlock* codeBlock)
</span><span class="lines">@@ -66,22 +68,19 @@
</span><span class="cx"> 
</span><span class="cx"> bool mightInlineFunctionForCall(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    return isSupported(codeBlock) 
-        &amp;&amp; codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForCallInlineCandidateInstructionCount()
</del><ins>+    return codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForCallInlineCandidateInstructionCount()
</ins><span class="cx">         &amp;&amp; !codeBlock-&gt;ownerExecutable()-&gt;needsActivation()
</span><span class="cx">         &amp;&amp; codeBlock-&gt;ownerExecutable()-&gt;isInliningCandidate();
</span><span class="cx"> }
</span><span class="cx"> bool mightInlineFunctionForClosureCall(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    return isSupported(codeBlock) 
-        &amp;&amp; codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount()
</del><ins>+    return codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForClosureCallInlineCandidateInstructionCount()
</ins><span class="cx">         &amp;&amp; !codeBlock-&gt;ownerExecutable()-&gt;needsActivation()
</span><span class="cx">         &amp;&amp; codeBlock-&gt;ownerExecutable()-&gt;isInliningCandidate();
</span><span class="cx"> }
</span><span class="cx"> bool mightInlineFunctionForConstruct(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    return isSupported(codeBlock) 
-        &amp;&amp; codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForConstructInlineCandidateInstructionCount()
</del><ins>+    return codeBlock-&gt;instructionCount() &lt;= Options::maximumFunctionForConstructInlineCandidateInstructionCount()
</ins><span class="cx">         &amp;&amp; !codeBlock-&gt;ownerExecutable()-&gt;needsActivation()
</span><span class="cx">         &amp;&amp; codeBlock-&gt;ownerExecutable()-&gt;isInliningCandidate();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCapabilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/dfg/DFGCapabilities.h        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -79,20 +79,34 @@
</span><span class="cx">     return capabilityLevel(codeBlock);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline CapabilityLevel functionForCallCapabilityLevel(CodeBlock* codeBlock)
</del><ins>+inline CapabilityLevel functionCapabilityLevel(bool mightCompile, bool mightInline, CapabilityLevel computedCapabilityLevel)
</ins><span class="cx"> {
</span><del>-    if (!mightCompileFunctionForCall(codeBlock))
</del><ins>+    if (mightCompile &amp;&amp; mightInline)
+        return leastUpperBound(CanCompileAndInline, computedCapabilityLevel);
+    if (mightCompile &amp;&amp; !mightInline)
+        return leastUpperBound(CanCompile, computedCapabilityLevel);
+    if (!mightCompile &amp;&amp; mightInline)
+        return leastUpperBound(CanInline, computedCapabilityLevel);
+    if (!mightCompile &amp;&amp; !mightInline)
</ins><span class="cx">         return CannotCompile;
</span><del>-    
-    return capabilityLevel(codeBlock);
</del><ins>+    RELEASE_ASSERT_NOT_REACHED();
+    return CannotCompile;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline CapabilityLevel functionForCallCapabilityLevel(CodeBlock* codeBlock)
+{
+    return functionCapabilityLevel(
+        mightCompileFunctionForCall(codeBlock),
+        mightInlineFunctionForCall(codeBlock),
+        capabilityLevel(codeBlock));
+}
+
</ins><span class="cx"> inline CapabilityLevel functionForConstructCapabilityLevel(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    if (!mightCompileFunctionForConstruct(codeBlock))
-        return CannotCompile;
-    
-    return capabilityLevel(codeBlock);
</del><ins>+    return functionCapabilityLevel(
+        mightCompileFunctionForConstruct(codeBlock),
+        mightInlineFunctionForConstruct(codeBlock),
+        capabilityLevel(codeBlock));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline CapabilityLevel inlineFunctionForCallCapabilityLevel(CodeBlock* codeBlock)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGFunctionWhitelistcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp (0 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.cpp        2014-05-02 18:52:10 UTC (rev 168178)
</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;DFGFunctionWhitelist.h&quot;
+
+#include &quot;CodeBlock.h&quot;
+#include &quot;Options.h&quot;
+#include &lt;stdio.h&gt;
+#include &lt;string.h&gt;
+#include &lt;wtf/text/StringBuilder.h&gt;
+
+namespace JSC { namespace DFG {
+
+static FunctionWhitelist* functionWhitelist;
+
+FunctionWhitelist&amp; FunctionWhitelist::ensureGlobalWhitelist()
+{
+    static std::once_flag initializeWhitelistFlag;
+    std::call_once(initializeWhitelistFlag, [] {
+        functionWhitelist = new FunctionWhitelist(Options::dfgFunctionWhitelistFile());
+    });
+    return *functionWhitelist;
+}
+
+FunctionWhitelist::FunctionWhitelist(const char* filename)
+{
+    parseFunctionNamesInFile(filename);
+}
+
+void FunctionWhitelist::parseFunctionNamesInFile(const char* filename)
+{
+    if (!filename)
+        return;
+
+    FILE* f = fopen(filename, &quot;r&quot;);
+    if (!f) {
+        dataLogF(&quot;Failed to open file %s. Did you add the file-read-data entitlement to WebProcess.sb?\n&quot;, filename); 
+        return;
+    }
+
+    char* line;
+    char buffer[BUFSIZ];
+    while ((line = fgets(buffer, sizeof(buffer), f))) {
+        if (strstr(line, &quot;//&quot;) == line)
+            continue;
+
+        // Get rid of newlines at the ends of the strings.
+        size_t length = strlen(line);
+        if (line[length - 1] == '\n') {
+            line[length - 1] = '\0';
+            length--;
+        }
+
+        // Skip empty lines.
+        if (!length)
+            continue;
+        
+        m_entries.add(String(line, length));
+    }
+}
+
+bool FunctionWhitelist::contains(CodeBlock* codeBlock) const 
+{
+    ASSERT(!isCompilationThread());
+    if (!Options::dfgFunctionWhitelistFile())
+        return true;
+
+    if (m_entries.isEmpty())
+        return false;
+
+    String name = String::fromUTF8(codeBlock-&gt;inferredName());
+    if (m_entries.contains(name))
+        return true;
+
+    String hash = String::fromUTF8(codeBlock-&gt;hashAsStringIfPossible());
+    if (m_entries.contains(hash))
+        return true;
+
+    String nameAndHash = name;
+    nameAndHash.append('#');
+    nameAndHash.append(hash);
+    return m_entries.contains(nameAndHash);
+}
+
+} } // namespace JSC::DFG
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGFunctionWhitelisth"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.h (0 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/dfg/DFGFunctionWhitelist.h        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -0,0 +1,53 @@
</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 DFGFunctionWhitelist_h
+#define DFGFunctionWhitelist_h
+
+#include &lt;wtf/HashSet.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC { 
+
+class CodeBlock;
+
+namespace DFG {
+
+class FunctionWhitelist {
+public:
+    static FunctionWhitelist&amp; ensureGlobalWhitelist();
+
+    bool contains(CodeBlock*) const;
+
+private:
+    FunctionWhitelist(const char*);
+    void parseFunctionNamesInFile(const char*);
+
+    HashSet&lt;String&gt; m_entries;
+};
+
+} } // namespace JSC::DFG
+
+#endif // DFGFunctionWhitelist_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.cpp (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.cpp        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/runtime/Options.cpp        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -76,6 +76,12 @@
</span><span class="cx">     return value.init(string);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool parse(const char* string, const char*&amp; value)
+{
+    value = string;
+    return true;
+}
+
</ins><span class="cx"> static bool parse(const char* string, GCLogging::Level&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (!strcasecmp(string, &quot;none&quot;) || !strcasecmp(string, &quot;no&quot;) || !strcasecmp(string, &quot;false&quot;) || !strcmp(string, &quot;0&quot;)) {
</span><span class="lines">@@ -350,10 +356,18 @@
</span><span class="cx">     case optionRangeType:
</span><span class="cx">         fprintf(stream, &quot;%s&quot;, s_options[id].u.optionRangeVal.rangeString());
</span><span class="cx">         break;
</span><del>-    case gcLogLevelType:
</del><ins>+    case optionStringType: {
+        const char* option = s_options[id].u.optionStringVal;
+        if (!option)
+            option = &quot;&quot;;
+        fprintf(stream, &quot;%s&quot;, option);
+        break;
+    }
+    case gcLogLevelType: {
</ins><span class="cx">         fprintf(stream, &quot;%s&quot;, GCLogging::levelAsString(s_options[id].u.gcLogLevelVal));
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+    }
</ins><span class="cx">     fprintf(stream, &quot;%s&quot;, footer);
</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 (168177 => 168178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.h        2014-05-02 18:46:53 UTC (rev 168177)
+++ trunk/Source/JavaScriptCore/runtime/Options.h        2014-05-02 18:52:10 UTC (rev 168178)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef OptionRange optionRange;
</span><ins>+typedef const char* optionString;
</ins><span class="cx"> 
</span><span class="cx"> #define JSC_OPTIONS(v) \
</span><span class="cx">     v(bool, useLLInt,  true) \
</span><span class="lines">@@ -117,6 +118,7 @@
</span><span class="cx">     v(bool, showFTLDisassembly, false) \
</span><span class="cx">     v(bool, showAllDFGNodes, false) \
</span><span class="cx">     v(optionRange, bytecodeRangeToDFGCompile, 0) \
</span><ins>+    v(optionString, dfgFunctionWhitelistFile, nullptr) \
</ins><span class="cx">     v(bool, dumpBytecodeAtDFGTime, false) \
</span><span class="cx">     v(bool, dumpGraphAtEachPhase, false) \
</span><span class="cx">     v(bool, verboseDFGByteCodeParsing, false) \
</span><span class="lines">@@ -308,6 +310,7 @@
</span><span class="cx">         doubleType,
</span><span class="cx">         int32Type,
</span><span class="cx">         optionRangeType,
</span><ins>+        optionStringType,
</ins><span class="cx">         gcLogLevelType,
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="lines">@@ -319,6 +322,7 @@
</span><span class="cx">             double doubleVal;
</span><span class="cx">             int32 int32Val;
</span><span class="cx">             OptionRange optionRangeVal;
</span><ins>+            const char* optionStringVal;
</ins><span class="cx">             GCLogging::Level gcLogLevelVal;
</span><span class="cx">         } u;
</span><span class="cx">         bool didOverride;
</span></span></pre>
</div>
</div>

</body>
</html>