<!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>[160745] 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/160745">160745</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2013-12-17 19:38:14 -0800 (Tue, 17 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>frameRegisterCount() should include maxFrameExtentForSlowPathCall.
https://bugs.webkit.org/show_bug.cgi?id=125881.

Reviewed by Geoffrey Garen, Michael Saboff, and Filip Pizlo.

* assembler/MaxFrameExtentForSlowPathCall.h:
- Added CallerFrameAndPCSize to all the maxFrameExtentForSlowPathCall values.
* bytecode/VirtualRegister.h:
(JSC::VirtualRegister::offsetInBytes):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::frameRegisterCount):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
(JSC::JIT::frameRegisterCountFor):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_catch):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_catch):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
- Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize.
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::frameRegisterCountFor):
* llint/LowLevelInterpreter.asm:
- Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize.</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="#branchesjsCStackSourceJavaScriptCorebytecodeVirtualRegisterh">branches/jsCStack/Source/JavaScriptCore/bytecode/VirtualRegister.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoredfgDFGGraphcpp">branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp</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="#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="#branchesjsCStackSourceJavaScriptCorellintLLIntDatacpp">branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLLIntEntrypointcpp">branches/jsCStack/Source/JavaScriptCore/llint/LLIntEntrypoint.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 (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2013-12-17  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        frameRegisterCount() should include maxFrameExtentForSlowPathCall.
+        https://bugs.webkit.org/show_bug.cgi?id=125881.
+
+        Reviewed by Geoffrey Garen, Michael Saboff, and Filip Pizlo.
+
+        * assembler/MaxFrameExtentForSlowPathCall.h:
+        - Added CallerFrameAndPCSize to all the maxFrameExtentForSlowPathCall values.
+        * bytecode/VirtualRegister.h:
+        (JSC::VirtualRegister::offsetInBytes):
+        * dfg/DFGGraph.cpp:
+        (JSC::DFG::Graph::frameRegisterCount):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompile):
+        (JSC::JIT::frameRegisterCountFor):
+        * jit/JIT.h:
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_catch):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_catch):
+        * llint/LLIntData.cpp:
+        (JSC::LLInt::Data::performAssertions):
+        - Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize.
+        * llint/LLIntEntrypoint.cpp:
+        (JSC::LLInt::frameRegisterCountFor):
+        * llint/LowLevelInterpreter.asm:
+        - Adjusted maxFrameExtentForSlowPathCall values for CallerFrameAndPCSize.
+
+2013-12-17  Mark Lam  &lt;mark.lam@apple.com&gt;
+
</ins><span class="cx">         Introduce a maxFrameExtentForSlowPathCallInRegisters value.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=125877.
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreassemblerMaxFrameExtentForSlowPathCallh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -35,36 +35,43 @@
</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><ins>+// We also need to add space to account for CallerFrameAndPCSize (2 pointers)
+// and pad the sum up to a multiple of stackAlignmentBytes().
+
</ins><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.
-static const size_t maxFrameExtentForSlowPathCall = 48;
</del><ins>+// 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;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(X86_64)
</span><del>-// All args in registers.
-static const size_t maxFrameExtentForSlowPathCall = 0;
</del><ins>+// All args in registers, plus 16 bytes for CallerFrameAndPCSize.
+static const size_t maxFrameExtentForSlowPathCall = 16;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(X86)
</span><del>-// 6 args on stack (24 bytes) + 8 bytes to align the stack.
</del><ins>+// 6 args on stack (24 bytes) plus 8 bytes for CallerFrameAndPCSize.
</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.
-static const size_t maxFrameExtentForSlowPathCall = 0;
</del><ins>+// All args in registers, plus 16 bytes for CallerFrameAndPCSize.
+static const size_t maxFrameExtentForSlowPathCall = 16;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(ARM)
</span><del>-// First four args in registers, remaining 4 args on stack.
-static const size_t maxFrameExtentForSlowPathCall = 16;
</del><ins>+// 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;
</ins><span class="cx"> 
</span><span class="cx"> #elif CPU(SH4)
</span><del>-// First four args in registers, remaining 4 args on stack.
-static const size_t maxFrameExtentForSlowPathCall = 16;
</del><ins>+// 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;
</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.
-static const size_t maxFrameExtentForSlowPathCall = 32;
</del><ins>+// 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;
</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="branchesjsCStackSourceJavaScriptCorebytecodeVirtualRegisterh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/bytecode/VirtualRegister.h (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/bytecode/VirtualRegister.h        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/bytecode/VirtualRegister.h        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">     int toArgument() const { ASSERT(isArgument()); return operandToArgument(m_virtualRegister); }
</span><span class="cx">     int toConstantIndex() const { ASSERT(isConstant()); return m_virtualRegister - s_firstConstantRegisterIndex; }
</span><span class="cx">     int offset() const { return m_virtualRegister; }
</span><ins>+    int offsetInBytes() const { return m_virtualRegister * sizeof(Register); }
</ins><span class="cx"> 
</span><span class="cx">     bool operator==(const VirtualRegister other) const { return m_virtualRegister == other.m_virtualRegister; }
</span><span class="cx">     bool operator!=(const VirtualRegister other) const { return m_virtualRegister != other.m_virtualRegister; }
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoredfgDFGGraphcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/dfg/DFGGraph.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;FunctionExecutableDump.h&quot;
</span><span class="cx"> #include &quot;JIT.h&quot;
</span><span class="cx"> #include &quot;JSActivation.h&quot;
</span><ins>+#include &quot;MaxFrameExtentForSlowPathCall.h&quot;
</ins><span class="cx"> #include &quot;OperandsInlines.h&quot;
</span><span class="cx"> #include &quot;Operations.h&quot;
</span><span class="cx"> #include &quot;StackAlignment.h&quot;
</span><span class="lines">@@ -704,7 +705,7 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned Graph::frameRegisterCount()
</span><span class="cx"> {
</span><del>-    unsigned result = m_nextMachineLocal + std::max(m_parameterSlots, static_cast&lt;unsigned&gt;(JSStack::CallerFrameAndPCSize));
</del><ins>+    unsigned result = m_nextMachineLocal + std::max(m_parameterSlots, static_cast&lt;unsigned&gt;(maxFrameExtentForSlowPathCallInRegisters));
</ins><span class="cx">     result = WTF::roundUpToMultipleOf(stackAlignmentRegisters(), result);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JIT.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include &quot;ResultType.h&quot;
</span><span class="cx"> #include &quot;SamplingTool.h&quot;
</span><span class="cx"> #include &quot;SlowPathCall.h&quot;
</span><ins>+#include &quot;StackAlignment.h&quot;
</ins><span class="cx"> #include &lt;wtf/CryptographicallyRandomNumber.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace std;
</span><span class="lines">@@ -539,7 +540,7 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock) - 1).offset() * sizeof(Register) - maxFrameExtentForSlowPathCall), callFrameRegister, regT1);
</del><ins>+        addPtr(TrustedImm32(virtualRegisterForLocal(frameRegisterCountFor(m_codeBlock) - 1).offsetInBytes()), 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="lines">@@ -779,6 +780,12 @@
</span><span class="cx">     jumpToExceptionHandler();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned JIT::frameRegisterCountFor(CodeBlock* codeBlock)
+{
+    size_t registerCount = codeBlock-&gt;m_numCalleeRegisters + maxFrameExtentForSlowPathCallInRegisters;
+    ASSERT(registerCount == WTF::roundUpToMultipleOf(stackAlignmentRegisters(), registerCount));
+    return registerCount;
+}
</ins><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JIT.h (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -244,11 +244,7 @@
</span><span class="cx">         static void linkFor(ExecState*, JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, CodePtr, CallLinkInfo*, VM*, CodeSpecializationKind);
</span><span class="cx">         static void linkSlowCall(CodeBlock* callerCodeBlock, CallLinkInfo*);
</span><span class="cx">         
</span><del>-        static unsigned frameRegisterCountFor(CodeBlock* codeBlock)
-        {
-            ASSERT(!(codeBlock-&gt;m_numCalleeRegisters &amp; 1));
-            return codeBlock-&gt;m_numCalleeRegisters;
-        }
</del><ins>+        static unsigned frameRegisterCountFor(CodeBlock*);
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         JIT(VM*, CodeBlock* = 0);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -637,9 +637,8 @@
</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>-    size_t frameExtent = JIT::frameRegisterCountFor(codeBlock()) * sizeof(Register) + maxFrameExtentForSlowPathCall;
-    ASSERT(frameExtent == WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameExtent));
-    addPtr(TrustedImm32(-frameExtent), callFrameRegister, stackPointerRegister);
</del><ins>+    int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes();
+    addPtr(TrustedImm32(offset), 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 (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -924,9 +924,8 @@
</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>-    size_t frameExtent = JIT::frameRegisterCountFor(codeBlock()) * sizeof(Register) + maxFrameExtentForSlowPathCall;
-    ASSERT(frameExtent == WTF::roundUpToMultipleOf(stackAlignmentBytes(), frameExtent));
-    addPtr(TrustedImm32(-frameExtent), callFrameRegister, stackPointerRegister);
</del><ins>+    int offset = virtualRegisterForLocal(frameRegisterCountFor(codeBlock()) - 1).offsetInBytes();
+    addPtr(TrustedImm32(offset), 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="branchesjsCStackSourceJavaScriptCorellintLLIntDatacpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LLIntData.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -125,12 +125,16 @@
</span><span class="cx">     ASSERT(ValueUndefined == (TagBitTypeOther | TagBitUndefined));
</span><span class="cx">     ASSERT(ValueNull == TagBitTypeOther);
</span><span class="cx"> #endif
</span><del>-#if CPU(X86_64) || CPU(ARM64) || ENABLE(LLINT_C_LOOP)
</del><ins>+#if ENABLE(LLINT_C_LOOP)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 0);
</span><del>-#elif CPU(ARM) || CPU(SH4)
</del><ins>+#elif CPU(X86_64) &amp;&amp; OS(WINDOWS)
+    ASSERT(maxFrameExtentForSlowPathCall == 64);
+#elif CPU(X86_64) || CPU(ARM64)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 16);
</span><del>-#elif CPU(X86) || CPU(MIPS)
</del><ins>+#elif CPU(X86) || CPU(ARM) || CPU(SH4)
</ins><span class="cx">     ASSERT(maxFrameExtentForSlowPathCall == 32);
</span><ins>+#elif CPU(MIPS)
+    ASSERT(maxFrameExtentForSlowPathCall == 48);
</ins><span class="cx"> #endif
</span><span class="cx">     ASSERT(StringType == 5);
</span><span class="cx">     ASSERT(ObjectType == 17);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLLIntEntrypointcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LLIntEntrypoint.cpp        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> #include &quot;JSObject.h&quot;
</span><span class="cx"> #include &quot;LLIntThunks.h&quot;
</span><span class="cx"> #include &quot;LowLevelInterpreter.h&quot;
</span><ins>+#include &quot;MaxFrameExtentForSlowPathCall.h&quot;
+#include &quot;StackAlignment.h&quot;
</ins><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace LLInt {
</span><span class="lines">@@ -123,7 +125,9 @@
</span><span class="cx"> 
</span><span class="cx"> unsigned frameRegisterCountFor(CodeBlock* codeBlock)
</span><span class="cx"> {
</span><del>-    return codeBlock-&gt;m_numCalleeRegisters;
</del><ins>+    size_t registerCount = codeBlock-&gt;m_numCalleeRegisters + maxFrameExtentForSlowPathCallInRegisters;
+    ASSERT(registerCount == WTF::roundUpToMultipleOf(stackAlignmentRegisters(), registerCount));
+    return registerCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::LLInt
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (160744 => 160745)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-18 03:25:51 UTC (rev 160744)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-18 03:38:14 UTC (rev 160745)
</span><span class="lines">@@ -73,12 +73,14 @@
</span><span class="cx"> const LowestTag = DeletedValueTag
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-if X86_64 or ARM64 or C_LOOP
</del><ins>+if C_LOOP
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 0
</span><del>-elsif ARM or ARMv7_TRADITIONAL or ARMv7 or SH4
</del><ins>+elsif X86_64 or ARM64
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 16
</span><del>-elsif X86 or MIPS
</del><ins>+elsif X86 or ARM or ARMv7_TRADITIONAL or ARMv7 or SH4
</ins><span class="cx"> const maxFrameExtentForSlowPathCall = 32
</span><ins>+elsif MIPS
+const maxFrameExtentForSlowPathCall = 48
</ins><span class="cx"> end
</span><span class="cx"> 
</span><span class="cx"> # Watchpoint states
</span></span></pre>
</div>
</div>

</body>
</html>