<!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>[160835] branches/jsCStack/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/160835">160835</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2013-12-19 09:22:19 -0800 (Thu, 19 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clarified stack maintainence code
https://bugs.webkit.org/show_bug.cgi?id=125979

Reviewed by Phil Pizlo.

Our idiom is:
    * frameRegisterCount() is the distance between BP and SP
    * stackPointerOffset() is frameRegisterCount() converted to a stack offset
    * Stack checks don't need to check the stack used by C helper functions,
    since our reserved host zone will cover that.

* assembler/MaxFrameExtentForSlowPathCall.h: Reverted some pieces of
&lt;http://trac.webkit.org/changeset/160745&gt;. We don't consider our
callee's saved PC and BP a part of our stack frame because they lie
beneath our SP.

* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:
(JSC::CodeBlock::stackPointerOffset): New helper function. Lots of
callers were duplicating this, so I made a helper function.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCall):
(JSC::DFG::ByteCodeParser::parseBlock): Fixed a bug in the calculation
of m_parameterSlots. Within our stack frame, we don't reserve space for
our callee's saved PC and BP, so we don't need to add them to
m_parameterSlots.

* dfg/DFGGraph.cpp:
* dfg/DFGGraph.h:
(JSC::DFG::Graph::stackPointerOffset): New helper function. Lots of
callers were duplicating this, so I made a helper function.

* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::adjustAndJumpToTarget):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::topOfFrameInternal): Use the new helper function, so
everybody calculates SP the same way. This removes the two idiosyncratic
places that reserved extra space for our callee's CallerFrameAndPCSize.

* interpreter/JSStack.h:
* interpreter/JSStackInlines.h:
(JSC::JSStack::entryCheck):
(JSC::JSStack::pushFrame):
(JSC::JSStack::grow): Changed the interface here to accept a top-of-stack
pointer instead of a past-the-end pointer. The engine no longer computes
a past-the-end pointer, so this is more convenient.

* jit/JIT.cpp:
(JSC::JIT::privateCompile):
(JSC::JIT::stackPointerOffsetFor): Use the helper function, fixing a bug
where, incorrectly, we subtracted out maxFrameExtentForSlowPathCall.

* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp: Use the helper function, so everybody does this
calculation the same way.

* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions): Reverted some pieces of
&lt;http://trac.webkit.org/changeset/160745&gt;, as above.

* llint/LLIntEntrypoint.cpp:
* llint/LLIntEntrypoint.h:
(JSC::LLInt::stackPointerOffsetFor): Helper function, as above.

* llint/LowLevelInterpreter.asm: Reverted some pieces of
&lt;http://trac.webkit.org/changeset/160745&gt;, as above.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesjsCStackSourceJavaScriptCoreChangeLog">branches/jsCStack/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreassemblerMaxFrameExtentForSlowPathCallh">branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorebytecodeCodeBlockcpp">branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorebytecodeCodeBlockh">branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGByteCodeParsercpp">branches/jsCStack/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGGraphcpp">branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGGraphh">branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGJITCompilercpp">branches/jsCStack/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGOSRExitCompilerCommoncpp">branches/jsCStack/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp">branches/jsCStack/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreinterpreterCallFramecpp">branches/jsCStack/Source/JavaScriptCore/interpreter/CallFrame.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreinterpreterJSStackh">branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreinterpreterJSStackInlinesh">branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITcpp">branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITh">branches/jsCStack/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITCallcpp">branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITOpcodescpp">branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITOpcodes32_64cpp">branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITOperationscpp">branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLLIntDatacpp">branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreterasm">branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesjsCStackSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/ChangeLog (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -1,3 +1,85 @@
</span><ins>+2013-12-18  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Clarified stack maintainence code
+        https://bugs.webkit.org/show_bug.cgi?id=125979
+
+        Reviewed by Phil Pizlo.
+
+        Our idiom is:
+            * frameRegisterCount() is the distance between BP and SP
+            * stackPointerOffset() is frameRegisterCount() converted to a stack offset
+            * Stack checks don't need to check the stack used by C helper functions,
+            since our reserved host zone will cover that.
+
+        * assembler/MaxFrameExtentForSlowPathCall.h: Reverted some pieces of
+        &lt;http://trac.webkit.org/changeset/160745&gt;. We don't consider our
+        callee's saved PC and BP a part of our stack frame because they lie
+        beneath our SP.
+
+        * bytecode/CodeBlock.cpp:
+        * bytecode/CodeBlock.h:
+        (JSC::CodeBlock::stackPointerOffset): New helper function. Lots of
+        callers were duplicating this, so I made a helper function.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::addCall):
+        (JSC::DFG::ByteCodeParser::parseBlock): Fixed a bug in the calculation
+        of m_parameterSlots. Within our stack frame, we don't reserve space for
+        our callee's saved PC and BP, so we don't need to add them to
+        m_parameterSlots.
+
+        * dfg/DFGGraph.cpp:
+        * dfg/DFGGraph.h:
+        (JSC::DFG::Graph::stackPointerOffset): New helper function. Lots of
+        callers were duplicating this, so I made a helper function.
+
+        * dfg/DFGJITCompiler.cpp:
+        (JSC::DFG::JITCompiler::compile):
+        (JSC::DFG::JITCompiler::compileFunction):
+        * dfg/DFGOSRExitCompilerCommon.cpp:
+        (JSC::DFG::adjustAndJumpToTarget):
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::topOfFrameInternal): Use the new helper function, so
+        everybody calculates SP the same way. This removes the two idiosyncratic
+        places that reserved extra space for our callee's CallerFrameAndPCSize.
+
+        * interpreter/JSStack.h:
+        * interpreter/JSStackInlines.h:
+        (JSC::JSStack::entryCheck):
+        (JSC::JSStack::pushFrame):
+        (JSC::JSStack::grow): Changed the interface here to accept a top-of-stack
+        pointer instead of a past-the-end pointer. The engine no longer computes
+        a past-the-end pointer, so this is more convenient.
+
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompile):
+        (JSC::JIT::stackPointerOffsetFor): Use the helper function, fixing a bug
+        where, incorrectly, we subtracted out maxFrameExtentForSlowPathCall.
+
+        * jit/JIT.h:
+        * jit/JITCall.cpp:
+        (JSC::JIT::compileOpCall):
+        (JSC::JIT::compileOpCallSlowCase):
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_catch):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_catch):
+        * jit/JITOperations.cpp: Use the helper function, so everybody does this
+        calculation the same way.
+
+        * llint/LLIntData.cpp:
+        (JSC::LLInt::Data::performAssertions): Reverted some pieces of
+        &lt;http://trac.webkit.org/changeset/160745&gt;, as above.
+
+        * llint/LLIntEntrypoint.cpp:
+        * llint/LLIntEntrypoint.h:
+        (JSC::LLInt::stackPointerOffsetFor): Helper function, as above.
+
+        * llint/LowLevelInterpreter.asm: Reverted some pieces of
+        &lt;http://trac.webkit.org/changeset/160745&gt;, as above.
+
</ins><span class="cx"> 2013-12-19  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CStack Branch: Remove &quot;AndAlloc&quot; from sizeAndAllocFrameForVarargs and friends
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreassemblerMaxFrameExtentForSlowPathCallh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -35,43 +35,36 @@
</span><span class="cx"> // that can be used for outgoing args when calling a slow path C function
</span><span class="cx"> // from JS code.
</span><span class="cx"> 
</span><del>-// We also need to add space to account for CallerFrameAndPCSize (2 pointers)
-// and pad the sum up to a multiple of stackAlignmentBytes().
-
</del><span class="cx"> #if ENABLE(LLINT_C_LOOP)
</span><span class="cx"> static const size_t maxFrameExtentForSlowPathCall = 0;
</span><span class="cx"> 
</span><span class="cx"> #elif CPU(X86_64) &amp;&amp; OS(WINDOWS)
</span><del>-// 4 args in registers, but stack space needs to be allocated for all args,
-// plus 16 bytes for CallerFrameAndPCSize.
-static const size_t maxFrameExtentForSlowPathCall = 64;
</del><ins>+// 4 args in registers, but stack space needs to be allocated for all args.
+static const size_t maxFrameExtentForSlowPathCall = 48;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(X86_64)
</span><del>-// All args in registers, plus 16 bytes for CallerFrameAndPCSize.
-static const size_t maxFrameExtentForSlowPathCall = 16;
</del><ins>+// All args in registers.
+static const size_t maxFrameExtentForSlowPathCall = 0;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(X86)
</span><del>-// 6 args on stack (24 bytes) plus 8 bytes for CallerFrameAndPCSize.
</del><ins>+// 6 args on stack (24 bytes) + 8 bytes to align the stack.
</ins><span class="cx"> static const size_t maxFrameExtentForSlowPathCall = 32;
</span><span class="cx"> 
</span><span class="cx"> #elif CPU(ARM64)
</span><del>-// All args in registers, plus 16 bytes for CallerFrameAndPCSize.
-static const size_t maxFrameExtentForSlowPathCall = 16;
</del><ins>+// All args in registers.
+static const size_t maxFrameExtentForSlowPathCall = 0;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(ARM)
</span><del>-// First four args in registers, remaining 4 args on stack,
-// plus 8 byte for CallerFrameAndPCSize and 8 bytes padding.
-static const size_t maxFrameExtentForSlowPathCall = 32;
</del><ins>+// First four args in registers, remaining 4 args on stack.
+static const size_t maxFrameExtentForSlowPathCall = 16;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(SH4)
</span><del>-// First four args in registers, remaining 4 args on stack,
-// plus 8 byte for CallerFrameAndPCSize and 8 bytes padding.
-static const size_t maxFrameExtentForSlowPathCall = 32;
</del><ins>+// First four args in registers, remaining 4 args on stack.
+static const size_t maxFrameExtentForSlowPathCall = 16;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(MIPS)
</span><del>-// Though args are in registers, there need to be space on the stack for all args,
-// plus 8 bytes CallerFrameAndPCSize and 8 bytes padding.
-static const size_t maxFrameExtentForSlowPathCall = 48;
</del><ins>+// Though args are in registers, there need to be space on the stack for all args.
+static const size_t maxFrameExtentForSlowPathCall = 32;
</ins><span class="cx"> 
</span><span class="cx"> #else
</span><span class="cx"> #error &quot;Unsupported CPU: need value for maxFrameExtentForSlowPathCall&quot;
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -3382,6 +3382,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int CodeBlock::stackPointerOffset()
+{
+    return virtualRegisterForLocal(frameRegisterCount() - 1).offset();
+}
+
</ins><span class="cx"> size_t CodeBlock::predictedMachineCodeSize()
</span><span class="cx"> {
</span><span class="cx">     // This will be called from CodeBlock::CodeBlock before either m_vm or the
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorebytecodeCodeBlockh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/bytecode/CodeBlock.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -901,6 +901,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     
</span><span class="cx">     unsigned frameRegisterCount();
</span><ins>+    int stackPointerOffset();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Make these remaining members private.
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -802,8 +802,9 @@
</span><span class="cx">         
</span><span class="cx">         addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand)));
</span><span class="cx">         int argCount = currentInstruction[3].u.operand;
</span><del>-        if (JSStack::ThisArgument + (unsigned)argCount &gt; m_parameterSlots)
-            m_parameterSlots = JSStack::ThisArgument + argCount;
</del><ins>+        size_t parameterSlots = JSStack::CallFrameHeaderSize - JSStack::CallerFrameAndPCSize + argCount;
+        if (parameterSlots &gt; m_parameterSlots)
+            m_parameterSlots = parameterSlots;
</ins><span class="cx"> 
</span><span class="cx">         int registerOffset = -currentInstruction[4].u.operand;
</span><span class="cx">         int dummyThisArgument = op == Call ? 0 : 1;
</span><span class="lines">@@ -1016,9 +1017,10 @@
</span><span class="cx">     // The number of locals (vars + temporaries) used in the function.
</span><span class="cx">     unsigned m_numLocals;
</span><span class="cx">     // The number of slots (in units of sizeof(Register)) that we need to
</span><del>-    // preallocate for calls emanating from this frame. This includes the
-    // size of the CallFrame, only if this is not a leaf function.  (I.e.
-    // this is 0 if and only if this function is a leaf.)
</del><ins>+    // preallocate for arguments to outgoing calls from this frame. This
+    // number includes the CallFrame slots that we initialize for the callee
+    // (but not the callee-initialized CallerFrame and ReturnPC slots).
+    // This number is 0 if and only if this function is a leaf.
</ins><span class="cx">     unsigned m_parameterSlots;
</span><span class="cx">     // The number of var args passed to the next var arg node.
</span><span class="cx">     unsigned m_numPassedVarArgs;
</span><span class="lines">@@ -2996,10 +2998,11 @@
</span><span class="cx">             SpeculatedType prediction = getPrediction();
</span><span class="cx">             
</span><span class="cx">             addToGraph(CheckArgumentsNotCreated);
</span><del>-            
</del><ins>+
</ins><span class="cx">             unsigned argCount = inlineCallFrame()-&gt;arguments.size();
</span><del>-            if (JSStack::ThisArgument + argCount &gt; m_parameterSlots)
-                m_parameterSlots = JSStack::ThisArgument + argCount;
</del><ins>+            size_t parameterSlots = JSStack::CallFrameHeaderSize - JSStack::CallerFrameAndPCSize + argCount;
+            if (parameterSlots &gt; m_parameterSlots)
+                m_parameterSlots = parameterSlots;
</ins><span class="cx">             
</span><span class="cx">             addVarArgChild(get(VirtualRegister(currentInstruction[2].u.operand))); // callee
</span><span class="cx">             addVarArgChild(get(VirtualRegister(currentInstruction[3].u.operand))); // this
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGGraphcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -710,6 +710,11 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned Graph::stackPointerOffset()
+{
+    return virtualRegisterForLocal(frameRegisterCount() - 1).offset();
+}
+
</ins><span class="cx"> unsigned Graph::requiredRegisterCountForExit()
</span><span class="cx"> {
</span><span class="cx">     unsigned count = JIT::frameRegisterCountFor(m_profiledBlock);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGGraphh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -788,6 +788,7 @@
</span><span class="cx">     bool isLiveInBytecode(VirtualRegister, CodeOrigin);
</span><span class="cx">     
</span><span class="cx">     unsigned frameRegisterCount();
</span><ins>+    unsigned stackPointerOffset();
</ins><span class="cx">     unsigned requiredRegisterCountForExit();
</span><span class="cx">     unsigned requiredRegisterCountForExecutionAndExit();
</span><span class="cx">     
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGJITCompilercpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">     compileEntry();
</span><span class="cx">     m_speculative = adoptPtr(new SpeculativeJIT(*this));
</span><span class="cx">     checkStackPointerAlignment();
</span><del>-    addPtr(TrustedImm32(-(m_graph.frameRegisterCount() - JSStack::CallerFrameAndPCSize) * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
</ins><span class="cx">     checkStackPointerAlignment();
</span><span class="cx">     compileBody();
</span><span class="cx">     setEndOfMainPath();
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">     checkStackPointerAlignment();
</span><span class="cx"> 
</span><span class="cx">     // Move the stack pointer down to accommodate locals
</span><del>-    addPtr(TrustedImm32(-(m_graph.frameRegisterCount() - JSStack::CallerFrameAndPCSize) * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister);
</ins><span class="cx">     checkStackPointerAlignment();
</span><span class="cx"> 
</span><span class="cx">     // === Function body code generation ===
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGOSRExitCompilerCommoncpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">     
</span><span class="cx">     void* jumpTarget = baselineCodeBlock-&gt;jitCode()-&gt;executableAddressAtOffset(mapping-&gt;m_machineCodeOffset);
</span><span class="cx"> 
</span><del>-    jit.addPtr(AssemblyHelpers::TrustedImm32(-JIT::frameRegisterCountFor(baselineCodeBlock) * sizeof(Register)), GPRInfo::callFrameRegister, AssemblyHelpers::stackPointerRegister);
</del><ins>+    jit.addPtr(AssemblyHelpers::TrustedImm32(JIT::stackPointerOffsetFor(baselineCodeBlock) * sizeof(Register)), GPRInfo::callFrameRegister, AssemblyHelpers::stackPointerRegister);
</ins><span class="cx"> 
</span><span class="cx">     jit.move(AssemblyHelpers::TrustedImmPtr(jumpTarget), GPRInfo::regT2);
</span><span class="cx">     jit.jump(GPRInfo::regT2);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -2449,7 +2449,7 @@
</span><span class="cx">         
</span><span class="cx">         LValue calleeFrame = m_out.add(
</span><span class="cx">             m_callFrame,
</span><del>-            m_out.constIntPtr(sizeof(Register) * virtualRegisterForLocal(m_graph.frameRegisterCount()).offset()));
</del><ins>+            m_out.constIntPtr(m_graph.stackPointerOffset() * sizeof(Register));
</ins><span class="cx">         
</span><span class="cx">         m_out.store32(
</span><span class="cx">             m_out.constInt32(numPassedArgs + dummyThisArgument),
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreinterpreterCallFramecpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/interpreter/CallFrame.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/interpreter/CallFrame.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/interpreter/CallFrame.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx"> {
</span><span class="cx">     CodeBlock* codeBlock = this-&gt;codeBlock();
</span><span class="cx">     ASSERT(codeBlock);
</span><del>-    return registers() + virtualRegisterForLocal(codeBlock-&gt;frameRegisterCount() - 1).offset();
</del><ins>+    return registers() + codeBlock-&gt;stackPointerOffset();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSGlobalObject* CallFrame::vmEntryGlobalObject()
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreinterpreterJSStackh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/interpreter/JSStack.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> 
</span><span class="cx">         size_t size() const { return highAddress() - lowAddress(); }
</span><span class="cx"> 
</span><del>-        bool grow(Register*);
</del><ins>+        bool grow(Register* topOfStack);
</ins><span class="cx">         
</span><span class="cx">         static size_t committedByteCount();
</span><span class="cx">         static void initializeThreading();
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreinterpreterJSStackInlinesh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/interpreter/JSStackInlines.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -69,12 +69,12 @@
</span><span class="cx">     newCallFrameSlot -= JSStack::FenceSize;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Register* newEnd = newCallFrameSlot;
</del><ins>+    Register* topOfStack = newCallFrameSlot;
</ins><span class="cx">     if (!!codeBlock)
</span><del>-        newEnd += virtualRegisterForLocal(codeBlock-&gt;frameRegisterCount()).offset();
</del><ins>+        topOfStack += codeBlock-&gt;stackPointerOffset();
</ins><span class="cx"> 
</span><span class="cx">     // Ensure that we have the needed stack capacity to push the new frame:
</span><del>-    if (!grow(newEnd))
</del><ins>+    if (!grow(topOfStack))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -99,12 +99,12 @@
</span><span class="cx">     newCallFrameSlot -= JSStack::FenceSize;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Register* newEnd = newCallFrameSlot;
</del><ins>+    Register* topOfStack = newCallFrameSlot;
</ins><span class="cx">     if (!!codeBlock)
</span><del>-        newEnd += virtualRegisterForLocal(codeBlock-&gt;frameRegisterCount()).offset();
</del><ins>+        topOfStack += codeBlock-&gt;stackPointerOffset();
</ins><span class="cx"> 
</span><span class="cx">     // Ensure that we have the needed stack capacity to push the new frame:
</span><del>-    if (!grow(newEnd))
</del><ins>+    if (!grow(topOfStack))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     // Compute the address of the new VM sentinel frame for this invocation:
</span><span class="lines">@@ -173,8 +173,9 @@
</span><span class="cx">         releaseExcessCapacity();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline bool JSStack::grow(Register* newEnd)
</del><ins>+inline bool JSStack::grow(Register* topOfStack)
</ins><span class="cx"> {
</span><ins>+    Register* newEnd = topOfStack - 1;
</ins><span class="cx">     if (newEnd &gt;= m_end)
</span><span class="cx">         return true;
</span><span class="cx">     return growSlowCase(newEnd);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -541,14 +541,14 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock) - 1).offsetInBytes()), callFrameRegister, regT1);
</del><ins>+        addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, regT1);
</ins><span class="cx">         stackCheck = branchPtr(Above, AbsoluteAddress(m_vm-&gt;addressOfJSStackLimit()), regT1);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Label functionBody = label();
</span><span class="cx"> 
</span><span class="cx">     checkStackPointerAlignment();
</span><del>-    addPtr(TrustedImm32(-frameRegisterCountFor(m_codeBlock) * sizeof(Register) - maxFrameExtentForSlowPathCall), callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</ins><span class="cx">     checkStackPointerAlignment();
</span><span class="cx"> 
</span><span class="cx">     privateCompileMainPass();
</span><span class="lines">@@ -788,6 +788,11 @@
</span><span class="cx">     return registerCount;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+int JIT::stackPointerOffsetFor(CodeBlock* codeBlock)
+{
+    return virtualRegisterForLocal(frameRegisterCountFor(codeBlock) - 1).offset();
+}
+
</ins><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(JIT)
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JIT.h (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -245,6 +245,7 @@
</span><span class="cx">         static void linkSlowCall(CodeBlock* callerCodeBlock, CallLinkInfo*);
</span><span class="cx">         
</span><span class="cx">         static unsigned frameRegisterCountFor(CodeBlock*);
</span><ins>+        static int stackPointerOffsetFor(CodeBlock*);
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         JIT(VM*, CodeBlock* = 0);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITCallcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -208,7 +208,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall();
</span><span class="cx"> 
</span><del>-    addPtr(TrustedImm32(-frameRegisterCountFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</ins><span class="cx">     checkStackPointerAlignment();
</span><span class="cx"> 
</span><span class="cx">     sampleCodeBlock(m_codeBlock);
</span><span class="lines">@@ -229,7 +229,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_callStructureStubCompilationInfo[callLinkInfoIndex].callReturnLocation = emitNakedCall(opcodeID == op_construct ? m_vm-&gt;getCTIStub(linkConstructThunkGenerator).code() : m_vm-&gt;getCTIStub(linkCallThunkGenerator).code());
</span><span class="cx"> 
</span><del>-    addPtr(TrustedImm32(-frameRegisterCountFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</ins><span class="cx">     checkStackPointerAlignment();
</span><span class="cx"> 
</span><span class="cx">     sampleCodeBlock(m_codeBlock);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -637,8 +637,7 @@
</span><span class="cx">     move(TrustedImmPtr(m_vm), regT3);
</span><span class="cx">     load64(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister);
</span><span class="cx"> 
</span><del>-    int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes();
-    addPtr(TrustedImm32(offset), callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(stackPointerOffsetFor(codeBlock()) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</ins><span class="cx"> 
</span><span class="cx">     load64(Address(regT3, VM::exceptionOffset()), regT0);
</span><span class="cx">     store64(TrustedImm64(JSValue::encode(JSValue())), Address(regT3, VM::exceptionOffset()));
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -924,8 +924,7 @@
</span><span class="cx">     // operationThrow returns the callFrame for the handler.
</span><span class="cx">     load32(Address(regT3, VM::callFrameForThrowOffset()), callFrameRegister);
</span><span class="cx"> 
</span><del>-    int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes();
-    addPtr(TrustedImm32(offset), callFrameRegister, stackPointerRegister);
</del><ins>+    addPtr(TrustedImm32(stackPointerOffsetFor(codeBlock()) * sizeof(Register)), callFrameRegister, stackPointerRegister);
</ins><span class="cx"> 
</span><span class="cx">     // Now store the exception returned by operationThrow.
</span><span class="cx">     load32(Address(regT3, VM::exceptionOffset() + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSStack&amp; stack = vm-&gt;interpreter-&gt;stack();
</span><span class="cx"> 
</span><del>-    if (UNLIKELY(!stack.grow(&amp;exec-&gt;registers()[virtualRegisterForLocal(codeBlock-&gt;frameRegisterCount()).offset()])))
</del><ins>+    if (UNLIKELY(!stack.grow(&amp;exec-&gt;registers()[codeBlock-&gt;stackPointerOffset()])))
</ins><span class="cx">         vm-&gt;throwException(callerFrame, createStackOverflowError(callerFrame));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLLIntDatacpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -125,16 +125,12 @@
</span><span class="cx">     ASSERT(ValueUndefined == (TagBitTypeOther | TagBitUndefined));
</span><span class="cx">     ASSERT(ValueNull == TagBitTypeOther);
</span><span class="cx"> #endif
</span><del>-#if ENABLE(LLINT_C_LOOP)
</del><ins>+#if CPU(X86_64) || CPU(ARM64) || ENABLE(LLINT_C_LOOP)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 0);
</span><del>-#elif CPU(X86_64) &amp;&amp; OS(WINDOWS)
-    ASSERT(maxFrameExtentForSlowPathCall == 64);
-#elif CPU(X86_64) || CPU(ARM64)
</del><ins>+#elif CPU(ARM) || CPU(SH4)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 16);
</span><del>-#elif CPU(X86) || CPU(ARM) || CPU(SH4)
</del><ins>+#elif CPU(X86) || CPU(MIPS)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 32);
</span><del>-#elif CPU(MIPS)
-    ASSERT(maxFrameExtentForSlowPathCall == 48);
</del><span class="cx"> #endif
</span><span class="cx">     ASSERT(StringType == 5);
</span><span class="cx">     ASSERT(ObjectType == 17);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (160834 => 160835)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-19 17:11:35 UTC (rev 160834)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-19 17:22:19 UTC (rev 160835)
</span><span class="lines">@@ -73,14 +73,12 @@
</span><span class="cx"> const LowestTag = DeletedValueTag
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-if C_LOOP
</del><ins>+if X86_64 or ARM64 or C_LOOP
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 0
</span><del>-elsif X86_64 or ARM64
</del><ins>+elsif ARM or ARMv7_TRADITIONAL or ARMv7 or SH4
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 16
</span><del>-elsif X86 or ARM or ARMv7_TRADITIONAL or ARMv7 or SH4
</del><ins>+elsif X86 or MIPS
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 32
</span><del>-elsif MIPS
-const maxFrameExtentForSlowPathCall = 48
</del><span class="cx"> end
</span><span class="cx"> 
</span><span class="cx"> # Watchpoint states
</span></span></pre>
</div>
</div>

</body>
</html>