<!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>[168261] releases/WebKitGTK/webkit-2.4/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/168261">168261</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-05 00:45:46 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed. Revert <a href="http://trac.webkit.org/projects/webkit/changeset/159826">r159826</a> - &quot;Finally fix some obvious Bartlett bugs&quot;

This reverts <a href="http://trac.webkit.org/projects/webkit/changeset/159826">r159826</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGJITCompilerh">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGOSREntrycpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGOSREntryh">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreheapHeapcpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreinterpreterJSStackcpp">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceJavaScriptCoreinterpreterJSStackh">releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/ChangeLog        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -7880,44 +7880,6 @@
</span><span class="cx">         (JSC::SymbolTable::SymbolTable):
</span><span class="cx">         * runtime/SymbolTable.h:
</span><span class="cx"> 
</span><del>-2013-11-27  Filip Pizlo  &lt;fpizlo@apple.com&gt;
-
-        Finally fix some obvious Bartlett bugs
-        https://bugs.webkit.org/show_bug.cgi?id=124951
-
-        Reviewed by Mark Hahnenberg.
-        
-        Sanitize the stack (i.e. zero parts of it known to be dead) at three key points:
-        
-        - GC.
-        
-        - At beginning of OSR entry.
-        
-        - Just as we finish preparing OSR entry. This clears those slots on the stack that
-          could have been live in baseline but that are known to be dead in DFG.
-        
-        This is as much as a 2x speed-up on splay if you run it in certain modes, and run it
-        for a long enough interval. It appears to fix all instances of the dreaded exponential
-        heap growth that splay gets into when some stale pointer stays around.
-        
-        This doesn't have much of an effect on real-world programs. This bug has only ever
-        manifested in splay and for that reason we thus far opted against fixing it. But splay
-        is, for what it's worth, the premiere GC stress test in JavaScript - so making sure we
-        can run it without pathologies - even when you tweak its configuration - is probably
-        fairly important.
-
-        * dfg/DFGJITCompiler.h:
-        (JSC::DFG::JITCompiler::noticeOSREntry):
-        * dfg/DFGOSREntry.cpp:
-        (JSC::DFG::prepareOSREntry):
-        * dfg/DFGOSREntry.h:
-        * heap/Heap.cpp:
-        (JSC::Heap::markRoots):
-        * interpreter/JSStack.cpp:
-        (JSC::JSStack::JSStack):
-        (JSC::JSStack::sanitizeStack):
-        * interpreter/JSStack.h:
-
</del><span class="cx"> 2013-11-26  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do bytecode validation as part of testing
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGJITCompilerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGJITCompiler.h        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -270,8 +270,6 @@
</span><span class="cx">                 entry-&gt;m_expectedValues.local(local).makeHeapTop();
</span><span class="cx">             else {
</span><span class="cx">                 VariableAccessData* variable = node-&gt;variableAccessData();
</span><del>-                entry-&gt;m_machineStackUsed.set(variable-&gt;machineLocal().toLocal());
-                
</del><span class="cx">                 switch (variable-&gt;flushFormat()) {
</span><span class="cx">                 case FlushedDouble:
</span><span class="cx">                     entry-&gt;m_localsForcedDouble.set(local);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGOSREntrycpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.cpp        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -52,9 +52,6 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    
-    vm-&gt;interpreter-&gt;stack().sanitizeStack();
-    
</del><span class="cx">     if (codeBlock-&gt;jitType() != JITCode::DFGJIT) {
</span><span class="cx">         RELEASE_ASSERT(codeBlock-&gt;jitType() == JITCode::FTLJIT);
</span><span class="cx">         
</span><span class="lines">@@ -184,8 +181,7 @@
</span><span class="cx">     //    it seems silly: you'd be diverting the program to error handling when it
</span><span class="cx">     //    would have otherwise just kept running albeit less quickly.
</span><span class="cx">     
</span><del>-    unsigned frameSize = jitCode-&gt;common.requiredRegisterCountForExecutionAndExit();
-    if (!vm-&gt;interpreter-&gt;stack().grow(&amp;exec-&gt;registers()[virtualRegisterForLocal(frameSize).offset()])) {
</del><ins>+    if (!vm-&gt;interpreter-&gt;stack().grow(&amp;exec-&gt;registers()[virtualRegisterForLocal(jitCode-&gt;common.requiredRegisterCountForExecutionAndExit()).offset()])) {
</ins><span class="cx">         if (Options::verboseOSR())
</span><span class="cx">             dataLogF(&quot;    OSR failed because stack growth failed.\n&quot;);
</span><span class="cx">         return 0;
</span><span class="lines">@@ -211,20 +207,11 @@
</span><span class="cx">     for (unsigned i = entry-&gt;m_reshufflings.size(); i--;)
</span><span class="cx">         registers[entry-&gt;m_reshufflings[i].toOffset] = temporaryLocals[i];
</span><span class="cx">     
</span><del>-    // 5) Clear those parts of the call frame that the DFG ain't using. This helps GC on some
-    //    programs by eliminating some stale pointer pathologies.
</del><ins>+    // 5) Fix the call frame.
</ins><span class="cx">     
</span><del>-    for (unsigned i = frameSize; i--;) {
-        if (entry-&gt;m_machineStackUsed.get(i))
-            continue;
-        registers[virtualRegisterForLocal(i).offset()] = JSValue::encode(JSValue());
-    }
-    
-    // 6) Fix the call frame.
-    
</del><span class="cx">     exec-&gt;setCodeBlock(codeBlock);
</span><span class="cx">     
</span><del>-    // 7) Find and return the destination machine code address.
</del><ins>+    // 6) Find and return the destination machine code address.
</ins><span class="cx">     
</span><span class="cx">     void* result = codeBlock-&gt;jitCode()-&gt;executableAddressAtOffset(entry-&gt;m_machineCodeOffset);
</span><span class="cx">     
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoredfgDFGOSREntryh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/dfg/DFGOSREntry.h        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx">     BitVector m_localsForcedDouble;
</span><span class="cx">     BitVector m_localsForcedMachineInt;
</span><span class="cx">     Vector&lt;OSREntryReshuffling&gt; m_reshufflings;
</span><del>-    BitVector m_machineStackUsed;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline unsigned getOSREntryDataBytecodeIndex(OSREntryData* osrEntryData)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/heap/Heap.cpp        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -467,7 +467,6 @@
</span><span class="cx">     {
</span><span class="cx">         GCPHASE(GatherStackRoots);
</span><span class="cx">         stack().gatherConservativeRoots(stackRoots, m_jitStubRoutines, m_codeBlocks);
</span><del>-        stack().sanitizeStack();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreinterpreterJSStackcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.cpp        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -52,8 +52,6 @@
</span><span class="cx">     m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
</span><span class="cx">     updateStackLimit(highAddress());
</span><span class="cx">     m_commitEnd = highAddress();
</span><del>-    
-    m_lastStackTop = getBaseOfStack();
</del><span class="cx"> 
</span><span class="cx">     disableErrorStackReserve();
</span><span class="cx"> 
</span><span class="lines">@@ -103,19 +101,6 @@
</span><span class="cx">     conservativeRoots.add(getBaseOfStack(), getTopOfStack(), jitStubRoutines, codeBlocks);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSStack::sanitizeStack()
-{
-    ASSERT(getTopOfStack() &lt;= getBaseOfStack());
-    
-    if (m_lastStackTop &lt; getTopOfStack()) {
-        char* begin = reinterpret_cast&lt;char*&gt;(m_lastStackTop);
-        char* end = reinterpret_cast&lt;char*&gt;(getTopOfStack());
-        memset(begin, 0, end - begin);
-    }
-    
-    m_lastStackTop = getTopOfStack();
-}
-
</del><span class="cx"> void JSStack::releaseExcessCapacity()
</span><span class="cx"> {
</span><span class="cx">     ptrdiff_t delta = reinterpret_cast&lt;uintptr_t&gt;(highAddress()) - reinterpret_cast&lt;uintptr_t&gt;(m_commitEnd);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceJavaScriptCoreinterpreterJSStackh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h (168260 => 168261)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h        2014-05-05 07:37:35 UTC (rev 168260)
+++ releases/WebKitGTK/webkit-2.4/Source/JavaScriptCore/interpreter/JSStack.h        2014-05-05 07:45:46 UTC (rev 168261)
</span><span class="lines">@@ -82,7 +82,6 @@
</span><span class="cx">         
</span><span class="cx">         void gatherConservativeRoots(ConservativeRoots&amp;);
</span><span class="cx">         void gatherConservativeRoots(ConservativeRoots&amp;, JITStubRoutineSet&amp;, CodeBlockSet&amp;);
</span><del>-        void sanitizeStack();
</del><span class="cx"> 
</span><span class="cx">         Register* getBaseOfStack() const
</span><span class="cx">         {
</span><span class="lines">@@ -157,7 +156,6 @@
</span><span class="cx">         Register* m_useableEnd;
</span><span class="cx">         PageReservation m_reservation;
</span><span class="cx">         CallFrame*&amp; m_topCallFrame;
</span><del>-        Register* m_lastStackTop;
</del><span class="cx"> 
</span><span class="cx">         friend class LLIntOffsetsExtractor;
</span><span class="cx">     };
</span></span></pre>
</div>
</div>

</body>
</html>