<!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>[203081] 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/203081">203081</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2016-07-11 13:48:15 -0700 (Mon, 11 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor JSStack to only be the stack data structure for the C Loop.
https://bugs.webkit.org/show_bug.cgi?id=159545

Reviewed by Geoffrey Garen.

Changes made:
1. Renamed JSStack to CLoopStack.
2. Made all of CLoopStack code to conditional on #if !ENABLE(JIT) i.e. they will
   only be in effect for the C Loop build.
3. Changed clients of JSStack to use new equivalent VM APIs:
    a. JSStack::ensureCapacityFor() =&gt; VM::ensureStackCapacityFor()
    b. JSStack::committedByteCount() =&gt; VM::committedStackByteCount()
4. Made VM::updateReservedZoneSize() call CLoopStack::setReservedZoneSize()
   instead of calling it from all the clients of VM::updateReservedZoneSize().
5. Removed all unnecessary references to JSStack.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MaxFrameExtentForSlowPathCall.h:
* bytecode/BytecodeConventions.h:
* dfg/DFGGraph.h:
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::willStartIterating):
(JSC::Heap::gatherJSStackRoots):
(JSC::Heap::stack): Deleted.
* heap/Heap.h:
* interpreter/CLoopStack.cpp: Copied from Source/JavaScriptCore/interpreter/JSStack.cpp.
(JSC::commitSize):
(JSC::CLoopStack::CLoopStack):
(JSC::CLoopStack::~CLoopStack):
(JSC::CLoopStack::grow):
(JSC::CLoopStack::gatherConservativeRoots):
(JSC::CLoopStack::sanitizeStack):
(JSC::CLoopStack::releaseExcessCapacity):
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::setReservedZoneSize):
(JSC::CLoopStack::committedByteCount):
(JSC::JSStack::JSStack): Deleted.
(JSC::JSStack::~JSStack): Deleted.
(JSC::JSStack::growSlowCase): Deleted.
(JSC::JSStack::gatherConservativeRoots): Deleted.
(JSC::JSStack::sanitizeStack): Deleted.
(JSC::JSStack::releaseExcessCapacity): Deleted.
(JSC::JSStack::addToCommittedByteCount): Deleted.
(JSC::JSStack::setReservedZoneSize): Deleted.
(JSC::JSStack::lowAddress): Deleted.
(JSC::JSStack::highAddress): Deleted.
(JSC::JSStack::committedByteCount): Deleted.
* interpreter/CLoopStack.h: Copied from Source/JavaScriptCore/interpreter/JSStack.h.
(JSC::CLoopStack::containsAddress):
(JSC::CLoopStack::lowAddress):
(JSC::CLoopStack::highAddress):
(JSC::CLoopStack::reservationTop):
(JSC::JSStack::containsAddress): Deleted.
(JSC::JSStack::lowAddress): Deleted.
(JSC::JSStack::highAddress): Deleted.
(JSC::JSStack::reservationTop): Deleted.
* interpreter/CLoopStackInlines.h: Copied from Source/JavaScriptCore/interpreter/JSStackInlines.h.
(JSC::CLoopStack::ensureCapacityFor):
(JSC::CLoopStack::topOfFrameFor):
(JSC::CLoopStack::topOfStack):
(JSC::CLoopStack::shrink):
(JSC::CLoopStack::setCLoopStackLimit):
(JSC::JSStack::ensureCapacityFor): Deleted.
(JSC::JSStack::topOfFrameFor): Deleted.
(JSC::JSStack::topOfStack): Deleted.
(JSC::JSStack::shrink): Deleted.
(JSC::JSStack::grow): Deleted.
(JSC::JSStack::setCLoopStackLimit): Deleted.
* interpreter/CallFrame.cpp:
(JSC::CallFrame::unsafeCallSiteIndex):
(JSC::CallFrame::currentVPC):
(JSC::CallFrame::stack): Deleted.
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrameAndPC):
(JSC::ExecState::unsafeCallerFrameAndPC):
* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
(JSC::sizeFrameForForwardArguments):
(JSC::sizeFrameForVarargs):
(JSC::Interpreter::Interpreter):
* interpreter/Interpreter.h:
(JSC::Interpreter::cloopStack):
(JSC::Interpreter::getOpcode):
(JSC::Interpreter::isCallBytecode):
(JSC::Interpreter::stack): Deleted.
* interpreter/JSStack.cpp: Removed.
* interpreter/JSStack.h: Removed.
* interpreter/JSStackInlines.h: Removed.
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::dump):
* jit/JIT.h:
* jit/JITOperations.cpp:
* jit/JSInterfaceJIT.h:
* jit/SpecializedThunkJIT.h:
* jit/ThunkGenerators.cpp:
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::llint_stack_check_at_vm_entry):
* llint/LLIntThunks.cpp:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::arityCheckFor):
* runtime/ErrorHandlingScope.cpp:
(JSC::ErrorHandlingScope::ErrorHandlingScope):
(JSC::ErrorHandlingScope::~ErrorHandlingScope):
* runtime/JSGlobalObject.h:
* runtime/MemoryStatistics.cpp:
(JSC::globalMemoryStatistics):
* runtime/StackAlignment.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateReservedZoneSize):
(JSC::sanitizeStackForVM):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::reservedZoneSize):
(JSC::VM::osStackLimitWithReserve):
(JSC::VM::addressOfOSStackLimitWithReserve):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
(JSC::VM::shouldTriggerTermination):</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="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMaxFrameExtentForSlowPathCallh">trunk/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeConventionsh">trunk/Source/JavaScriptCore/bytecode/BytecodeConventions.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGGraphh">trunk/Source/JavaScriptCore/dfg/DFGGraph.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGOSREntrycpp">trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOSREntrycpp">trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFramecpp">trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCallFrameh">trunk/Source/JavaScriptCore/interpreter/CallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpreterh">trunk/Source/JavaScriptCore/interpreter/Interpreter.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterStackVisitorcpp">trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITh">trunk/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJSInterfaceJITh">trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitSpecializedThunkJITh">trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitThunkGeneratorscpp">trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp">trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntThunkscpp">trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpretercpp">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsh">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeErrorHandlingScopecpp">trunk/Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeMemoryStatisticscpp">trunk/Source/JavaScriptCore/runtime/MemoryStatistics.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeStackAlignmenth">trunk/Source/JavaScriptCore/runtime/StackAlignment.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMInlinesh">trunk/Source/JavaScriptCore/runtime/VMInlines.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCLoopStackcpp">trunk/Source/JavaScriptCore/interpreter/CLoopStack.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCLoopStackh">trunk/Source/JavaScriptCore/interpreter/CLoopStack.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterCLoopStackInlinesh">trunk/Source/JavaScriptCore/interpreter/CLoopStackInlines.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinterpreterJSStackcpp">trunk/Source/JavaScriptCore/interpreter/JSStack.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterJSStackh">trunk/Source/JavaScriptCore/interpreter/JSStack.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterJSStackInlinesh">trunk/Source/JavaScriptCore/interpreter/JSStackInlines.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 (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -507,9 +507,9 @@
</span><span class="cx">     inspector/agents/JSGlobalObjectRuntimeAgent.cpp
</span><span class="cx"> 
</span><span class="cx">     interpreter/AbstractPC.cpp
</span><ins>+    interpreter/CLoopStack.cpp
</ins><span class="cx">     interpreter/CallFrame.cpp
</span><span class="cx">     interpreter/Interpreter.cpp
</span><del>-    interpreter/JSStack.cpp
</del><span class="cx">     interpreter/ProtoCallFrame.cpp
</span><span class="cx">     interpreter/ShadowChicken.cpp
</span><span class="cx">     interpreter/StackVisitor.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,3 +1,137 @@
</span><ins>+2016-07-11  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Refactor JSStack to only be the stack data structure for the C Loop.
+        https://bugs.webkit.org/show_bug.cgi?id=159545
+
+        Reviewed by Geoffrey Garen.
+
+        Changes made:
+        1. Renamed JSStack to CLoopStack.
+        2. Made all of CLoopStack code to conditional on #if !ENABLE(JIT) i.e. they will
+           only be in effect for the C Loop build.
+        3. Changed clients of JSStack to use new equivalent VM APIs:
+            a. JSStack::ensureCapacityFor() =&gt; VM::ensureStackCapacityFor()
+            b. JSStack::committedByteCount() =&gt; VM::committedStackByteCount()
+        4. Made VM::updateReservedZoneSize() call CLoopStack::setReservedZoneSize()
+           instead of calling it from all the clients of VM::updateReservedZoneSize().
+        5. Removed all unnecessary references to JSStack.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * assembler/MaxFrameExtentForSlowPathCall.h:
+        * bytecode/BytecodeConventions.h:
+        * dfg/DFGGraph.h:
+        * dfg/DFGOSREntry.cpp:
+        (JSC::DFG::prepareOSREntry):
+        * ftl/FTLOSREntry.cpp:
+        (JSC::FTL::prepareOSREntry):
+        * heap/Heap.cpp:
+        (JSC::Heap::finalizeUnconditionalFinalizers):
+        (JSC::Heap::willStartIterating):
+        (JSC::Heap::gatherJSStackRoots):
+        (JSC::Heap::stack): Deleted.
+        * heap/Heap.h:
+        * interpreter/CLoopStack.cpp: Copied from Source/JavaScriptCore/interpreter/JSStack.cpp.
+        (JSC::commitSize):
+        (JSC::CLoopStack::CLoopStack):
+        (JSC::CLoopStack::~CLoopStack):
+        (JSC::CLoopStack::grow):
+        (JSC::CLoopStack::gatherConservativeRoots):
+        (JSC::CLoopStack::sanitizeStack):
+        (JSC::CLoopStack::releaseExcessCapacity):
+        (JSC::CLoopStack::addToCommittedByteCount):
+        (JSC::CLoopStack::setReservedZoneSize):
+        (JSC::CLoopStack::committedByteCount):
+        (JSC::JSStack::JSStack): Deleted.
+        (JSC::JSStack::~JSStack): Deleted.
+        (JSC::JSStack::growSlowCase): Deleted.
+        (JSC::JSStack::gatherConservativeRoots): Deleted.
+        (JSC::JSStack::sanitizeStack): Deleted.
+        (JSC::JSStack::releaseExcessCapacity): Deleted.
+        (JSC::JSStack::addToCommittedByteCount): Deleted.
+        (JSC::JSStack::setReservedZoneSize): Deleted.
+        (JSC::JSStack::lowAddress): Deleted.
+        (JSC::JSStack::highAddress): Deleted.
+        (JSC::JSStack::committedByteCount): Deleted.
+        * interpreter/CLoopStack.h: Copied from Source/JavaScriptCore/interpreter/JSStack.h.
+        (JSC::CLoopStack::containsAddress):
+        (JSC::CLoopStack::lowAddress):
+        (JSC::CLoopStack::highAddress):
+        (JSC::CLoopStack::reservationTop):
+        (JSC::JSStack::containsAddress): Deleted.
+        (JSC::JSStack::lowAddress): Deleted.
+        (JSC::JSStack::highAddress): Deleted.
+        (JSC::JSStack::reservationTop): Deleted.
+        * interpreter/CLoopStackInlines.h: Copied from Source/JavaScriptCore/interpreter/JSStackInlines.h.
+        (JSC::CLoopStack::ensureCapacityFor):
+        (JSC::CLoopStack::topOfFrameFor):
+        (JSC::CLoopStack::topOfStack):
+        (JSC::CLoopStack::shrink):
+        (JSC::CLoopStack::setCLoopStackLimit):
+        (JSC::JSStack::ensureCapacityFor): Deleted.
+        (JSC::JSStack::topOfFrameFor): Deleted.
+        (JSC::JSStack::topOfStack): Deleted.
+        (JSC::JSStack::shrink): Deleted.
+        (JSC::JSStack::grow): Deleted.
+        (JSC::JSStack::setCLoopStackLimit): Deleted.
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::unsafeCallSiteIndex):
+        (JSC::CallFrame::currentVPC):
+        (JSC::CallFrame::stack): Deleted.
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::callerFrameAndPC):
+        (JSC::ExecState::unsafeCallerFrameAndPC):
+        * interpreter/Interpreter.cpp:
+        (JSC::sizeOfVarargs):
+        (JSC::sizeFrameForForwardArguments):
+        (JSC::sizeFrameForVarargs):
+        (JSC::Interpreter::Interpreter):
+        * interpreter/Interpreter.h:
+        (JSC::Interpreter::cloopStack):
+        (JSC::Interpreter::getOpcode):
+        (JSC::Interpreter::isCallBytecode):
+        (JSC::Interpreter::stack): Deleted.
+        * interpreter/JSStack.cpp: Removed.
+        * interpreter/JSStack.h: Removed.
+        * interpreter/JSStackInlines.h: Removed.
+        * interpreter/StackVisitor.cpp:
+        (JSC::StackVisitor::Frame::dump):
+        * jit/JIT.h:
+        * jit/JITOperations.cpp:
+        * jit/JSInterfaceJIT.h:
+        * jit/SpecializedThunkJIT.h:
+        * jit/ThunkGenerators.cpp:
+        * llint/LLIntOffsetsExtractor.cpp:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        (JSC::LLInt::llint_stack_check_at_vm_entry):
+        * llint/LLIntThunks.cpp:
+        * llint/LowLevelInterpreter.cpp:
+        (JSC::CLoop::execute):
+        * runtime/CommonSlowPaths.cpp:
+        (JSC::SLOW_PATH_DECL):
+        * runtime/CommonSlowPaths.h:
+        (JSC::CommonSlowPaths::arityCheckFor):
+        * runtime/ErrorHandlingScope.cpp:
+        (JSC::ErrorHandlingScope::ErrorHandlingScope):
+        (JSC::ErrorHandlingScope::~ErrorHandlingScope):
+        * runtime/JSGlobalObject.h:
+        * runtime/MemoryStatistics.cpp:
+        (JSC::globalMemoryStatistics):
+        * runtime/StackAlignment.h:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::VM::updateReservedZoneSize):
+        (JSC::sanitizeStackForVM):
+        (JSC::VM::committedStackByteCount):
+        * runtime/VM.h:
+        (JSC::VM::reservedZoneSize):
+        (JSC::VM::osStackLimitWithReserve):
+        (JSC::VM::addressOfOSStackLimitWithReserve):
+        * runtime/VMInlines.h:
+        (JSC::VM::ensureStackCapacityFor):
+        (JSC::VM::shouldTriggerTermination):
+
</ins><span class="cx"> 2016-07-11  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         STP TypedArray.subarray 5x slowdown compared to 9.1
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -973,7 +973,7 @@
</span><span class="cx">                 14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; };
</span><span class="cx">                 1428082D107EC0570013E7B2 /* CallData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFE0E2826230004F30D /* CallData.cpp */; };
</span><span class="cx">                 1428082E107EC0570013E7B2 /* ConstructData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCA62DFF0E2826310004F30D /* ConstructData.cpp */; };
</span><del>-                1428083A107EC0750013E7B2 /* JSStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* JSStack.cpp */; };
</del><ins>+                1428083A107EC0750013E7B2 /* CLoopStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1429D85B0ED218E900B89619 /* CLoopStack.cpp */; };
</ins><span class="cx">                 14280841107EC0930013E7B2 /* RegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87D0255597D01FF60F7 /* RegExp.cpp */; };
</span><span class="cx">                 14280842107EC0930013E7B2 /* RegExpConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD202BD0E1706A7002C7E82 /* RegExpConstructor.cpp */; };
</span><span class="cx">                 14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A87B0255597D01FF60F7 /* RegExpObject.cpp */; };
</span><span class="lines">@@ -1140,6 +1140,10 @@
</span><span class="cx">                 2AF7382C18BBBF92008A5A37 /* StructureIDTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2AF7382A18BBBF92008A5A37 /* StructureIDTable.cpp */; };
</span><span class="cx">                 2AF7382D18BBBF92008A5A37 /* StructureIDTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 2AF7382B18BBBF92008A5A37 /* StructureIDTable.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 371D842D17C98B6E00ECF994 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 371D842C17C98B6E00ECF994 /* libz.dylib */; };
</span><ins>+                412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952731D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                412952781D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952741D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                412952791D2CF6BC00E78B89 /* builtins_generate_wrapper_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952751D2CF6AC00E78B89 /* builtins_generate_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
+                4129527A1D2CF6BC00E78B89 /* builtins_generate_wrapper_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 412952761D2CF6AC00E78B89 /* builtins_generate_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 41359CF30FDD89AD00206180 /* DateConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = D21202290AD4310C00ED79B6 /* DateConversion.h */; };
</span><span class="cx">                 41DEA1321B9F3163006D65DD /* BuiltinUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 41DEA1311B9F3154006D65DD /* BuiltinUtils.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 4319DA031C1BE40A001D260B /* B3LowerMacrosAfterOptimizations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4319DA011C1BE3C1001D260B /* B3LowerMacrosAfterOptimizations.cpp */; };
</span><span class="lines">@@ -1474,10 +1478,6 @@
</span><span class="cx">                 99DA00A81BD5993100F4575C /* builtins_generate_combined_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA009F1BD5992700F4575C /* builtins_generate_combined_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 99DA00A91BD5993100F4575C /* builtins_generate_separate_header.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A01BD5992700F4575C /* builtins_generate_separate_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 99DA00AA1BD5993100F4575C /* builtins_generate_separate_implementation.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00A11BD5992700F4575C /* builtins_generate_separate_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                412952771D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_header.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952731D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                412952781D2CF6BC00E78B89 /* builtins_generate_internals_wrapper_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952741D2CF6AC00E78B89 /* builtins_generate_internals_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                412952791D2CF6BC00E78B89 /* builtins_generate_wrapper_header.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952751D2CF6AC00E78B89 /* builtins_generate_wrapper_header.py */; settings = {ATTRIBUTES = (Private, ); }; };
-                4129527A1D2CF6BC00E78B89 /* builtins_generate_wrapper_implementation.py in Resources */ = {isa = PBXBuildFile; fileRef = 412952761D2CF6AC00E78B89 /* builtins_generate_wrapper_implementation.py */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 99DA00AF1BD5994E00F4575C /* generate-js-builtins.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AC1BD5993E00F4575C /* generate-js-builtins.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AD1BD5993E00F4575C /* lazywriter.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 99DA00B11BD5994E00F4575C /* UpdateContents.py in Headers */ = {isa = PBXBuildFile; fileRef = 99DA00AE1BD5993E00F4575C /* UpdateContents.py */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1776,7 +1776,7 @@
</span><span class="cx">                 A7C0C4AC168103020017011D /* JSScriptRefPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7C0C4AD1681067E0017011D /* JSScriptRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C0C4AA167C08CD0017011D /* JSScriptRef.cpp */; };
</span><span class="cx">                 A7C1E8E4112E72EF00A37F98 /* JITPropertyAccess32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */; };
</span><del>-                A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */; };
</del><ins>+                A7C1EAF017987AB600299DB2 /* CLoopStackInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */; };
</ins><span class="cx">                 A7C1EAF117987AB600299DB2 /* StackVisitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */; };
</span><span class="cx">                 A7C1EAF217987AB600299DB2 /* StackVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C1EAED17987AB600299DB2 /* StackVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7CA3AE317DA41AE006538AF /* WeakMapConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7CA3ADD17DA41AE006538AF /* WeakMapConstructor.cpp */; };
</span><span class="lines">@@ -1898,7 +1898,7 @@
</span><span class="cx">                 BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87E0255597D01FF60F7 /* RegExp.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C45B0E16F5CD00B34460 /* RegExpObject.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A87C0255597D01FF60F7 /* RegExpObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C45D0E16F5CD00B34460 /* Register.h in Headers */ = {isa = PBXBuildFile; fileRef = 149B24FF0D8AF6D1009CB8C7 /* Register.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* JSStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */ = {isa = PBXBuildFile; fileRef = 14D792640DAA03FB001A9F05 /* CLoopStack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C4660E16F5CD00B34460 /* StringConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC18C3C10E16EE3300B34460 /* StringConstructor.h */; };
</span><span class="lines">@@ -3150,7 +3150,7 @@
</span><span class="cx">                 142711380A460BBB0080EEEA /* JSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D77B0ED20D7300B89619 /* Interpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Interpreter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D7D30ED2128200B89619 /* Interpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Interpreter.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                1429D85B0ED218E900B89619 /* JSStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStack.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                1429D85B0ED218E900B89619 /* CLoopStack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CLoopStack.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1429D8770ED21ACD00B89619 /* ExceptionHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExceptionHelpers.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallFrame.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D8DC0ED2205B00B89619 /* CallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CallFrame.h; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
</span><span class="lines">@@ -3232,7 +3232,7 @@
</span><span class="cx">                 14CA958C16AB50FA00938A06 /* ObjectAllocationProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectAllocationProfile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14D2F3D8139F4BE200491031 /* MarkedSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MarkedSpace.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14D2F3D9139F4BE200491031 /* MarkedSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarkedSpace.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                14D792640DAA03FB001A9F05 /* JSStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                14D792640DAA03FB001A9F05 /* CLoopStack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLoopStack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 14D844A216AA2C7000A65AF0 /* PrototypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrototypeMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14D844A316AA2C7000A65AF0 /* PrototypeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrototypeMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 14D857740A4696C80032146C /* testapi.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = testapi.js; path = API/tests/testapi.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4007,7 +4007,7 @@
</span><span class="cx">                 A7C0C4AA167C08CD0017011D /* JSScriptRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A7C0C4AB167C08CD0017011D /* JSScriptRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptRefPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess32_64.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStackInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CLoopStackInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = StackVisitor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A7C1EAED17987AB600299DB2 /* StackVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StackVisitor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A7C225CC139981F100FF1662 /* KeywordLookupGenerator.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = KeywordLookupGenerator.py; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5000,6 +5000,9 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */,
</span><span class="cx">                                 0F55F0F214D1063600AC7649 /* AbstractPC.h */,
</span><ins>+                                1429D85B0ED218E900B89619 /* CLoopStack.cpp */,
+                                14D792640DAA03FB001A9F05 /* CLoopStack.h */,
+                                A7C1EAEB17987AB600299DB2 /* CLoopStackInlines.h */,
</ins><span class="cx">                                 A7F8690E0F9584A100558697 /* CachedCall.h */,
</span><span class="cx">                                 1429D8DB0ED2205B00B89619 /* CallFrame.cpp */,
</span><span class="cx">                                 1429D8DC0ED2205B00B89619 /* CallFrame.h */,
</span><span class="lines">@@ -5006,9 +5009,6 @@
</span><span class="cx">                                 A7F869EC0F95C2EC00558697 /* CallFrameClosure.h */,
</span><span class="cx">                                 1429D7D30ED2128200B89619 /* Interpreter.cpp */,
</span><span class="cx">                                 1429D77B0ED20D7300B89619 /* Interpreter.h */,
</span><del>-                                1429D85B0ED218E900B89619 /* JSStack.cpp */,
-                                14D792640DAA03FB001A9F05 /* JSStack.h */,
-                                A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */,
</del><span class="cx">                                 65FB5116184EE9BC00C12B70 /* ProtoCallFrame.cpp */,
</span><span class="cx">                                 65FB5115184EE8F800C12B70 /* ProtoCallFrame.h */,
</span><span class="cx">                                 149B24FF0D8AF6D1009CB8C7 /* Register.h */,
</span><span class="lines">@@ -7805,8 +7805,8 @@
</span><span class="cx">                                 0F919D11157F332C004A4E7D /* JSSegmentedVariableObject.h in Headers */,
</span><span class="cx">                                 A7299D9E17D12837005F5FF9 /* JSSet.h in Headers */,
</span><span class="cx">                                 A790DD70182F499700588807 /* JSSetIterator.h in Headers */,
</span><del>-                                BC18C45E0E16F5CD00B34460 /* JSStack.h in Headers */,
-                                A7C1EAF017987AB600299DB2 /* JSStackInlines.h in Headers */,
</del><ins>+                                BC18C45E0E16F5CD00B34460 /* CLoopStack.h in Headers */,
+                                A7C1EAF017987AB600299DB2 /* CLoopStackInlines.h in Headers */,
</ins><span class="cx">                                 BC18C4270E16F5CD00B34460 /* JSString.h in Headers */,
</span><span class="cx">                                 86E85539111B9968001AF51E /* JSStringBuilder.h in Headers */,
</span><span class="cx">                                 70EC0EC31AA0D7DA00B6AAFA /* JSStringIterator.h in Headers */,
</span><span class="lines">@@ -9218,7 +9218,7 @@
</span><span class="cx">                                 DC17E8171C9C91D6008A6AB3 /* ShadowChicken.cpp in Sources */,
</span><span class="cx">                                 A7299D9D17D12837005F5FF9 /* JSSet.cpp in Sources */,
</span><span class="cx">                                 A790DD6F182F499700588807 /* JSSetIterator.cpp in Sources */,
</span><del>-                                1428083A107EC0750013E7B2 /* JSStack.cpp in Sources */,
</del><ins>+                                1428083A107EC0750013E7B2 /* CLoopStack.cpp in Sources */,
</ins><span class="cx">                                 147F39D5107EC37600427A48 /* JSString.cpp in Sources */,
</span><span class="cx">                                 70EC0EC21AA0D7DA00B6AAFA /* JSStringIterator.cpp in Sources */,
</span><span class="cx">                                 0F9D4C101C3E2C74006CD984 /* FTLPatchpointExceptionHandle.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMaxFrameExtentForSlowPathCallh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #ifndef MaxFrameExtentForSlowPathCall_h
</span><span class="cx"> #define MaxFrameExtentForSlowPathCall_h
</span><span class="cx"> 
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;Register.h&quot;
</span><span class="cx"> #include &quot;StackAlignment.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeConventionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeConventions.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeConventions.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeConventions.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #define BytecodeConventions_h
</span><span class="cx"> 
</span><span class="cx"> // Register numbers used in bytecode operations have different meaning according to their ranges:
</span><del>-//      0x80000000-0xFFFFFFFF  Negative indices from the CallFrame pointer are entries in the call frame, see JSStack.h.
</del><ins>+//      0x80000000-0xFFFFFFFF  Negative indices from the CallFrame pointer are entries in the call frame.
</ins><span class="cx"> //      0x00000000-0x3FFFFFFF  Forwards indices from the CallFrame pointer are local vars and temporaries with the function's callframe.
</span><span class="cx"> //      0x40000000-0x7FFFFFFF  Positive indices from 0x40000000 specify entries in the constant pool on the CodeBlock.
</span><span class="cx"> static const int FirstConstantRegisterIndex = 0x40000000;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGGraphh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGGraph.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGGraph.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/dfg/DFGGraph.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011-2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include &quot;DFGPropertyTypeKey.h&quot;
</span><span class="cx"> #include &quot;DFGScannable.h&quot;
</span><span class="cx"> #include &quot;FullBytecodeLiveness.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;MethodOfGettingAValueProfile.h&quot;
</span><span class="cx"> #include &lt;unordered_map&gt;
</span><span class="cx"> #include &lt;wtf/BitVector.h&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGOSREntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -33,8 +33,8 @@
</span><span class="cx"> #include &quot;DFGJITCode.h&quot;
</span><span class="cx"> #include &quot;DFGNode.h&quot;
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;VMInlines.h&quot;
</ins><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace DFG {
</span><span class="lines">@@ -244,7 +244,7 @@
</span><span class="cx">     //    would have otherwise just kept running albeit less quickly.
</span><span class="cx">     
</span><span class="cx">     unsigned frameSizeForCheck = jitCode-&gt;common.requiredRegisterCountForExecutionAndExit();
</span><del>-    if (!vm-&gt;interpreter-&gt;stack().ensureCapacityFor(&amp;exec-&gt;registers()[virtualRegisterForLocal(frameSizeForCheck - 1).offset()])) {
</del><ins>+    if (UNLIKELY(!vm-&gt;ensureStackCapacityFor(&amp;exec-&gt;registers()[virtualRegisterForLocal(frameSizeForCheck - 1).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></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOSREntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/ftl/FTLOSREntry.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013-2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -30,9 +30,9 @@
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;DFGJITCode.h&quot;
</span><span class="cx"> #include &quot;FTLForOSREntryJITCode.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;OperandsInlines.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;VMInlines.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><span class="cx"> 
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">         scratch[local] = JSValue::encode(values.local(local));
</span><span class="cx">     
</span><span class="cx">     int stackFrameSize = entryCode-&gt;common.requiredRegisterCountForExecutionAndExit();
</span><del>-    if (!vm.interpreter-&gt;stack().ensureCapacityFor(&amp;exec-&gt;registers()[virtualRegisterForLocal(stackFrameSize - 1).offset()])) {
</del><ins>+    if (UNLIKELY(!vm.ensureStackCapacityFor(&amp;exec-&gt;registers()[virtualRegisterForLocal(stackFrameSize - 1).offset()]))) {
</ins><span class="cx">         if (Options::verboseOSR())
</span><span class="cx">             dataLog(&quot;    OSR failed because stack growth failed.\n&quot;);
</span><span class="cx">         return 0;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -486,11 +486,6 @@
</span><span class="cx">     m_slotVisitor.finalizeUnconditionalFinalizers();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline JSStack&amp; Heap::stack()
-{
-    return m_vm-&gt;interpreter-&gt;stack();
-}
-
</del><span class="cx"> void Heap::willStartIterating()
</span><span class="cx"> {
</span><span class="cx">     m_objectSpace.willStartIterating();
</span><span class="lines">@@ -681,7 +676,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if !ENABLE(JIT)
</span><span class="cx">     GCPHASE(GatherJSStackRoots);
</span><del>-    stack().gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks);
</del><ins>+    m_vm-&gt;interpreter-&gt;cloopStack().gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(roots);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -66,7 +66,6 @@
</span><span class="cx"> class IncrementalSweeper;
</span><span class="cx"> class JITStubRoutine;
</span><span class="cx"> class JSCell;
</span><del>-class JSStack;
</del><span class="cx"> class JSValue;
</span><span class="cx"> class LLIntOffsetsExtractor;
</span><span class="cx"> class MarkedArgumentBuffer;
</span><span class="lines">@@ -355,8 +354,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool shouldDoFullCollection(HeapOperation requestedCollectionType) const;
</span><span class="cx"> 
</span><del>-    JSStack&amp; stack();
-    
</del><span class="cx">     void incrementDeferralDepth();
</span><span class="cx">     void decrementDeferralDepth();
</span><span class="cx">     void decrementDeferralDepthAndGCIfNeeded();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCLoopStackcppfromrev203080trunkSourceJavaScriptCoreinterpreterJSStackcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/interpreter/CLoopStack.cpp (from rev 203080, trunk/Source/JavaScriptCore/interpreter/JSStack.cpp) (0 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CLoopStack.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/interpreter/CLoopStack.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -0,0 +1,158 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2013-2016 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 Inc. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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 &quot;config.h&quot;
+#include &quot;CLoopStack.h&quot;
+
+#if !ENABLE(JIT)
+
+#include &quot;CLoopStackInlines.h&quot;
+#include &quot;ConservativeRoots.h&quot;
+#include &quot;Interpreter.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;Options.h&quot;
+#include &lt;wtf/Lock.h&gt;
+
+namespace JSC {
+
+static size_t committedBytesCount = 0;
+
+static size_t commitSize()
+{
+    static size_t size = std::max&lt;size_t&gt;(16 * 1024, pageSize());
+    return size;
+}
+
+static StaticLock stackStatisticsMutex;
+
+CLoopStack::CLoopStack(VM&amp; vm)
+    : m_vm(vm)
+    , m_topCallFrame(vm.topCallFrame)
+    , m_end(0)
+    , m_reservedZoneSizeInRegisters(0)
+{
+    size_t capacity = Options::maxPerThreadStackUsage();
+    ASSERT(capacity &amp;&amp; isPageAligned(capacity));
+
+    m_reservation = PageReservation::reserve(WTF::roundUpToMultipleOf(commitSize(), capacity), OSAllocator::JSVMStackPages);
+    setCLoopStackLimit(highAddress());
+    m_commitTop = highAddress();
+    
+    m_lastStackTop = baseOfStack();
+
+    m_topCallFrame = 0;
+}
+
+CLoopStack::~CLoopStack()
+{
+    ptrdiff_t sizeToDecommit = reinterpret_cast&lt;char*&gt;(highAddress()) - reinterpret_cast&lt;char*&gt;(m_commitTop);
+    m_reservation.decommit(reinterpret_cast&lt;void*&gt;(m_commitTop), sizeToDecommit);
+    addToCommittedByteCount(-sizeToDecommit);
+    m_reservation.deallocate();
+}
+
+bool CLoopStack::grow(Register* newTopOfStack)
+{
+    Register* newTopOfStackWithReservedZone = newTopOfStack - m_reservedZoneSizeInRegisters;
+
+    // If we have already committed enough memory to satisfy this request,
+    // just update the end pointer and return.
+    if (newTopOfStackWithReservedZone &gt;= m_commitTop) {
+        setCLoopStackLimit(newTopOfStack);
+        return true;
+    }
+
+    // Compute the chunk size of additional memory to commit, and see if we
+    // have it is still within our budget. If not, we'll fail to grow and
+    // return false.
+    ptrdiff_t delta = reinterpret_cast&lt;char*&gt;(m_commitTop) - reinterpret_cast&lt;char*&gt;(newTopOfStackWithReservedZone);
+    delta = WTF::roundUpToMultipleOf(commitSize(), delta);
+    Register* newCommitTop = m_commitTop - (delta / sizeof(Register));
+    if (newCommitTop &lt; reservationTop())
+        return false;
+
+    // Otherwise, the growth is still within our budget. Commit it and return true.
+    m_reservation.commit(newCommitTop, delta);
+    addToCommittedByteCount(delta);
+    m_commitTop = newCommitTop;
+    setCLoopStackLimit(newTopOfStack);
+    return true;
+}
+
+void CLoopStack::gatherConservativeRoots(ConservativeRoots&amp; conservativeRoots, JITStubRoutineSet&amp; jitStubRoutines, CodeBlockSet&amp; codeBlocks)
+{
+    conservativeRoots.add(topOfStack() + 1, highAddress(), jitStubRoutines, codeBlocks);
+}
+
+void CLoopStack::sanitizeStack()
+{
+#if !ASAN_ENABLED
+    ASSERT(topOfStack() &lt;= baseOfStack());
+    
+    if (m_lastStackTop &lt; topOfStack()) {
+        char* begin = reinterpret_cast&lt;char*&gt;(m_lastStackTop + 1);
+        char* end = reinterpret_cast&lt;char*&gt;(topOfStack() + 1);
+        memset(begin, 0, end - begin);
+    }
+    
+    m_lastStackTop = topOfStack();
+#endif
+}
+
+void CLoopStack::releaseExcessCapacity()
+{
+    Register* highAddressWithReservedZone = highAddress() - m_reservedZoneSizeInRegisters;
+    ptrdiff_t delta = reinterpret_cast&lt;char*&gt;(highAddressWithReservedZone) - reinterpret_cast&lt;char*&gt;(m_commitTop);
+    m_reservation.decommit(m_commitTop, delta);
+    addToCommittedByteCount(-delta);
+    m_commitTop = highAddressWithReservedZone;
+}
+
+void CLoopStack::addToCommittedByteCount(long byteCount)
+{
+    LockHolder locker(stackStatisticsMutex);
+    ASSERT(static_cast&lt;long&gt;(committedBytesCount) + byteCount &gt; -1);
+    committedBytesCount += byteCount;
+}
+
+void CLoopStack::setReservedZoneSize(size_t reservedZoneSize)
+{
+    m_reservedZoneSizeInRegisters = reservedZoneSize / sizeof(Register);
+    if (m_commitTop &gt;= (m_end + 1) - m_reservedZoneSizeInRegisters)
+        grow(m_end + 1);
+}
+
+size_t CLoopStack::committedByteCount()
+{
+    LockHolder locker(stackStatisticsMutex);
+    return committedBytesCount;
+}
+
+} // namespace JSC
+
+#endif // !ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCLoopStackhfromrev203080trunkSourceJavaScriptCoreinterpreterJSStackh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/interpreter/CLoopStack.h (from rev 203080, trunk/Source/JavaScriptCore/interpreter/JSStack.h) (0 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CLoopStack.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/interpreter/CLoopStack.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+ * Copyright (C) 2008-2009, 2013-2014, 2016 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 Inc. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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.
+ */
+
+#pragma once
+
+#if !ENABLE(JIT)
+
+#include &quot;Register.h&quot;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/PageReservation.h&gt;
+#include &lt;wtf/VMTags.h&gt;
+
+namespace JSC {
+
+    class CodeBlockSet;
+    class ConservativeRoots;
+    class JITStubRoutineSet;
+    class VM;
+    class LLIntOffsetsExtractor;
+
+    class CLoopStack {
+        WTF_MAKE_NONCOPYABLE(CLoopStack);
+    public:
+        // Allow 8k of excess registers before we start trying to reap the stack
+        static const ptrdiff_t maxExcessCapacity = 8 * 1024;
+
+        CLoopStack(VM&amp;);
+        ~CLoopStack();
+        
+        bool ensureCapacityFor(Register* newTopOfStack);
+
+        bool containsAddress(Register* address) { return (lowAddress() &lt;= address &amp;&amp; address &lt; highAddress()); }
+        static size_t committedByteCount();
+
+        void gatherConservativeRoots(ConservativeRoots&amp;, JITStubRoutineSet&amp;, CodeBlockSet&amp;);
+        void sanitizeStack();
+
+        Register* baseOfStack() const
+        {
+            return highAddress() - 1;
+        }
+
+        size_t size() const { return highAddress() - lowAddress(); }
+
+        void setReservedZoneSize(size_t);
+
+        inline Register* topOfStack();
+
+    private:
+
+        Register* lowAddress() const
+        {
+            return m_end + 1;
+        }
+
+        Register* highAddress() const
+        {
+            return reinterpret_cast_ptr&lt;Register*&gt;(static_cast&lt;char*&gt;(m_reservation.base()) + m_reservation.size());
+        }
+
+        inline Register* topOfFrameFor(CallFrame*);
+
+        Register* reservationTop() const
+        {
+            char* reservationTop = static_cast&lt;char*&gt;(m_reservation.base());
+            return reinterpret_cast_ptr&lt;Register*&gt;(reservationTop);
+        }
+
+        bool grow(Register* newTopOfStack);
+        void shrink(Register* newTopOfStack);
+        void releaseExcessCapacity();
+        void addToCommittedByteCount(long);
+
+        void setCLoopStackLimit(Register* newTopOfStack);
+
+        VM&amp; m_vm;
+        CallFrame*&amp; m_topCallFrame;
+        Register* m_end;
+        Register* m_commitTop;
+        PageReservation m_reservation;
+        Register* m_lastStackTop;
+        ptrdiff_t m_reservedZoneSizeInRegisters;
+
+        friend class LLIntOffsetsExtractor;
+    };
+
+} // namespace JSC
+
+#endif // !ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCLoopStackInlineshfromrev203080trunkSourceJavaScriptCoreinterpreterJSStackInlinesh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/interpreter/CLoopStackInlines.h (from rev 203080, trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h) (0 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CLoopStackInlines.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/interpreter/CLoopStackInlines.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2012-2014, 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#pragma once
+
+#if !ENABLE(JIT)
+
+#include &quot;CLoopStack.h&quot;
+#include &quot;CallFrame.h&quot;
+#include &quot;CodeBlock.h&quot;
+#include &quot;VM.h&quot;
+
+namespace JSC {
+
+inline bool CLoopStack::ensureCapacityFor(Register* newTopOfStack)
+{
+    Register* newEnd = newTopOfStack - 1;
+    if (newEnd &gt;= m_end)
+        return true;
+    return grow(newTopOfStack);
+}
+
+inline Register* CLoopStack::topOfFrameFor(CallFrame* frame)
+{
+    if (UNLIKELY(!frame))
+        return baseOfStack();
+    return frame-&gt;topOfFrame() - 1;
+}
+
+inline Register* CLoopStack::topOfStack()
+{
+    return topOfFrameFor(m_topCallFrame);
+}
+
+inline void CLoopStack::shrink(Register* newTopOfStack)
+{
+    Register* newEnd = newTopOfStack - 1;
+    if (newEnd &gt;= m_end)
+        return;
+    setCLoopStackLimit(newTopOfStack);
+    // Note: Clang complains of an unresolved linkage to maxExcessCapacity if
+    // invoke std::max() with it as an argument. To work around this, we first
+    // assign the constant to a local variable, and use the local instead.
+    ptrdiff_t maxExcessCapacity = CLoopStack::maxExcessCapacity;
+    ptrdiff_t maxExcessInRegisters = std::max(maxExcessCapacity, m_reservedZoneSizeInRegisters);
+    if (m_end == baseOfStack() &amp;&amp; (highAddress() - m_commitTop) &gt;= maxExcessInRegisters)
+        releaseExcessCapacity();
+}
+
+inline void CLoopStack::setCLoopStackLimit(Register* newTopOfStack)
+{
+    Register* newEnd = newTopOfStack - 1;
+    m_end = newEnd;
+    m_vm.setCLoopStackLimit(newTopOfStack);
+}
+
+} // namespace JSC
+
+#endif // !ENABLE(JIT)
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013, 2014 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008, 2013-2014, 2016 Apple Inc. All Rights Reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -103,14 +103,6 @@
</span><span class="cx">     return CallSiteIndex(unsafeCallSiteAsRawBits());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#ifndef NDEBUG
-JSStack* CallFrame::stack()
-{
-    return &amp;interpreter()-&gt;stack();
-}
-
-#endif
-
</del><span class="cx"> #if USE(JSVALUE32_64)
</span><span class="cx"> Instruction* CallFrame::currentVPC() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -270,9 +270,6 @@
</span><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx"> 
</span><del>-#ifndef NDEBUG
-        JSStack* stack();
-#endif
</del><span class="cx">         ExecState();
</span><span class="cx">         ~ExecState();
</span><span class="cx"> 
</span><span class="lines">@@ -301,10 +298,6 @@
</span><span class="cx">         CallerFrameAndPC&amp; callerFrameAndPC() { return *reinterpret_cast&lt;CallerFrameAndPC*&gt;(this); }
</span><span class="cx">         const CallerFrameAndPC&amp; callerFrameAndPC() const { return *reinterpret_cast&lt;const CallerFrameAndPC*&gt;(this); }
</span><span class="cx">         SUPPRESS_ASAN const CallerFrameAndPC&amp; unsafeCallerFrameAndPC() const { return *reinterpret_cast&lt;const CallerFrameAndPC*&gt;(this); }
</span><del>-
-#if !ENABLE(JIT)
-        friend class JSStack;
-#endif
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;JSLexicalEnvironment.h&quot;
</span><span class="cx"> #include &quot;JSModuleEnvironment.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LLIntCLoop.h&quot;
</span><span class="lines">@@ -235,22 +234,22 @@
</span><span class="cx">     return length;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned sizeFrameForForwardArguments(CallFrame* callFrame, JSStack* stack, unsigned numUsedStackSlots)
</del><ins>+unsigned sizeFrameForForwardArguments(CallFrame* callFrame, VM&amp; vm, unsigned numUsedStackSlots)
</ins><span class="cx"> {
</span><span class="cx">     unsigned length = callFrame-&gt;argumentCount();
</span><span class="cx">     CallFrame* calleeFrame = calleeFrameForVarargs(callFrame, numUsedStackSlots, length + 1);
</span><del>-    if (!stack-&gt;ensureCapacityFor(calleeFrame-&gt;registers()))
</del><ins>+    if (UNLIKELY(!vm.ensureStackCapacityFor(calleeFrame-&gt;registers())))
</ins><span class="cx">         throwStackOverflowError(callFrame);
</span><span class="cx"> 
</span><span class="cx">     return length;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-unsigned sizeFrameForVarargs(CallFrame* callFrame, JSStack* stack, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset)
</del><ins>+unsigned sizeFrameForVarargs(CallFrame* callFrame, VM&amp; vm, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset)
</ins><span class="cx"> {
</span><span class="cx">     unsigned length = sizeOfVarargs(callFrame, arguments, firstVarArgOffset);
</span><span class="cx">     
</span><span class="cx">     CallFrame* calleeFrame = calleeFrameForVarargs(callFrame, numUsedStackSlots, length + 1);
</span><del>-    if (length &gt; maxArguments || !stack-&gt;ensureCapacityFor(calleeFrame-&gt;registers())) {
</del><ins>+    if (UNLIKELY(length &gt; maxArguments || !vm.ensureStackCapacityFor(calleeFrame-&gt;registers()))) {
</ins><span class="cx">         throwStackOverflowError(callFrame);
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="lines">@@ -323,7 +322,9 @@
</span><span class="cx"> 
</span><span class="cx"> Interpreter::Interpreter(VM&amp; vm)
</span><span class="cx">     : m_vm(vm)
</span><del>-    , m_stack(vm)
</del><ins>+#if !ENABLE(JIT)
+    , m_cloopStack(vm)
+#endif
</ins><span class="cx">     , m_errorHandlingModeReentry(0)
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx">     , m_initialized(false)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSCell.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;Opcode.h&quot;
</span><span class="cx"> #include &quot;SourceProvider.h&quot;
</span><span class="cx"> #include &quot;StackAlignment.h&quot;
</span><span class="lines">@@ -42,6 +41,11 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><ins>+#if !ENABLE(JIT)
+#include &quot;CLoopStack.h&quot;
+#endif
+
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx">     class CodeBlock;
</span><span class="lines">@@ -180,7 +184,9 @@
</span><span class="cx">         
</span><span class="cx">         void initialize();
</span><span class="cx"> 
</span><del>-        JSStack&amp; stack() { return m_stack; }
</del><ins>+#if !ENABLE(JIT)
+        CLoopStack&amp; cloopStack() { return m_cloopStack; }
+#endif
</ins><span class="cx">         
</span><span class="cx">         Opcode getOpcode(OpcodeID id)
</span><span class="cx">         {
</span><span class="lines">@@ -241,7 +247,9 @@
</span><span class="cx">         bool isCallBytecode(Opcode opcode) { return opcode == getOpcode(op_call) || opcode == getOpcode(op_construct) || opcode == getOpcode(op_call_eval) || opcode == getOpcode(op_tail_call); }
</span><span class="cx"> 
</span><span class="cx">         VM&amp; m_vm;
</span><del>-        JSStack m_stack;
</del><ins>+#if !ENABLE(JIT)
+        CLoopStack m_cloopStack;
+#endif
</ins><span class="cx">         int m_errorHandlingModeReentry;
</span><span class="cx">         
</span><span class="cx"> #if ENABLE(COMPUTED_GOTO_OPCODES)
</span><span class="lines">@@ -273,8 +281,8 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned sizeOfVarargs(CallFrame* exec, JSValue arguments, uint32_t firstVarArgOffset);
</span><span class="cx">     static const unsigned maxArguments = 0x10000;
</span><del>-    unsigned sizeFrameForVarargs(CallFrame* exec, JSStack*, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset);
-    unsigned sizeFrameForForwardArguments(CallFrame* exec, JSStack*, unsigned numUsedStackSlots);
</del><ins>+    unsigned sizeFrameForVarargs(CallFrame* exec, VM&amp;, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset);
+    unsigned sizeFrameForForwardArguments(CallFrame* exec, VM&amp;, unsigned numUsedStackSlots);
</ins><span class="cx">     void loadVarargs(CallFrame* execCaller, VirtualRegister firstElementDest, JSValue source, uint32_t offset, uint32_t length);
</span><span class="cx">     void setupVarargsFrame(CallFrame* execCaller, CallFrame* execCallee, JSValue arguments, uint32_t firstVarArgOffset, uint32_t length);
</span><span class="cx">     void setupVarargsFrameAndSetThis(CallFrame* execCaller, CallFrame* execCallee, JSValue thisValue, JSValue arguments, uint32_t firstVarArgOffset, uint32_t length);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterJSStackcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/interpreter/JSStack.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/JSStack.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/JSStack.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,184 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008, 2013-2016 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 Inc. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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 &quot;config.h&quot;
-#include &quot;JSStackInlines.h&quot;
-
-#include &quot;ConservativeRoots.h&quot;
-#include &quot;Interpreter.h&quot;
-#include &quot;JSCInlines.h&quot;
-#include &quot;Options.h&quot;
-#include &lt;wtf/Lock.h&gt;
-
-namespace JSC {
-
-#if !ENABLE(JIT)
-static size_t committedBytesCount = 0;
-
-static size_t commitSize()
-{
-    static size_t size = std::max&lt;size_t&gt;(16 * 1024, pageSize());
-    return size;
-}
-
-static StaticLock stackStatisticsMutex;
-#endif // !ENABLE(JIT)
-
-JSStack::JSStack(VM&amp; vm)
-    : m_vm(vm)
-    , m_topCallFrame(vm.topCallFrame)
-#if !ENABLE(JIT)
-    , m_end(0)
-    , m_reservedZoneSizeInRegisters(0)
-#endif
-{
-#if !ENABLE(JIT)
-    size_t capacity = Options::maxPerThreadStackUsage();
-    ASSERT(capacity &amp;&amp; isPageAligned(capacity));
-
-    m_reservation = PageReservation::reserve(WTF::roundUpToMultipleOf(commitSize(), capacity), OSAllocator::JSVMStackPages);
-    setCLoopStackLimit(highAddress());
-    m_commitTop = highAddress();
-    
-    m_lastStackTop = baseOfStack();
-#endif // !ENABLE(JIT)
-
-    m_topCallFrame = 0;
-}
-
-#if !ENABLE(JIT)
-JSStack::~JSStack()
-{
-    ptrdiff_t sizeToDecommit = reinterpret_cast&lt;char*&gt;(highAddress()) - reinterpret_cast&lt;char*&gt;(m_commitTop);
-    m_reservation.decommit(reinterpret_cast&lt;void*&gt;(m_commitTop), sizeToDecommit);
-    addToCommittedByteCount(-sizeToDecommit);
-    m_reservation.deallocate();
-}
-
-bool JSStack::growSlowCase(Register* newTopOfStack)
-{
-    Register* newTopOfStackWithReservedZone = newTopOfStack - m_reservedZoneSizeInRegisters;
-
-    // If we have already committed enough memory to satisfy this request,
-    // just update the end pointer and return.
-    if (newTopOfStackWithReservedZone &gt;= m_commitTop) {
-        setCLoopStackLimit(newTopOfStack);
-        return true;
-    }
-
-    // Compute the chunk size of additional memory to commit, and see if we
-    // have it is still within our budget. If not, we'll fail to grow and
-    // return false.
-    ptrdiff_t delta = reinterpret_cast&lt;char*&gt;(m_commitTop) - reinterpret_cast&lt;char*&gt;(newTopOfStackWithReservedZone);
-    delta = WTF::roundUpToMultipleOf(commitSize(), delta);
-    Register* newCommitTop = m_commitTop - (delta / sizeof(Register));
-    if (newCommitTop &lt; reservationTop())
-        return false;
-
-    // Otherwise, the growth is still within our budget. Commit it and return true.
-    m_reservation.commit(newCommitTop, delta);
-    addToCommittedByteCount(delta);
-    m_commitTop = newCommitTop;
-    setCLoopStackLimit(newTopOfStack);
-    return true;
-}
-
-void JSStack::gatherConservativeRoots(ConservativeRoots&amp; conservativeRoots, JITStubRoutineSet&amp; jitStubRoutines, CodeBlockSet&amp; codeBlocks)
-{
-    conservativeRoots.add(topOfStack() + 1, highAddress(), jitStubRoutines, codeBlocks);
-}
-
-void JSStack::sanitizeStack()
-{
-#if !ASAN_ENABLED
-    ASSERT(topOfStack() &lt;= baseOfStack());
-    
-    if (m_lastStackTop &lt; topOfStack()) {
-        char* begin = reinterpret_cast&lt;char*&gt;(m_lastStackTop + 1);
-        char* end = reinterpret_cast&lt;char*&gt;(topOfStack() + 1);
-        memset(begin, 0, end - begin);
-    }
-    
-    m_lastStackTop = topOfStack();
-#endif
-}
-
-void JSStack::releaseExcessCapacity()
-{
-    Register* highAddressWithReservedZone = highAddress() - m_reservedZoneSizeInRegisters;
-    ptrdiff_t delta = reinterpret_cast&lt;char*&gt;(highAddressWithReservedZone) - reinterpret_cast&lt;char*&gt;(m_commitTop);
-    m_reservation.decommit(m_commitTop, delta);
-    addToCommittedByteCount(-delta);
-    m_commitTop = highAddressWithReservedZone;
-}
-
-void JSStack::addToCommittedByteCount(long byteCount)
-{
-    LockHolder locker(stackStatisticsMutex);
-    ASSERT(static_cast&lt;long&gt;(committedBytesCount) + byteCount &gt; -1);
-    committedBytesCount += byteCount;
-}
-
-void JSStack::setReservedZoneSize(size_t reservedZoneSize)
-{
-    m_reservedZoneSizeInRegisters = reservedZoneSize / sizeof(Register);
-    if (m_commitTop &gt;= (m_end + 1) - m_reservedZoneSizeInRegisters)
-        growSlowCase(m_end + 1);
-}
-#endif // !ENABLE(JIT)
-
-#if ENABLE(JIT)
-Register* JSStack::lowAddress() const
-{
-    ASSERT(wtfThreadData().stack().isGrowingDownward());
-    return reinterpret_cast&lt;Register*&gt;(m_vm.osStackLimitWithReserve());
-}
-
-Register* JSStack::highAddress() const
-{
-    ASSERT(wtfThreadData().stack().isGrowingDownward());
-    return reinterpret_cast&lt;Register*&gt;(wtfThreadData().stack().origin());
-}
-#endif // ENABLE(JIT)
-
-size_t JSStack::committedByteCount()
-{
-#if !ENABLE(JIT)
-    LockHolder locker(stackStatisticsMutex);
-    return committedBytesCount;
-#else
-    // When using the C stack, we don't know how many stack pages are actually
-    // committed. So, we use the current stack usage as an estimate.
-    ASSERT(wtfThreadData().stack().isGrowingDownward());
-    int8_t* current = reinterpret_cast&lt;int8_t*&gt;(&amp;current);
-    int8_t* high = reinterpret_cast&lt;int8_t*&gt;(wtfThreadData().stack().origin());
-    return high - current;
-#endif
-}
-
-} // namespace JSC
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterJSStackh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/interpreter/JSStack.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/JSStack.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/JSStack.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,126 +0,0 @@
</span><del>-/*
- * Copyright (C) 2008-2009, 2013-2014, 2016 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 Inc. (&quot;Apple&quot;) 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 &quot;AS IS&quot; 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 JSStack_h
-#define JSStack_h
-
-#include &quot;Register.h&quot;
-#include &lt;wtf/Noncopyable.h&gt;
-#include &lt;wtf/PageReservation.h&gt;
-#include &lt;wtf/VMTags.h&gt;
-
-namespace JSC {
-
-    class CodeBlockSet;
-    class ConservativeRoots;
-    class JITStubRoutineSet;
-    class VM;
-    class LLIntOffsetsExtractor;
-
-    class JSStack {
-        WTF_MAKE_NONCOPYABLE(JSStack);
-    public:
-        // Allow 8k of excess registers before we start trying to reap the stack
-        static const ptrdiff_t maxExcessCapacity = 8 * 1024;
-
-        JSStack(VM&amp;);
-        
-        bool ensureCapacityFor(Register* newTopOfStack);
-
-        bool containsAddress(Register* address) { return (lowAddress() &lt;= address &amp;&amp; address &lt; highAddress()); }
-        static size_t committedByteCount();
-
-#if !ENABLE(JIT)
-        ~JSStack();
-
-        void gatherConservativeRoots(ConservativeRoots&amp;, JITStubRoutineSet&amp;, CodeBlockSet&amp;);
-        void sanitizeStack();
-
-        Register* baseOfStack() const
-        {
-            return highAddress() - 1;
-        }
-
-        size_t size() const { return highAddress() - lowAddress(); }
-
-        void setReservedZoneSize(size_t);
-
-        inline Register* topOfStack();
-#endif // ENABLE(JIT)
-
-    private:
-
-#if !ENABLE(JIT)
-        Register* lowAddress() const
-        {
-            return m_end + 1;
-        }
-
-        Register* highAddress() const
-        {
-            return reinterpret_cast_ptr&lt;Register*&gt;(static_cast&lt;char*&gt;(m_reservation.base()) + m_reservation.size());
-        }
-#else
-        Register* lowAddress() const;
-        Register* highAddress() const;
-#endif // !ENABLE(JIT)
-
-#if !ENABLE(JIT)
-        inline Register* topOfFrameFor(CallFrame*);
-
-        Register* reservationTop() const
-        {
-            char* reservationTop = static_cast&lt;char*&gt;(m_reservation.base());
-            return reinterpret_cast_ptr&lt;Register*&gt;(reservationTop);
-        }
-
-        bool grow(Register* newTopOfStack);
-        bool growSlowCase(Register* newTopOfStack);
-        void shrink(Register* newTopOfStack);
-        void releaseExcessCapacity();
-        void addToCommittedByteCount(long);
-
-        void setCLoopStackLimit(Register* newTopOfStack);
-#endif // !ENABLE(JIT)
-
-        VM&amp; m_vm;
-        CallFrame*&amp; m_topCallFrame;
-#if !ENABLE(JIT)
-        Register* m_end;
-        Register* m_commitTop;
-        PageReservation m_reservation;
-        Register* m_lastStackTop;
-        ptrdiff_t m_reservedZoneSizeInRegisters;
-#endif // !ENABLE(JIT)
-
-        friend class LLIntOffsetsExtractor;
-    };
-
-} // namespace JSC
-
-#endif // JSStack_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterJSStackInlinesh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/JSStackInlines.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,94 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012-2014, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef JSStackInlines_h
-#define JSStackInlines_h
-
-#include &quot;CallFrame.h&quot;
-#include &quot;CodeBlock.h&quot;
-#include &quot;JSStack.h&quot;
-#include &quot;VM.h&quot;
-
-namespace JSC {
-
-inline bool JSStack::ensureCapacityFor(Register* newTopOfStack)
-{
-#if !ENABLE(JIT)
-    return grow(newTopOfStack);
-#else
-    ASSERT(wtfThreadData().stack().isGrowingDownward());
-    return newTopOfStack &gt;= m_vm.osStackLimitWithReserve();
-#endif
-}
-
-#if !ENABLE(JIT)
-
-inline Register* JSStack::topOfFrameFor(CallFrame* frame)
-{
-    if (UNLIKELY(!frame))
-        return baseOfStack();
-    return frame-&gt;topOfFrame() - 1;
-}
-
-inline Register* JSStack::topOfStack()
-{
-    return topOfFrameFor(m_topCallFrame);
-}
-
-inline void JSStack::shrink(Register* newTopOfStack)
-{
-    Register* newEnd = newTopOfStack - 1;
-    if (newEnd &gt;= m_end)
-        return;
-    setCLoopStackLimit(newTopOfStack);
-    // Note: Clang complains of an unresolved linkage to maxExcessCapacity if
-    // invoke std::max() with it as an argument. To work around this, we first
-    // assign the constant to a local variable, and use the local instead.
-    ptrdiff_t maxExcessCapacity = JSStack::maxExcessCapacity;
-    ptrdiff_t maxExcessInRegisters = std::max(maxExcessCapacity, m_reservedZoneSizeInRegisters);
-    if (m_end == baseOfStack() &amp;&amp; (highAddress() - m_commitTop) &gt;= maxExcessInRegisters)
-        releaseExcessCapacity();
-}
-
-inline bool JSStack::grow(Register* newTopOfStack)
-{
-    Register* newEnd = newTopOfStack - 1;
-    if (newEnd &gt;= m_end)
-        return true;
-    return growSlowCase(newTopOfStack);
-}
-
-inline void JSStack::setCLoopStackLimit(Register* newTopOfStack)
-{
-    Register* newEnd = newTopOfStack - 1;
-    m_end = newEnd;
-    m_vm.setCLoopStackLimit(newTopOfStack);
-}
-
-#endif // !ENABLE(JIT)
-
-} // namespace JSC
-
-#endif // JSStackInlines_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterStackVisitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -424,6 +424,7 @@
</span><span class="cx"> 
</span><span class="cx">             indent--;
</span><span class="cx">         }
</span><ins>+        out.print(indent, &quot;vmEntryFrame: &quot;, RawPointer(vmEntryFrame()), &quot;\n&quot;);
</ins><span class="cx">         indent--;
</span><span class="cx">     }
</span><span class="cx">     out.print(indent, &quot;}\n&quot;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/jit/JIT.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx">     class Identifier;
</span><span class="cx">     class Interpreter;
</span><span class="cx">     class JSScope;
</span><del>-    class JSStack;
</del><span class="cx">     class MarkedAllocator;
</span><span class="cx">     class Register;
</span><span class="cx">     class StructureChain;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><span class="cx"> #include &quot;JSLexicalEnvironment.h&quot;
</span><span class="cx"> #include &quot;JSPropertyNameEnumerator.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;ObjectConstructor.h&quot;
</span><span class="cx"> #include &quot;PolymorphicAccess.h&quot;
</span><span class="lines">@@ -129,9 +128,8 @@
</span><span class="cx"> int32_t JIT_OPERATION operationCallArityCheck(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    JSStack&amp; stack = vm-&gt;interpreter-&gt;stack();
</del><span class="cx"> 
</span><del>-    int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, &amp;stack, CodeForCall);
</del><ins>+    int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, *vm, CodeForCall);
</ins><span class="cx">     if (missingArgCount &lt; 0) {
</span><span class="cx">         VMEntryFrame* vmEntryFrame = vm-&gt;topVMEntryFrame;
</span><span class="cx">         CallFrame* callerFrame = exec-&gt;callerFrame(vmEntryFrame);
</span><span class="lines">@@ -145,9 +143,8 @@
</span><span class="cx"> int32_t JIT_OPERATION operationConstructArityCheck(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><del>-    JSStack&amp; stack = vm-&gt;interpreter-&gt;stack();
</del><span class="cx"> 
</span><del>-    int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, &amp;stack, CodeForConstruct);
</del><ins>+    int32_t missingArgCount = CommonSlowPaths::arityCheckFor(exec, *vm, CodeForConstruct);
</ins><span class="cx">     if (missingArgCount &lt; 0) {
</span><span class="cx">         VMEntryFrame* vmEntryFrame = vm-&gt;topVMEntryFrame;
</span><span class="cx">         CallFrame* callerFrame = exec-&gt;callerFrame(vmEntryFrame);
</span><span class="lines">@@ -1924,8 +1921,7 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    JSStack* stack = &amp;exec-&gt;interpreter()-&gt;stack();
-    return sizeFrameForForwardArguments(exec, stack, numUsedStackSlots);
</del><ins>+    return sizeFrameForForwardArguments(exec, vm, numUsedStackSlots);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int32_t JIT_OPERATION operationSizeFrameForVarargs(ExecState* exec, EncodedJSValue encodedArguments, int32_t numUsedStackSlots, int32_t firstVarArgOffset)
</span><span class="lines">@@ -1932,9 +1928,8 @@
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><del>-    JSStack* stack = &amp;exec-&gt;interpreter()-&gt;stack();
</del><span class="cx">     JSValue arguments = JSValue::decode(encodedArguments);
</span><del>-    return sizeFrameForVarargs(exec, stack, arguments, numUsedStackSlots, firstVarArgOffset);
</del><ins>+    return sizeFrameForVarargs(exec, vm, arguments, numUsedStackSlots, firstVarArgOffset);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CallFrame* JIT_OPERATION operationSetupForwardArgumentsFrame(ExecState* exec, CallFrame* newCallFrame, EncodedJSValue, int32_t, int32_t length)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJSInterfaceJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -33,7 +33,6 @@
</span><span class="cx"> #include &quot;JITCode.h&quot;
</span><span class="cx"> #include &quot;JITOperations.h&quot;
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;MacroAssembler.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitSpecializedThunkJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><span class="cx"> #include &quot;JITInlines.h&quot;
</span><span class="cx"> #include &quot;JSInterfaceJIT.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;LinkBuffer.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitThunkGeneratorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010, 2012, 2013, 2014, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2012-2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include &quot;JITOperations.h&quot;
</span><span class="cx"> #include &quot;JSArray.h&quot;
</span><span class="cx"> #include &quot;JSBoundFunction.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;MathCommon.h&quot;
</span><span class="cx"> #include &quot;MaxFrameExtentForSlowPathCall.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><span class="cx"> #include &quot;JSModuleRecord.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;JSTypeInfo.h&quot;
</span><span class="cx"> #include &quot;JumpTable.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><span class="cx"> #include &quot;JSGeneratorFunction.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObjectFunctions.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;JSString.h&quot;
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LLIntCommon.h&quot;
</span><span class="lines">@@ -498,8 +497,8 @@
</span><span class="cx">     // Hence, if we get here, then we know a stack overflow is imminent. So, just
</span><span class="cx">     // throw the StackOverflowError unconditionally.
</span><span class="cx"> #if !ENABLE(JIT)
</span><del>-    ASSERT(!vm.interpreter-&gt;stack().containsAddress(exec-&gt;topOfFrame()));
-    if (LIKELY(vm.interpreter-&gt;stack().ensureCapacityFor(exec-&gt;topOfFrame())))
</del><ins>+    ASSERT(!vm.interpreter-&gt;cloopStack().containsAddress(exec-&gt;topOfFrame()));
+    if (LIKELY(vm.ensureStackCapacityFor(exec-&gt;topOfFrame())))
</ins><span class="cx">         LLINT_RETURN_TWO(pc, 0);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1352,7 +1351,7 @@
</span><span class="cx">     // - Set up a call frame while respecting the variable arguments.
</span><span class="cx">     
</span><span class="cx">     unsigned numUsedStackSlots = -pc[5].u.operand;
</span><del>-    unsigned length = sizeFrameForVarargs(exec, &amp;vm.interpreter-&gt;stack(),
</del><ins>+    unsigned length = sizeFrameForVarargs(exec, vm,
</ins><span class="cx">         LLINT_OP_C(4).jsValue(), numUsedStackSlots, pc[6].u.operand);
</span><span class="cx">     LLINT_CALL_CHECK_EXCEPTION(exec, exec);
</span><span class="cx">     
</span><span class="lines">@@ -1371,7 +1370,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned numUsedStackSlots = -pc[5].u.operand;
</span><span class="cx"> 
</span><del>-    unsigned arguments = sizeFrameForForwardArguments(exec, &amp;vm.interpreter-&gt;stack(), numUsedStackSlots);
</del><ins>+    unsigned arguments = sizeFrameForForwardArguments(exec, vm, numUsedStackSlots);
</ins><span class="cx">     LLINT_CALL_CHECK_EXCEPTION(exec, exec);
</span><span class="cx"> 
</span><span class="cx">     ExecState* execCallee = calleeFrameForVarargs(exec, numUsedStackSlots, arguments + 1);
</span><span class="lines">@@ -1629,7 +1628,7 @@
</span><span class="cx"> #if !ENABLE(JIT)
</span><span class="cx"> extern &quot;C&quot; SlowPathReturnType llint_stack_check_at_vm_entry(VM* vm, Register* newTopOfStack)
</span><span class="cx"> {
</span><del>-    bool success = vm-&gt;interpreter-&gt;stack().ensureCapacityFor(newTopOfStack);
</del><ins>+    bool success = vm-&gt;ensureStackCapacityFor(newTopOfStack);
</ins><span class="cx">     return encodeResult(reinterpret_cast&lt;void*&gt;(success), 0);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntThunkscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;JSCJSValueInlines.h&quot;
</span><span class="cx"> #include &quot;JSInterfaceJIT.h&quot;
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;LLIntCLoop.h&quot;
</span><span class="cx"> #include &quot;LinkBuffer.h&quot;
</span><span class="cx"> #include &quot;LowLevelInterpreter.h&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -330,7 +330,7 @@
</span><span class="cx">     CLoopDoubleRegister d0, d1;
</span><span class="cx"> 
</span><span class="cx">     lr.opcode = getOpcode(llint_return_to_host);
</span><del>-    sp.vp = vm-&gt;interpreter-&gt;stack().topOfStack() + 1;
</del><ins>+    sp.vp = vm-&gt;interpreter-&gt;cloopStack().topOfStack() + 1;
</ins><span class="cx">     cfr.callFrame = vm-&gt;topCallFrame;
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     void* startSP = sp.vp;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> SLOW_PATH_DECL(slow_path_call_arityCheck)
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><del>-    int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, &amp;vm.interpreter-&gt;stack(), CodeForCall);
</del><ins>+    int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, vm, CodeForCall);
</ins><span class="cx">     if (slotsToAdd &lt; 0) {
</span><span class="cx">         exec = exec-&gt;callerFrame();
</span><span class="cx">         ErrorHandlingScope errorScope(exec-&gt;vm());
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> SLOW_PATH_DECL(slow_path_construct_arityCheck)
</span><span class="cx"> {
</span><span class="cx">     BEGIN();
</span><del>-    int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, &amp;vm.interpreter-&gt;stack(), CodeForConstruct);
</del><ins>+    int slotsToAdd = CommonSlowPaths::arityCheckFor(exec, vm, CodeForConstruct);
</ins><span class="cx">     if (slotsToAdd &lt; 0) {
</span><span class="cx">         exec = exec-&gt;callerFrame();
</span><span class="cx">         ErrorHandlingScope errorScope(exec-&gt;vm());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011-2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2011-2013, 2015-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,11 +29,10 @@
</span><span class="cx"> #include &quot;CodeBlock.h&quot;
</span><span class="cx"> #include &quot;CodeSpecializationKind.h&quot;
</span><span class="cx"> #include &quot;ExceptionHelpers.h&quot;
</span><del>-#include &quot;JSStackInlines.h&quot;
</del><span class="cx"> #include &quot;SlowPathReturnType.h&quot;
</span><span class="cx"> #include &quot;StackAlignment.h&quot;
</span><span class="cx"> #include &quot;Symbol.h&quot;
</span><del>-#include &quot;VM.h&quot;
</del><ins>+#include &quot;VMInlines.h&quot;
</ins><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -52,7 +51,7 @@
</span><span class="cx">     void* thunkToCall;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE int arityCheckFor(ExecState* exec, JSStack* stack, CodeSpecializationKind kind)
</del><ins>+ALWAYS_INLINE int arityCheckFor(ExecState* exec, VM&amp; vm, CodeSpecializationKind kind)
</ins><span class="cx"> {
</span><span class="cx">     JSFunction* callee = jsCast&lt;JSFunction*&gt;(exec-&gt;callee());
</span><span class="cx">     ASSERT(!callee-&gt;isHostFunction());
</span><span class="lines">@@ -65,7 +64,7 @@
</span><span class="cx">         newCodeBlock-&gt;numParameters() + CallFrame::headerSizeInRegisters);
</span><span class="cx">     int paddedStackSpace = alignedFrameSizeForParameters - frameSize;
</span><span class="cx"> 
</span><del>-    if (!stack-&gt;ensureCapacityFor(exec-&gt;registers() - paddedStackSpace % stackAlignmentRegisters()))
</del><ins>+    if (UNLIKELY(!vm.ensureStackCapacityFor(exec-&gt;registers() - paddedStackSpace % stackAlignmentRegisters())))
</ins><span class="cx">         return -1;
</span><span class="cx">     return paddedStackSpace;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeErrorHandlingScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/ErrorHandlingScope.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ErrorHandlingScope.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;Interpreter.h&quot;
</del><span class="cx"> #include &quot;Options.h&quot;
</span><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -38,9 +37,6 @@
</span><span class="cx">     RELEASE_ASSERT(m_vm.stackPointerAtVMEntry());
</span><span class="cx">     size_t newReservedZoneSize = Options::errorModeReservedZoneSize();
</span><span class="cx">     m_savedReservedZoneSize = m_vm.updateReservedZoneSize(newReservedZoneSize);
</span><del>-#if !ENABLE(JIT)
-    m_vm.interpreter-&gt;stack().setReservedZoneSize(newReservedZoneSize);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ErrorHandlingScope::~ErrorHandlingScope()
</span><span class="lines">@@ -47,9 +43,6 @@
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(m_vm.stackPointerAtVMEntry());
</span><span class="cx">     m_vm.updateReservedZoneSize(m_savedReservedZoneSize);
</span><del>-#if !ENABLE(JIT)
-    m_vm.interpreter-&gt;stack().setReservedZoneSize(m_savedReservedZoneSize);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -77,7 +77,6 @@
</span><span class="cx"> class JSPromise;
</span><span class="cx"> class JSPromiseConstructor;
</span><span class="cx"> class JSPromisePrototype;
</span><del>-class JSStack;
</del><span class="cx"> class JSTypedArrayViewConstructor;
</span><span class="cx"> class JSTypedArrayViewPrototype;
</span><span class="cx"> class LLIntOffsetsExtractor;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeMemoryStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/MemoryStatistics.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/MemoryStatistics.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/MemoryStatistics.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2010, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ExecutableAllocator.h&quot;
</span><span class="cx"> #include &quot;VM.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -36,7 +35,7 @@
</span><span class="cx"> {
</span><span class="cx">     GlobalMemoryStatistics stats;
</span><span class="cx"> 
</span><del>-    stats.stackBytes = JSStack::committedByteCount();
</del><ins>+    stats.stackBytes = VM::committedStackByteCount();
</ins><span class="cx"> #if ENABLE(ASSEMBLER)
</span><span class="cx">     stats.JITBytes = ExecutableAllocator::committedByteCount();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeStackAlignmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/StackAlignment.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/StackAlignment.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/StackAlignment.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #define StackAlignment_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSCJSValue.h&quot;
</span><del>-#include &quot;JSStack.h&quot;
</del><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -106,6 +106,10 @@
</span><span class="cx"> #include &lt;wtf/text/AtomicStringTable.h&gt;
</span><span class="cx"> #include &lt;wtf/text/SymbolRegistry.h&gt;
</span><span class="cx"> 
</span><ins>+#if !ENABLE(JIT)
+#include &quot;CLoopStack.h&quot;
+#endif
+
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx"> #include &quot;ConservativeRoots.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -194,9 +198,6 @@
</span><span class="cx">     interpreter = new Interpreter(*this);
</span><span class="cx">     StackBounds stack = wtfThreadData().stack();
</span><span class="cx">     updateReservedZoneSize(Options::reservedZoneSize());
</span><del>-#if !ENABLE(JIT)
-    interpreter-&gt;stack().setReservedZoneSize(Options::reservedZoneSize());
-#endif
</del><span class="cx">     setLastStackTop(stack.origin());
</span><span class="cx"> 
</span><span class="cx">     // Need to be careful to keep everything consistent here
</span><span class="lines">@@ -616,6 +617,9 @@
</span><span class="cx"> {
</span><span class="cx">     size_t oldReservedZoneSize = m_reservedZoneSize;
</span><span class="cx">     m_reservedZoneSize = reservedZoneSize;
</span><ins>+#if !ENABLE(JIT)
+    interpreter-&gt;cloopStack().setReservedZoneSize(reservedZoneSize);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     updateStackLimit();
</span><span class="cx"> 
</span><span class="lines">@@ -839,10 +843,24 @@
</span><span class="cx"> {
</span><span class="cx">     logSanitizeStack(vm);
</span><span class="cx"> #if !ENABLE(JIT)
</span><del>-    vm-&gt;interpreter-&gt;stack().sanitizeStack();
</del><ins>+    vm-&gt;interpreter-&gt;cloopStack().sanitizeStack();
</ins><span class="cx"> #else
</span><span class="cx">     sanitizeStackForVMImpl(vm);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+size_t VM::committedStackByteCount()
+{
+#if ENABLE(JIT)
+    // When using the C stack, we don't know how many stack pages are actually
+    // committed. So, we use the current stack usage as an estimate.
+    ASSERT(wtfThreadData().stack().isGrowingDownward());
+    int8_t* current = reinterpret_cast&lt;int8_t*&gt;(&amp;current);
+    int8_t* high = reinterpret_cast&lt;int8_t*&gt;(wtfThreadData().stack().origin());
+    return high - current;
+#else
+    return CLoopStack::committedByteCount();
+#endif
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx"> class LLIntOffsetsExtractor;
</span><span class="cx"> class NativeExecutable;
</span><span class="cx"> class RegExpCache;
</span><ins>+class Register;
</ins><span class="cx"> class RegisterAtOffsetList;
</span><span class="cx"> #if ENABLE(SAMPLING_PROFILER)
</span><span class="cx"> class SamplingProfiler;
</span><span class="lines">@@ -461,6 +462,9 @@
</span><span class="cx">     size_t reservedZoneSize() const { return m_reservedZoneSize; }
</span><span class="cx">     size_t updateReservedZoneSize(size_t reservedZoneSize);
</span><span class="cx"> 
</span><ins>+    static size_t committedStackByteCount();
+    inline bool ensureStackCapacityFor(Register* newTopOfStack);
+
</ins><span class="cx">     void* osStackLimitWithReserve() { return m_osStackLimitWithReserve; }
</span><span class="cx">     void** addressOfOSStackLimitWithReserve() { return &amp;m_osStackLimitWithReserve; }
</span><span class="cx"> #if !ENABLE(JIT)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMInlines.h (203080 => 203081)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMInlines.h        2016-07-11 20:22:56 UTC (rev 203080)
+++ trunk/Source/JavaScriptCore/runtime/VMInlines.h        2016-07-11 20:48:15 UTC (rev 203081)
</span><span class="lines">@@ -30,8 +30,23 @@
</span><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> #include &quot;Watchdog.h&quot;
</span><span class="cx"> 
</span><ins>+#if !ENABLE(JIT)
+#include &quot;CLoopStackInlines.h&quot;
+#endif
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx">     
</span><ins>+bool VM::ensureStackCapacityFor(Register* newTopOfStack)
+{
+#if ENABLE(JIT)
+    ASSERT(wtfThreadData().stack().isGrowingDownward());
+    return newTopOfStack &gt;= m_osStackLimitWithReserve;
+#else
+    return interpreter-&gt;cloopStack().ensureCapacityFor(newTopOfStack);
+#endif
+    
+}
+
</ins><span class="cx"> bool VM::shouldTriggerTermination(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     if (!watchdog())
</span></span></pre>
</div>
</div>

</body>
</html>