<!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>[172665] 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/172665">172665</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2014-08-15 18:45:40 -0700 (Fri, 15 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change callToJavaScript and callToNativeFunction so their callFrames match the native calling conventions
https://bugs.webkit.org/show_bug.cgi?id=131578

Reviewed by Geoffrey Garen.

Renamed callToJavaScript and callToNativeFunction to vmEntryToJavaScript and vmEntryToNative,
respectively.  Eliminated the sentinel frame and replaced it with the structure VMEntryRecord
that appears in the &quot;locals&quot; area of a VM entry stack frame.  Changed the order that
vmEntryToJavaScript and vmEntryToNative creates their stack frames to be native calling
convention compliant.  That is to save prior frame pointer, save callee save registers, then
allocate and populate the VMEntryRecord, and finally allocate a CallFrame for the JS function
that vmEntryToJavaScript will invoke.  The top most vm entry frame pointer is saved in
VM::topVMEntryFrame.  The vmEntry functions save prior contents of VM::topVMEntryFrame
along with the VM and VM::topCallFrame in the VMEntryRecord it places on the stack.  Starting
at VM::topCallFrame, the stack can be walked using these VMEntryRecords.

Arbitrary stack unwinding is now handled either iteratively by loading VM::topVMEntryFrame
into a local variable and using CallFrame::callerFrame(VMEntryFrame*&amp;) or by using StackVisitor.
Given that the stack is effectively a singly linked list, general stack unwinding needs to use
one of these two methods.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
Addition of VMEntryRecord.h

* bytecode/BytecodeList.json:
Renaming of llint helper opcodes due to renaming callToJavaScript and callToNativeFunction.

* debugger/Debugger.cpp:
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::didExecuteProgram):
* jsc.cpp:
(functionDumpCallFrame):
* jit/JITOperations.cpp:
Changed unwinding to use CallFrame::callerFrame(VMEntryFrame*&amp;).

* bytecode/CodeBlock.cpp:
(JSC::RecursionCheckFunctor::RecursionCheckFunctor):
(JSC::RecursionCheckFunctor::operator()):
(JSC::RecursionCheckFunctor::didRecurse):
(JSC::CodeBlock::noticeIncomingCall):
* debugger/DebuggerCallFrame.cpp:
(JSC::FindCallerMidStackFunctor::FindCallerMidStackFunctor):
(JSC::FindCallerMidStackFunctor::operator()):
(JSC::FindCallerMidStackFunctor::getCallerFrame):
(JSC::DebuggerCallFrame::callerFrame):
* interpreter/VMInspector.cpp:
(JSC::CountFramesFunctor::CountFramesFunctor):
(JSC::CountFramesFunctor::operator()):
(JSC::CountFramesFunctor::count):
(JSC::VMInspector::countFrames):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::foundCallFrame):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::index):
(JSC::VM::throwException):
Changed unwinding to use StackVisitor including added functor classes.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::callerFrame):
Added new flavor of callerFrame() that can iteratively unwind the stack.

* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame): Changed callerFrame() to use private common helper.
(JSC::ExecState::callerFrameOrVMEntryFrame): Deleted.
(JSC::ExecState::isVMEntrySentinel): Deleted.
(JSC::ExecState::vmEntrySentinelCallerFrame): Deleted.
(JSC::ExecState::initializeVMEntrySentinelFrame): Deleted.
(JSC::ExecState::callerFrameSkippingVMEntrySentinel): Deleted.
(JSC::ExecState::vmEntrySentinelCodeBlock): Deleted.

* interpreter/CallFrame.h:
(JSC::ExecState::init):
(JSC::ExecState::topOfFrame):
(JSC::ExecState::currentVPC):
(JSC::ExecState::setCurrentVPC):
Eliminated unneded checking of sentinel frame.

* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::Interpreter::getStackTrace): Updated for unwidning changes.
(JSC::Interpreter::unwind): Eliminated unneeded sentinel frame check.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JITStubs.h:
* llint/LLIntThunks.cpp:
(JSC::callToJavaScript): Deleted.
(JSC::callToNativetion): Deleted.
(JSC::vmEntryToJavaScript):
(JSC::vmEntryToNative):
* llint/LLIntThunks.h:
Updated for vmEntryToJavaScript and vmEntryToNative name changes.

* interpreter/Interpreter.h:
(JSC::TopCallFrameSetter::TopCallFrameSetter):
(JSC::TopCallFrameSetter::~TopCallFrameSetter):
Eliminated unneeded sentinel frame check.

* interpreter/Interpreter.h:
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
Removed sentinel specific constructor.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::readFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::readInlinedFrame):
(JSC::StackVisitor::Frame::print):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callerIsVMEntry):
Changes for unwinding using CallFrame::callerFrame(VMEntryFrame*&amp;).  Also added field that
indicates when about to step over a VM entry frame.

* interpreter/VMEntryRecord.h: Added.
(JSC::VMEntryRecord::prevTopCallFrame):
(JSC::VMEntryRecord::prevTopVMEntryFrame):
New struct to record prior state of VM's notion of VM entry and top call frames.

* jit/JITCode.cpp:
(JSC::JITCode::execute):
Use new vmEntryToJavaScript and vmEntryToNative name.

* llint/LLIntOffsetsExtractor.cpp: Added include for VMEntryRecord.h.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
Offline assembly implementation of creating stack frame with VMEntryRecord and well as restoring 
relevent VM fields when exiting the VM.  Added a helper that returns a VMEntryRecord given
a pointer to the VM entry frame.

* llint/LLIntThunks.cpp:
(JSC::vmEntryRecord):
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
C Loop changes to mirror the assembly changes.

* runtime/VM.h:
Added topVMEntryFrame field.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</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="#trunkSourceJavaScriptCoreinterpreterStackVisitorh">trunk/Source/JavaScriptCore/interpreter/StackVisitor.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterVMInspectorcpp">trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITCodecpp">trunk/Source/JavaScriptCore/jit/JITCode.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubsh">trunk/Source/JavaScriptCore/jit/JITStubs.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp">trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntThunkscpp">trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntThunksh">trunk/Source/JavaScriptCore/llint/LLIntThunks.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpretercpp">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreter64asm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreinterpreterVMEntryRecordh">trunk/Source/JavaScriptCore/interpreter/VMEntryRecord.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -1,3 +1,151 @@
</span><ins>+2014-08-15  Michael Saboff  &lt;msaboff@apple.com&gt;
+
+        Change callToJavaScript and callToNativeFunction so their callFrames match the native calling conventions
+        https://bugs.webkit.org/show_bug.cgi?id=131578
+
+        Reviewed by Geoffrey Garen.
+
+        Renamed callToJavaScript and callToNativeFunction to vmEntryToJavaScript and vmEntryToNative,
+        respectively.  Eliminated the sentinel frame and replaced it with the structure VMEntryRecord
+        that appears in the &quot;locals&quot; area of a VM entry stack frame.  Changed the order that
+        vmEntryToJavaScript and vmEntryToNative creates their stack frames to be native calling
+        convention compliant.  That is to save prior frame pointer, save callee save registers, then
+        allocate and populate the VMEntryRecord, and finally allocate a CallFrame for the JS function
+        that vmEntryToJavaScript will invoke.  The top most vm entry frame pointer is saved in
+        VM::topVMEntryFrame.  The vmEntry functions save prior contents of VM::topVMEntryFrame
+        along with the VM and VM::topCallFrame in the VMEntryRecord it places on the stack.  Starting
+        at VM::topCallFrame, the stack can be walked using these VMEntryRecords.
+
+        Arbitrary stack unwinding is now handled either iteratively by loading VM::topVMEntryFrame
+        into a local variable and using CallFrame::callerFrame(VMEntryFrame*&amp;) or by using StackVisitor.
+        Given that the stack is effectively a singly linked list, general stack unwinding needs to use
+        one of these two methods.
+
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        Addition of VMEntryRecord.h
+
+        * bytecode/BytecodeList.json:
+        Renaming of llint helper opcodes due to renaming callToJavaScript and callToNativeFunction.
+
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::stepOutOfFunction):
+        (JSC::Debugger::returnEvent):
+        (JSC::Debugger::didExecuteProgram):
+        * jsc.cpp:
+        (functionDumpCallFrame):
+        * jit/JITOperations.cpp:
+        Changed unwinding to use CallFrame::callerFrame(VMEntryFrame*&amp;).
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::RecursionCheckFunctor::RecursionCheckFunctor):
+        (JSC::RecursionCheckFunctor::operator()):
+        (JSC::RecursionCheckFunctor::didRecurse):
+        (JSC::CodeBlock::noticeIncomingCall):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::FindCallerMidStackFunctor::FindCallerMidStackFunctor):
+        (JSC::FindCallerMidStackFunctor::operator()):
+        (JSC::FindCallerMidStackFunctor::getCallerFrame):
+        (JSC::DebuggerCallFrame::callerFrame):
+        * interpreter/VMInspector.cpp:
+        (JSC::CountFramesFunctor::CountFramesFunctor):
+        (JSC::CountFramesFunctor::operator()):
+        (JSC::CountFramesFunctor::count):
+        (JSC::VMInspector::countFrames):
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor):
+        (JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()):
+        (JSC::FindFirstCallerFrameWithCodeblockFunctor::foundCallFrame):
+        (JSC::FindFirstCallerFrameWithCodeblockFunctor::index):
+        (JSC::VM::throwException):
+        Changed unwinding to use StackVisitor including added functor classes.
+
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::callerFrame):
+        Added new flavor of callerFrame() that can iteratively unwind the stack.
+
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::callerFrame): Changed callerFrame() to use private common helper.
+        (JSC::ExecState::callerFrameOrVMEntryFrame): Deleted.
+        (JSC::ExecState::isVMEntrySentinel): Deleted.
+        (JSC::ExecState::vmEntrySentinelCallerFrame): Deleted.
+        (JSC::ExecState::initializeVMEntrySentinelFrame): Deleted.
+        (JSC::ExecState::callerFrameSkippingVMEntrySentinel): Deleted.
+        (JSC::ExecState::vmEntrySentinelCodeBlock): Deleted.
+
+        * interpreter/CallFrame.h:
+        (JSC::ExecState::init):
+        (JSC::ExecState::topOfFrame):
+        (JSC::ExecState::currentVPC):
+        (JSC::ExecState::setCurrentVPC):
+        Eliminated unneded checking of sentinel frame.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::unwindCallFrame):
+        (JSC::Interpreter::getStackTrace): Updated for unwidning changes.
+        (JSC::Interpreter::unwind): Eliminated unneeded sentinel frame check.
+
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::executeCall):
+        (JSC::Interpreter::executeConstruct):
+        * jit/JITStubs.h:
+        * llint/LLIntThunks.cpp:
+        (JSC::callToJavaScript): Deleted.
+        (JSC::callToNativetion): Deleted.
+        (JSC::vmEntryToJavaScript):
+        (JSC::vmEntryToNative):
+        * llint/LLIntThunks.h:
+        Updated for vmEntryToJavaScript and vmEntryToNative name changes.
+
+        * interpreter/Interpreter.h:
+        (JSC::TopCallFrameSetter::TopCallFrameSetter):
+        (JSC::TopCallFrameSetter::~TopCallFrameSetter):
+        Eliminated unneeded sentinel frame check.
+
+        * interpreter/Interpreter.h:
+        (JSC::NativeCallFrameTracer::NativeCallFrameTracer):
+        Removed sentinel specific constructor.
+
+        * interpreter/StackVisitor.cpp:
+        (JSC::StackVisitor::StackVisitor):
+        (JSC::StackVisitor::readFrame):
+        (JSC::StackVisitor::readNonInlinedFrame):
+        (JSC::StackVisitor::readInlinedFrame):
+        (JSC::StackVisitor::Frame::print):
+        * interpreter/StackVisitor.h:
+        (JSC::StackVisitor::Frame::callerIsVMEntry):
+        Changes for unwinding using CallFrame::callerFrame(VMEntryFrame*&amp;).  Also added field that
+        indicates when about to step over a VM entry frame.
+
+        * interpreter/VMEntryRecord.h: Added.
+        (JSC::VMEntryRecord::prevTopCallFrame):
+        (JSC::VMEntryRecord::prevTopVMEntryFrame):
+        New struct to record prior state of VM's notion of VM entry and top call frames.
+
+        * jit/JITCode.cpp:
+        (JSC::JITCode::execute):
+        Use new vmEntryToJavaScript and vmEntryToNative name.
+
+        * llint/LLIntOffsetsExtractor.cpp: Added include for VMEntryRecord.h.
+
+        * llint/LowLevelInterpreter.asm:
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        Offline assembly implementation of creating stack frame with VMEntryRecord and well as restoring 
+        relevent VM fields when exiting the VM.  Added a helper that returns a VMEntryRecord given
+        a pointer to the VM entry frame.
+
+        * llint/LLIntThunks.cpp:
+        (JSC::vmEntryRecord):
+        * llint/LowLevelInterpreter.cpp:
+        (JSC::CLoop::execute):
+        C Loop changes to mirror the assembly changes.
+
+        * runtime/VM.h:
+        Added topVMEntryFrame field.
+
</ins><span class="cx"> 2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -1271,6 +1271,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\CallFrame.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\CallFrameInlines.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\CallFrameClosure.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\interpreter\VMEntryRecord.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\Interpreter.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\JSStack.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\JSStackInlines.h&quot; /&gt;
</span><span class="lines">@@ -1701,4 +1702,4 @@
</span><span class="cx">   &lt;ImportGroup Label=&quot;ExtensionTargets&quot;&gt;
</span><span class="cx">     &lt;Import Project=&quot;$(VCTargetsPath)\BuildCustomizations\masm.targets&quot; /&gt;
</span><span class="cx">   &lt;/ImportGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -2213,6 +2213,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\CallFrameClosure.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;interpreter&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\interpreter\VMEntryRecord.h&quot;&gt;
+      &lt;Filter&gt;interpreter&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\interpreter\Interpreter.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;interpreter&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><span class="lines">@@ -4227,4 +4230,4 @@
</span><span class="cx">       &lt;Filter&gt;jit&lt;/Filter&gt;
</span><span class="cx">     &lt;/MASM&gt;
</span><span class="cx">   &lt;/ItemGroup&gt;
</span><del>-&lt;/Project&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/Project&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -1156,6 +1156,7 @@
</span><span class="cx">                 6553A33117A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6553A32F17A1F1EE008CF6F3 /* CommonSlowPathsExceptions.cpp */; };
</span><span class="cx">                 6553A33217A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6553A33017A1F1EE008CF6F3 /* CommonSlowPathsExceptions.h */; };
</span><span class="cx">                 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; };
</span><ins>+                658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */ = {isa = PBXBuildFile; fileRef = 658D3A5519638268003C45D6 /* VMEntryRecord.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 65C02850171795E200351E35 /* ARMv7Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0284F171795E200351E35 /* ARMv7Disassembler.cpp */; };
</span><span class="cx">                 65C0285C1717966800351E35 /* ARMv7DOpcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65C0285A1717966800351E35 /* ARMv7DOpcode.cpp */; };
</span><span class="cx">                 65C0285D1717966800351E35 /* ARMv7DOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C0285B1717966800351E35 /* ARMv7DOpcode.h */; };
</span><span class="lines">@@ -2885,7 +2886,7 @@
</span><span class="cx">                 1429D8830ED21C3D00B89619 /* SamplingTool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SamplingTool.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D8840ED21C3D00B89619 /* SamplingTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SamplingTool.h; 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><del>-                1429D8DC0ED2205B00B89619 /* CallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrame.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                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; };
</ins><span class="cx">                 1429D92D0ED22D7000B89619 /* JIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JIT.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1429D92E0ED22D7000B89619 /* JIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JIT.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 142D3938103E4560007DCB52 /* NumericStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumericStrings.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3071,6 +3072,7 @@
</span><span class="cx">                 65621E6B089E859700760F35 /* PropertySlot.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertySlot.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; };
</span><span class="cx">                 65621E6C089E859700760F35 /* PropertySlot.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = PropertySlot.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; };
</span><span class="cx">                 65860177185A8F5E00030EEE /* MaxFrameExtentForSlowPathCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MaxFrameExtentForSlowPathCall.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                658D3A5519638268003C45D6 /* VMEntryRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = VMEntryRecord.h; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
</ins><span class="cx">                 65987F2C167FE84B003C2F8D /* DFGOSRExitCompilationInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGOSRExitCompilationInfo.h; path = dfg/DFGOSRExitCompilationInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65987F2F16828A7E003C2F8D /* UnusedPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnusedPointer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 65C0284F171795E200351E35 /* ARMv7Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ARMv7Disassembler.cpp; path = disassembler/ARMv7Disassembler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3113,7 +3115,7 @@
</span><span class="cx">                 860161E20F3A83C100F84710 /* MacroAssemblerX86Common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerX86Common.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8603CEF214C7546400AE59E3 /* CodeProfiling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CodeProfiling.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8603CEF314C7546400AE59E3 /* CodeProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeProfiling.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                8604F4F2143A6C4400B295F5 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; path = ChangeLog; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                8604F4F2143A6C4400B295F5 /* ChangeLog */ = {isa = PBXFileReference; lastKnownFileType = text; lineEnding = 0; path = ChangeLog; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8606DDE918DA44AB00A383D0 /* IdentifierInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IdentifierInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8612E4CB1522918400C836BE /* MatchResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MatchResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86158AB2155C8B3F00B45C9C /* PropertyName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyName.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3142,8 +3144,8 @@
</span><span class="cx">                 868916A9155F285400CB2B9A /* PrivateName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrivateName.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 869EBCB60E8C6D4A008722CC /* ResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86A054461556451B00445157 /* LowLevelInterpreter.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter.asm; path = llint/LowLevelInterpreter.asm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                86A054471556451B00445157 /* LowLevelInterpreter32_64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter32_64.asm; path = llint/LowLevelInterpreter32_64.asm; sourceTree = &quot;&lt;group&gt;&quot;; };
-                86A054481556451B00445157 /* LowLevelInterpreter64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; name = LowLevelInterpreter64.asm; path = llint/LowLevelInterpreter64.asm; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                86A054471556451B00445157 /* LowLevelInterpreter32_64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; lineEnding = 0; name = LowLevelInterpreter32_64.asm; path = llint/LowLevelInterpreter32_64.asm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                86A054481556451B00445157 /* LowLevelInterpreter64.asm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm.asm; lineEnding = 0; name = LowLevelInterpreter64.asm; path = llint/LowLevelInterpreter64.asm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 86A90ECF0EE7D51F00AB350D /* JITArithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITArithmetic.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARMv7Assembler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARMv7.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3532,7 +3534,7 @@
</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><span class="cx">                 A7C1EAEA17987AB600299DB2 /* CallFrameInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrameInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A7C1EAEB17987AB600299DB2 /* JSStackInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStackInlines.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackVisitor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                A7C1EAEC17987AB600299DB2 /* StackVisitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = StackVisitor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</ins><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="cx">                 A7C225CD1399849C00FF1662 /* KeywordLookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeywordLookup.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3754,8 +3756,8 @@
</span><span class="cx">                 E124A8F60E555775003091F1 /* OpaqueJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpaqueJSString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E178633F0D9BEC0000D74E75 /* InitializeThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InitializeThreading.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E178636C0D9BEEC300D74E75 /* InitializeThreading.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InitializeThreading.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E18E3A560DF9278C00D90B34 /* VM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VM.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E18E3A570DF9278C00D90B34 /* VM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                E18E3A560DF9278C00D90B34 /* VM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = VM.h; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+                E18E3A570DF9278C00D90B34 /* VM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = VM.cpp; sourceTree = &quot;&lt;group&gt;&quot;; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
</ins><span class="cx">                 E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceProviderCacheItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E49DC15112EF272200184A1F /* SourceProviderCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceProviderCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E49DC15512EF277200184A1F /* SourceProviderCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceProviderCache.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4175,6 +4177,7 @@
</span><span class="cx">                 1429D77A0ED20D7300B89619 /* interpreter */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                658D3A5519638268003C45D6 /* VMEntryRecord.h */,
</ins><span class="cx">                                 0F55F0F114D1063600AC7649 /* AbstractPC.cpp */,
</span><span class="cx">                                 0F55F0F214D1063600AC7649 /* AbstractPC.h */,
</span><span class="cx">                                 A7F8690E0F9584A100558697 /* CachedCall.h */,
</span><span class="lines">@@ -6017,6 +6020,7 @@
</span><span class="cx">                                 0F6B1CB91861244C00845D97 /* ArityCheckMode.h in Headers */,
</span><span class="cx">                                 A1A009C11831A26E00CF8711 /* ARM64Assembler.h in Headers */,
</span><span class="cx">                                 86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
</span><ins>+                                658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */,
</ins><span class="cx">                                 2AD2EDFB19799E38004D6478 /* EnumerationMode.h in Headers */,
</span><span class="cx">                                 147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
</span><span class="cx">                                 2A111246192FCE79005EE18D /* CustomGetterSetter.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -139,8 +139,8 @@
</span><span class="cx">             { &quot;name&quot; : &quot;llint_entry&quot; },
</span><span class="cx">             { &quot;name&quot; : &quot;getHostCallReturnValue&quot; },
</span><span class="cx">             { &quot;name&quot; : &quot;llint_return_to_host&quot; },
</span><del>-            { &quot;name&quot; : &quot;llint_call_to_javascript&quot; },
-            { &quot;name&quot; : &quot;llint_call_to_native_function&quot; },
</del><ins>+            { &quot;name&quot; : &quot;llint_vm_entry_to_javascript&quot; },
+            { &quot;name&quot; : &quot;llint_vm_entry_to_native&quot; },
</ins><span class="cx">             { &quot;name&quot; : &quot;llint_cloop_did_return_from_js_1&quot; },
</span><span class="cx">             { &quot;name&quot; : &quot;llint_cloop_did_return_from_js_2&quot; },
</span><span class="cx">             { &quot;name&quot; : &quot;llint_cloop_did_return_from_js_3&quot; },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #include &quot;Repatch.h&quot;
</span><span class="cx"> #include &quot;RepatchBuffer.h&quot;
</span><span class="cx"> #include &quot;SlotVisitorInlines.h&quot;
</span><ins>+#include &quot;StackVisitor.h&quot;
</ins><span class="cx"> #include &quot;UnlinkedInstructionStream.h&quot;
</span><span class="cx"> #include &lt;wtf/BagToHashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="lines">@@ -3159,6 +3160,46 @@
</span><span class="cx">     return jsCast&lt;FunctionExecutable*&gt;(codeOrigin.inlineCallFrame-&gt;executable.get())-&gt;eitherCodeBlock()-&gt;globalObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class RecursionCheckFunctor {
+public:
+    RecursionCheckFunctor(CallFrame* startCallFrame, CodeBlock* codeBlock, unsigned depthToCheck)
+        : m_startCallFrame(startCallFrame)
+        , m_codeBlock(codeBlock)
+        , m_depthToCheck(depthToCheck)
+        , m_foundStartCallFrame(false)
+        , m_didRecurse(false)
+    { }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor)
+    {
+        CallFrame* currentCallFrame = visitor-&gt;callFrame();
+
+        if (currentCallFrame == m_startCallFrame)
+            m_foundStartCallFrame = true;
+
+        if (m_foundStartCallFrame) {
+            if (visitor-&gt;callFrame()-&gt;codeBlock() == m_codeBlock) {
+                m_didRecurse = true;
+                return StackVisitor::Done;
+            }
+
+            if (!m_depthToCheck--)
+                return StackVisitor::Done;
+        }
+
+        return StackVisitor::Continue;
+    }
+
+    bool didRecurse() const { return m_didRecurse; }
+
+private:
+    CallFrame* m_startCallFrame;
+    CodeBlock* m_codeBlock;
+    unsigned m_depthToCheck;
+    bool m_foundStartCallFrame;
+    bool m_didRecurse;
+};
+
</ins><span class="cx"> void CodeBlock::noticeIncomingCall(ExecState* callerFrame)
</span><span class="cx"> {
</span><span class="cx">     CodeBlock* callerCodeBlock = callerFrame-&gt;codeBlock();
</span><span class="lines">@@ -3206,20 +3247,18 @@
</span><span class="cx">             dataLog(&quot;    Clearing SABI because caller is not a function.\n&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
-    ExecState* frame = callerFrame;
-    for (unsigned i = Options::maximumInliningDepth(); i--; frame = frame-&gt;callerFrame()) {
-        if (frame-&gt;isVMEntrySentinel())
-            break;
-        if (frame-&gt;codeBlock() == this) {
-            // Recursive calls won't be inlined.
-            if (Options::verboseCallLink())
-                dataLog(&quot;    Clearing SABI because recursion was detected.\n&quot;);
-            m_shouldAlwaysBeInlined = false;
-            return;
-        }
</del><ins>+
+    // Recursive calls won't be inlined.
+    RecursionCheckFunctor functor(callerFrame, this, Options::maximumInliningDepth());
+    vm()-&gt;topCallFrame-&gt;iterate(functor);
+
+    if (functor.didRecurse()) {
+        if (Options::verboseCallLink())
+            dataLog(&quot;    Clearing SABI because recursion was detected.\n&quot;);
+        m_shouldAlwaysBeInlined = false;
+        return;
</ins><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     RELEASE_ASSERT(callerCodeBlock-&gt;m_capabilityLevelState != DFG::CapabilityLevelNotSet);
</span><span class="cx">     
</span><span class="cx">     if (canCompile(callerCodeBlock-&gt;m_capabilityLevelState))
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -607,7 +607,8 @@
</span><span class="cx">     if (!m_isPaused)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame-&gt;callerFrameSkippingVMEntrySentinel() : 0;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
+    m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame-&gt;callerFrame(topVMEntryFrame) : 0;
</ins><span class="cx">     notifyDoneProcessingDebuggerEvents();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -723,10 +724,13 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Treat stepping over a return statement like stepping out.
</span><del>-    if (m_currentCallFrame == m_pauseOnCallFrame)
-        m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    if (m_currentCallFrame == m_pauseOnCallFrame) {
+        VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
+        m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
+    }
</ins><span class="cx"> 
</span><del>-    m_currentCallFrame = m_currentCallFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
+    m_currentCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::willExecuteProgram(CallFrame* callFrame)
</span><span class="lines">@@ -756,11 +760,13 @@
</span><span class="cx">     if (!m_currentCallFrame)
</span><span class="cx">         return;
</span><span class="cx">     if (m_currentCallFrame == m_pauseOnCallFrame) {
</span><del>-        m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+        VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
+        m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx">         if (!m_currentCallFrame)
</span><span class="cx">             return;
</span><span class="cx">     }
</span><del>-    m_currentCallFrame = m_currentCallFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
+    m_currentCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::didReachBreakpoint(CallFrame* callFrame)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -55,6 +55,29 @@
</span><span class="cx">     unsigned m_column;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+class FindCallerMidStackFunctor {
+public:
+    FindCallerMidStackFunctor(CallFrame* callFrame)
+        : m_callFrame(callFrame)
+        , m_callerFrame(nullptr)
+    { }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor)
+    {
+        if (visitor-&gt;callFrame() == m_callFrame) {
+            m_callerFrame = visitor-&gt;callerFrame();
+            return StackVisitor::Done;
+        }
+        return StackVisitor::Continue;
+    }
+
+    CallFrame* getCallerFrame() const { return m_callerFrame; }
+
+private:
+    CallFrame* m_callFrame;
+    CallFrame* m_callerFrame;
+};
+
</ins><span class="cx"> DebuggerCallFrame::DebuggerCallFrame(CallFrame* callFrame)
</span><span class="cx">     : m_callFrame(callFrame)
</span><span class="cx"> {
</span><span class="lines">@@ -70,7 +93,10 @@
</span><span class="cx">     if (m_caller)
</span><span class="cx">         return m_caller;
</span><span class="cx"> 
</span><del>-    CallFrame* callerFrame = m_callFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    FindCallerMidStackFunctor functor(m_callFrame);
+    m_callFrame-&gt;vm().topCallFrame-&gt;iterate(functor);
+
+    CallFrame* callerFrame = functor.getCallerFrame();
</ins><span class="cx">     if (!callerFrame)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -136,6 +136,16 @@
</span><span class="cx">     return vm().entryScope-&gt;globalObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CallFrame* CallFrame::callerFrame(VMEntryFrame*&amp; currVMEntryFrame)
+{
+    if (callerFrameOrVMEntryFrame() == currVMEntryFrame) {
+        VMEntryRecord* currVMEntryRecord = vmEntryRecord(currVMEntryFrame);
+        currVMEntryFrame = currVMEntryRecord-&gt;prevTopVMEntryFrame();
+        return currVMEntryRecord-&gt;prevTopCallFrame();
+    }
+    return static_cast&lt;CallFrame*&gt;(callerFrameOrVMEntryFrame());
+}
+
</ins><span class="cx"> JSActivation* CallFrame::activation() const
</span><span class="cx"> {
</span><span class="cx">     CodeBlock* codeBlock = this-&gt;codeBlock();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/CallFrame.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/CallFrame.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;MacroAssemblerCodeRef.h&quot;
</span><span class="cx"> #include &quot;Register.h&quot;
</span><span class="cx"> #include &quot;StackVisitor.h&quot;
</span><ins>+#include &quot;VMEntryRecord.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC  {
</span><span class="cx"> 
</span><span class="lines">@@ -94,7 +95,10 @@
</span><span class="cx"> 
</span><span class="cx">         CallFrame&amp; operator=(const Register&amp; r) { *static_cast&lt;Register*&gt;(this) = r; return *this; }
</span><span class="cx"> 
</span><del>-        CallFrame* callerFrame() const { return callerFrameAndPC().callerFrame; }
</del><ins>+        CallFrame* callerFrame() const { return static_cast&lt;CallFrame*&gt;(callerFrameOrVMEntryFrame()); }
+
+        JS_EXPORT_PRIVATE CallFrame* callerFrame(VMEntryFrame*&amp;);
+
</ins><span class="cx">         static ptrdiff_t callerFrameOffset() { return OBJECT_OFFSETOF(CallerFrameAndPC, callerFrame); }
</span><span class="cx"> 
</span><span class="cx">         ReturnAddressPtr returnPC() const { return ReturnAddressPtr(callerFrameAndPC().pc); }
</span><span class="lines">@@ -161,7 +165,7 @@
</span><span class="cx"> 
</span><span class="cx">         Register* topOfFrame()
</span><span class="cx">         {
</span><del>-            if (isVMEntrySentinel() || !codeBlock())
</del><ins>+            if (!codeBlock())
</ins><span class="cx">                 return registers();
</span><span class="cx">             return topOfFrameInternal();
</span><span class="cx">         }
</span><span class="lines">@@ -169,12 +173,10 @@
</span><span class="cx"> #if USE(JSVALUE32_64)
</span><span class="cx">         Instruction* currentVPC() const
</span><span class="cx">         {
</span><del>-            ASSERT(!isVMEntrySentinel());
</del><span class="cx">             return bitwise_cast&lt;Instruction*&gt;(this[JSStack::ArgumentCount].tag());
</span><span class="cx">         }
</span><span class="cx">         void setCurrentVPC(Instruction* vpc)
</span><span class="cx">         {
</span><del>-            ASSERT(!isVMEntrySentinel());
</del><span class="cx">             this[JSStack::ArgumentCount].tag() = bitwise_cast&lt;int32_t&gt;(vpc);
</span><span class="cx">         }
</span><span class="cx"> #else
</span><span class="lines">@@ -189,7 +191,7 @@
</span><span class="cx">         ALWAYS_INLINE void init(CodeBlock* codeBlock, Instruction* vPC, JSScope* scope,
</span><span class="cx">             CallFrame* callerFrame, int argc, JSObject* callee)
</span><span class="cx">         {
</span><del>-            ASSERT(callerFrame == noCaller() || callerFrame-&gt;isVMEntrySentinel() || callerFrame-&gt;stack()-&gt;containsAddress(this));
</del><ins>+            ASSERT(callerFrame == noCaller() || callerFrame-&gt;stack()-&gt;containsAddress(this));
</ins><span class="cx"> 
</span><span class="cx">             setCodeBlock(codeBlock);
</span><span class="cx">             setScope(scope);
</span><span class="lines">@@ -245,35 +247,6 @@
</span><span class="cx"> 
</span><span class="cx">         static CallFrame* noCaller() { return 0; }
</span><span class="cx"> 
</span><del>-        bool isVMEntrySentinel() const
-        {
-            return !!this &amp;&amp; codeBlock() == vmEntrySentinelCodeBlock();
-        }
-
-        CallFrame* vmEntrySentinelCallerFrame() const
-        {
-            ASSERT(isVMEntrySentinel());
-            return this[JSStack::ScopeChain].callFrame();
-        }
-
-        void initializeVMEntrySentinelFrame(CallFrame* callFrame)
-        {
-            setCallerFrame(noCaller());
-            setReturnPC(0);
-            setCodeBlock(vmEntrySentinelCodeBlock());
-            static_cast&lt;Register*&gt;(this)[JSStack::ScopeChain] = callFrame;
-            setCallee(0);
-            setArgumentCountIncludingThis(0);
-        }
-
-        CallFrame* callerFrameSkippingVMEntrySentinel()
-        {
-            CallFrame* caller = callerFrame();
-            if (caller-&gt;isVMEntrySentinel())
-                return caller-&gt;vmEntrySentinelCallerFrame();
-            return caller;
-        }
-
</del><span class="cx">         void setArgumentCountIncludingThis(int count) { static_cast&lt;Register*&gt;(this)[JSStack::ArgumentCount].payload() = count; }
</span><span class="cx">         void setCallee(JSObject* callee) { static_cast&lt;Register*&gt;(this)[JSStack::Callee] = Register::withCallee(callee); }
</span><span class="cx">         void setCodeBlock(CodeBlock* codeBlock) { static_cast&lt;Register*&gt;(this)[JSStack::CodeBlock] = codeBlock; }
</span><span class="lines">@@ -291,7 +264,6 @@
</span><span class="cx">         JS_EXPORT_PRIVATE const char* describeFrame();
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        static const intptr_t s_VMEntrySentinel = 1;
</del><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         JSStack* stack();
</span><span class="lines">@@ -330,11 +302,11 @@
</span><span class="cx">             return this[argumentOffset(argIndex)].jsValue();
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        void* callerFrameOrVMEntryFrame() const { return callerFrameAndPC().callerFrame; }
+
</ins><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"> 
</span><del>-        static CodeBlock* vmEntrySentinelCodeBlock() { return reinterpret_cast&lt;CodeBlock*&gt;(s_VMEntrySentinel); }
-
</del><span class="cx">         friend class JSStack;
</span><span class="cx">         friend class VMInspector;
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -479,8 +479,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    CallFrame* callerFrame = callFrame-&gt;callerFrame();
-    return !callerFrame-&gt;isVMEntrySentinel();
</del><ins>+    return !visitor-&gt;callerIsVMEntryFrame();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static StackFrameCodeType getStackFrameCodeType(StackVisitor&amp; visitor)
</span><span class="lines">@@ -597,7 +596,6 @@
</span><span class="cx"> void Interpreter::getStackTrace(Vector&lt;StackFrame&gt;&amp; results, size_t maxStackSize)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = m_vm;
</span><del>-    ASSERT(!vm.topCallFrame-&gt;isVMEntrySentinel());
</del><span class="cx">     CallFrame* callFrame = vm.topCallFrame;
</span><span class="cx">     if (!callFrame)
</span><span class="cx">         return;
</span><span class="lines">@@ -683,15 +681,6 @@
</span><span class="cx"> 
</span><span class="cx"> NEVER_INLINE HandlerInfo* Interpreter::unwind(CallFrame*&amp; callFrame, JSValue&amp; exceptionValue)
</span><span class="cx"> {
</span><del>-    if (callFrame-&gt;isVMEntrySentinel()) {
-        // This happens when we throw stack overflow in a function that is called
-        // directly from callToJavaScript. Stack overflow throws the exception in the
-        // context of the caller. In that case the caller is the sentinel frame. The
-        // right thing to do is to pretend that the exception is uncaught so that we
-        // go to the uncaught exception handler, which returns through callToJavaScript.
-        return 0;
-    }
-    
</del><span class="cx">     CodeBlock* codeBlock = callFrame-&gt;codeBlock();
</span><span class="cx">     ASSERT(codeBlock);
</span><span class="cx">     bool isTermination = false;
</span><span class="lines">@@ -996,7 +985,7 @@
</span><span class="cx">         if (isJSCall)
</span><span class="cx">             result = callData.js.functionExecutable-&gt;generatedJITCodeForCall()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><span class="cx">         else {
</span><del>-            result = JSValue::decode(callToNativeFunction(reinterpret_cast&lt;void*&gt;(callData.native.function), &amp;vm, &amp;protoCallFrame));
</del><ins>+            result = JSValue::decode(vmEntryToNative(reinterpret_cast&lt;void*&gt;(callData.native.function), &amp;vm, &amp;protoCallFrame));
</ins><span class="cx">             if (callFrame-&gt;hadException())
</span><span class="cx">                 result = jsNull();
</span><span class="cx">         }
</span><span class="lines">@@ -1064,7 +1053,7 @@
</span><span class="cx">         if (isJSConstruct)
</span><span class="cx">             result = constructData.js.functionExecutable-&gt;generatedJITCodeForConstruct()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><span class="cx">         else {
</span><del>-            result = JSValue::decode(callToNativeFunction(reinterpret_cast&lt;void*&gt;(constructData.native.function), &amp;vm, &amp;protoCallFrame));
</del><ins>+            result = JSValue::decode(vmEntryToNative(reinterpret_cast&lt;void*&gt;(constructData.native.function), &amp;vm, &amp;protoCallFrame));
</ins><span class="cx"> 
</span><span class="cx">             if (!callFrame-&gt;hadException())
</span><span class="cx">                 RELEASE_ASSERT(result.isObject());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -157,13 +157,11 @@
</span><span class="cx">             : vm(currentVM)
</span><span class="cx">             , oldCallFrame(currentVM.topCallFrame) 
</span><span class="cx">         {
</span><del>-            ASSERT(!callFrame-&gt;isVMEntrySentinel());
</del><span class="cx">             currentVM.topCallFrame = callFrame;
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         ~TopCallFrameSetter() 
</span><span class="cx">         {
</span><del>-            ASSERT(!oldCallFrame-&gt;isVMEntrySentinel());
</del><span class="cx">             vm.topCallFrame = oldCallFrame;
</span><span class="cx">         }
</span><span class="cx">     private:
</span><span class="lines">@@ -177,18 +175,8 @@
</span><span class="cx">         {
</span><span class="cx">             ASSERT(vm);
</span><span class="cx">             ASSERT(callFrame);
</span><del>-            ASSERT(!callFrame-&gt;isVMEntrySentinel());
</del><span class="cx">             vm-&gt;topCallFrame = callFrame;
</span><span class="cx">         }
</span><del>-        
-        enum VMEntrySentinelOKTag { VMEntrySentinelOK };
-        ALWAYS_INLINE NativeCallFrameTracer(VM* vm, CallFrame* callFrame, VMEntrySentinelOKTag)
-        {
-            ASSERT(vm);
-            ASSERT(callFrame);
-            if (!callFrame-&gt;isVMEntrySentinel())
-                vm-&gt;topCallFrame = callFrame;
-        }
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     class Interpreter {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterStackVisitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -38,6 +38,11 @@
</span><span class="cx"> StackVisitor::StackVisitor(CallFrame* startFrame)
</span><span class="cx"> {
</span><span class="cx">     m_frame.m_index = 0;
</span><ins>+    if (startFrame)
+        m_frame.m_VMEntryFrame = startFrame-&gt;vm().topVMEntryFrame;
+    else
+        m_frame.m_VMEntryFrame = 0;
+    m_frame.m_callerIsVMEntryFrame = false;
</ins><span class="cx">     readFrame(startFrame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -56,7 +61,6 @@
</span><span class="cx"> 
</span><span class="cx"> void StackVisitor::readFrame(CallFrame* callFrame)
</span><span class="cx"> {
</span><del>-    ASSERT(!callFrame-&gt;isVMEntrySentinel());
</del><span class="cx">     if (!callFrame) {
</span><span class="cx">         m_frame.setToEnd();
</span><span class="cx">         return;
</span><span class="lines">@@ -104,7 +108,9 @@
</span><span class="cx"> {
</span><span class="cx">     m_frame.m_callFrame = callFrame;
</span><span class="cx">     m_frame.m_argumentCountIncludingThis = callFrame-&gt;argumentCountIncludingThis();
</span><del>-    m_frame.m_callerFrame = callFrame-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    VMEntryFrame* currentVMEntryFrame = m_frame.m_VMEntryFrame;
+    m_frame.m_callerFrame = callFrame-&gt;callerFrame(m_frame.m_VMEntryFrame);
+    m_frame.m_callerIsVMEntryFrame = currentVMEntryFrame != m_frame.m_VMEntryFrame;
</ins><span class="cx">     m_frame.m_callee = callFrame-&gt;callee();
</span><span class="cx">     m_frame.m_scope = callFrame-&gt;scope();
</span><span class="cx">     m_frame.m_codeBlock = callFrame-&gt;codeBlock();
</span><span class="lines">@@ -127,7 +133,6 @@
</span><span class="cx"> void StackVisitor::readInlinedFrame(CallFrame* callFrame, CodeOrigin* codeOrigin)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(codeOrigin);
</span><del>-    ASSERT(!callFrame-&gt;isVMEntrySentinel());
</del><span class="cx"> 
</span><span class="cx">     int frameOffset = inlinedFrameOffset(codeOrigin);
</span><span class="cx">     bool isInlined = !!frameOffset;
</span><span class="lines">@@ -380,7 +385,6 @@
</span><span class="cx"> 
</span><span class="cx">     printif(i, &quot;   name '%s'\n&quot;, functionName().utf8().data());
</span><span class="cx">     printif(i, &quot;   sourceURL '%s'\n&quot;, sourceURL().utf8().data());
</span><del>-    printif(i, &quot;   isVMEntrySentinel %d\n&quot;, callerFrame-&gt;isVMEntrySentinel());
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx">     printif(i, &quot;   isInlinedFrame %d\n&quot;, isInlinedFrame());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterStackVisitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/StackVisitor.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/StackVisitor.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/StackVisitor.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef StackVisitor_h
</span><span class="cx"> #define StackVisitor_h
</span><span class="cx"> 
</span><ins>+#include &quot;VMEntryRecord.h&quot;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">         size_t index() const { return m_index; }
</span><span class="cx">         size_t argumentCountIncludingThis() const { return m_argumentCountIncludingThis; }
</span><ins>+        bool callerIsVMEntryFrame() const { return m_callerIsVMEntryFrame; }
</ins><span class="cx">         CallFrame* callerFrame() const { return m_callerFrame; }
</span><span class="cx">         JSObject* callee() const { return m_callee; }
</span><span class="cx">         JSScope* scope() const { return m_scope; }
</span><span class="lines">@@ -94,11 +96,13 @@
</span><span class="cx"> 
</span><span class="cx">         size_t m_index;
</span><span class="cx">         size_t m_argumentCountIncludingThis;
</span><ins>+        VMEntryFrame* m_VMEntryFrame;
</ins><span class="cx">         CallFrame* m_callerFrame;
</span><span class="cx">         JSObject* m_callee;
</span><span class="cx">         JSScope* m_scope;
</span><span class="cx">         CodeBlock* m_codeBlock;
</span><span class="cx">         unsigned m_bytecodeOffset;
</span><ins>+        bool m_callerIsVMEntryFrame;
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx">         InlineCallFrame* m_inlineCallFrame;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterVMEntryRecordh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/interpreter/VMEntryRecord.h (0 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/VMEntryRecord.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/interpreter/VMEntryRecord.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 VMEntryRecord_h
+#define VMEntryRecord_h
+
+namespace JSC {
+
+typedef void VMEntryFrame;
+
+class ExecState;
+class VM;
+
+struct VMEntryRecord {
+    /*
+     * This record stored in a vmEntryTo{JavaScript,Host} allocated frame. It is allocated on the stack
+     * after callee save registers where local variables would go.
+     */
+    VM* m_vm;
+    ExecState* m_prevTopCallFrame;
+    VMEntryFrame* m_prevTopVMEntryFrame;
+
+    ExecState* prevTopCallFrame() { return m_prevTopCallFrame; }
+
+    VMEntryFrame* prevTopVMEntryFrame() { return m_prevTopVMEntryFrame; }
+};
+
+extern &quot;C&quot; VMEntryRecord* vmEntryRecord(VMEntryFrame*);
+
+} // namespace JSC
+
+#endif // VMEntryRecord_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterVMInspectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/interpreter/VMInspector.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(VMINSPECTOR)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><ins>+#include &quot;StackVisitor.h&quot;
</ins><span class="cx"> #include &lt;wtf/ASCIICType.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -99,14 +100,30 @@
</span><span class="cx">     printf(&quot;\n&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class CountFramesFunctor {
+public:
+    CountFramesFunctor()
+        : m_count(-1)
+    { }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor)
+    {
+        m_count++;
+        return StackVisitor::Continue;
+    }
+
+    int count() const { return m_count; }
+
+private:
+    unsigned m_count;
+};
+
</ins><span class="cx"> int VMInspector::countFrames(CallFrame* frame)
</span><span class="cx"> {
</span><del>-    int count = -1;
-    while (frame &amp;&amp; !frame-&gt;isVMEntrySentinel()) {
-        count++;
-        frame = frame-&gt;callerFrame();
-    }
-    return count;
</del><ins>+    CountFramesFunctor functor();
+    StackVisitor::visit(frame, functor);
+
+    return functor.count();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITCodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITCode.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITCode.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/jit/JITCode.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue JITCode::execute(VM* vm, ProtoCallFrame* protoCallFrame)
</span><span class="cx"> {
</span><del>-    JSValue result = JSValue::decode(callToJavaScript(executableAddress(), vm, protoCallFrame));
</del><ins>+    JSValue result = JSValue::decode(vmEntryToJavaScript(executableAddress(), vm, protoCallFrame));
</ins><span class="cx">     return vm-&gt;exception() ? jsNull() : result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -80,7 +80,9 @@
</span><span class="cx"> {
</span><span class="cx">     // We pass in our own code block, because the callframe hasn't been populated.
</span><span class="cx">     VM* vm = codeBlock-&gt;vm();
</span><del>-    CallFrame* callerFrame = exec-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+
+    VMEntryFrame* topVMEntryFrame = vm-&gt;topVMEntryFrame;
+    CallFrame* callerFrame = exec-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx">     if (!callerFrame)
</span><span class="cx">         callerFrame = exec;
</span><span class="cx"> 
</span><span class="lines">@@ -92,7 +94,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>-    CallFrame* callerFrame = exec-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    VMEntryFrame* topVMEntryFrame = vm-&gt;topVMEntryFrame;
+    CallFrame* callerFrame = exec-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx">     NativeCallFrameTracer tracer(vm, callerFrame);
</span><span class="cx"> 
</span><span class="cx">     JSStack&amp; stack = vm-&gt;interpreter-&gt;stack();
</span><span class="lines">@@ -107,7 +110,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>-    CallFrame* callerFrame = exec-&gt;callerFrameSkippingVMEntrySentinel();
</del><ins>+    VMEntryFrame* topVMEntryFrame = vm-&gt;topVMEntryFrame;
+    CallFrame* callerFrame = exec-&gt;callerFrame(topVMEntryFrame);
</ins><span class="cx">     NativeCallFrameTracer tracer(vm, callerFrame);
</span><span class="cx"> 
</span><span class="cx">     JSStack&amp; stack = vm-&gt;interpreter-&gt;stack();
</span><span class="lines">@@ -1823,7 +1827,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JIT_OPERATION lookupExceptionHandler(VM* vm, ExecState* exec)
</span><span class="cx"> {
</span><del>-    NativeCallFrameTracer tracer(vm, exec, NativeCallFrameTracer::VMEntrySentinelOK);
</del><ins>+    NativeCallFrameTracer tracer(vm, exec);
</ins><span class="cx"> 
</span><span class="cx">     JSValue exceptionValue = vm-&gt;exception();
</span><span class="cx">     ASSERT(exceptionValue);
</span><span class="lines">@@ -1837,7 +1841,6 @@
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx">     NativeCallFrameTracer tracer(vm, exec);
</span><span class="cx"> 
</span><del>-    ASSERT(!exec-&gt;isVMEntrySentinel());
</del><span class="cx">     genericUnwind(vm, exec, vm-&gt;exception());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubs.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubs.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/jit/JITStubs.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -41,8 +41,8 @@
</span><span class="cx"> class VM;
</span><span class="cx"> 
</span><span class="cx"> extern &quot;C&quot; {
</span><del>-    EncodedJSValue callToJavaScript(void*, VM*, ProtoCallFrame*);
-    EncodedJSValue callToNativeFunction(void*, VM*, ProtoCallFrame*);
</del><ins>+    EncodedJSValue vmEntryToJavaScript(void*, VM*, ProtoCallFrame*);
+    EncodedJSValue vmEntryToNative(void*, VM*, ProtoCallFrame*);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -687,8 +687,10 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState* exec)
</span><span class="cx"> {
</span><del>-    if (!exec-&gt;callerFrame()-&gt;isVMEntrySentinel())
-        exec-&gt;vm().interpreter-&gt;dumpCallFrame(exec-&gt;callerFrame());
</del><ins>+    VMEntryFrame* topVMEntryFrame = exec-&gt;vm().topVMEntryFrame;
+    ExecState* callerFrame = exec-&gt;callerFrame(topVMEntryFrame);
+    if (callerFrame)
+        exec-&gt;vm().interpreter-&gt;dumpCallFrame(callerFrame);
</ins><span class="cx">     return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntOffsetsExtractorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LLIntOffsetsExtractor.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &quot;ProtoCallFrame.h&quot;
</span><span class="cx"> #include &quot;Structure.h&quot;
</span><span class="cx"> #include &quot;StructureChain.h&quot;
</span><ins>+#include &quot;VMEntryRecord.h&quot;
</ins><span class="cx"> #include &quot;ValueProfile.h&quot;
</span><span class="cx"> #include &lt;wtf/text/StringImpl.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntThunkscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include &quot;LinkBuffer.h&quot;
</span><span class="cx"> #include &quot;LowLevelInterpreter.h&quot;
</span><span class="cx"> #include &quot;ProtoCallFrame.h&quot;
</span><ins>+#include &quot;StackAlignment.h&quot;
</ins><span class="cx"> #include &quot;VM.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="lines">@@ -93,18 +94,27 @@
</span><span class="cx"> 
</span><span class="cx"> // Non-JIT (i.e. C Loop LLINT) case:
</span><span class="cx"> 
</span><del>-EncodedJSValue callToJavaScript(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
</del><ins>+EncodedJSValue vmEntryToJavaScript(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
</ins><span class="cx"> {
</span><del>-    JSValue result = CLoop::execute(llint_call_to_javascript, executableAddress, vm, protoCallFrame);
</del><ins>+    JSValue result = CLoop::execute(llint_vm_entry_to_javascript, executableAddress, vm, protoCallFrame);
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue callToNativeFunction(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
</del><ins>+EncodedJSValue vmEntryToNative(void* executableAddress, VM* vm, ProtoCallFrame* protoCallFrame)
</ins><span class="cx"> {
</span><del>-    JSValue result = CLoop::execute(llint_call_to_native_function, executableAddress, vm, protoCallFrame);
</del><ins>+    JSValue result = CLoop::execute(llint_vm_entry_to_native, executableAddress, vm, protoCallFrame);
</ins><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+extern &quot;C&quot; VMEntryRecord* vmEntryRecord(VMEntryFrame* entryFrame)
+{
+    // The C Loop doesn't have any callee save registers, so the VMEntryRecord is allocated at the base of the frame.
+    intptr_t stackAlignment = stackAlignmentBytes();
+    intptr_t VMEntryTotalFrameSize = (sizeof(VMEntryRecord) + (stackAlignment - 1)) &amp; ~(stackAlignment - 1);
+    return reinterpret_cast&lt;VMEntryRecord*&gt;(static_cast&lt;char*&gt;(entryFrame) - VMEntryTotalFrameSize);
+}
+
+
</ins><span class="cx"> #endif // ENABLE(JIT)
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntThunksh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntThunks.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntThunks.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LLIntThunks.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx"> struct ProtoCallFrame;
</span><span class="cx"> 
</span><span class="cx"> extern &quot;C&quot; {
</span><del>-    EncodedJSValue callToJavaScript(void*, VM*, ProtoCallFrame*);
-    EncodedJSValue callToNativeFunction(void*, VM*, ProtoCallFrame*);
</del><ins>+    EncodedJSValue vmEntryToJavaScript(void*, VM*, ProtoCallFrame*);
+    EncodedJSValue vmEntryToNative(void*, VM*, ProtoCallFrame*);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace LLInt {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx"> end
</span><span class="cx"> const SlotSize = 8
</span><span class="cx"> 
</span><ins>+const StackAlignment = 16
+const StackAlignmentMask = StackAlignment - 1
+
</ins><span class="cx"> const CallerFrameAndPCSize = 2 * PtrSize
</span><span class="cx"> 
</span><span class="cx"> const CallerFrame = 0
</span><span class="lines">@@ -235,9 +238,9 @@
</span><span class="cx">         if ARM or ARMv7 or ARMv7_TRADITIONAL
</span><span class="cx">             # ARM can't do logical ops with the sp as a source
</span><span class="cx">             move sp, tempReg
</span><del>-            andp 0xf, tempReg
</del><ins>+            andp StackAlignmentMask, tempReg
</ins><span class="cx">         else
</span><del>-            andp sp, 0xf, tempReg
</del><ins>+            andp sp, StackAlignmentMask, tempReg
</ins><span class="cx">         end
</span><span class="cx">         btpz tempReg, .stackPointerOkay
</span><span class="cx">         move location, tempReg
</span><span class="lines">@@ -246,6 +249,26 @@
</span><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> 
</span><ins>+if C_LOOP
+    const CalleeSaveRegisterCount = 0
+elsif ARM or ARMv7_TRADITIONAL or ARMv7
+    const CalleeSaveRegisterCount = 7
+elsif ARM64 or MIPS
+    const CalleeSaveRegisterCount = 10
+elsif SH4 or X86_64
+    const CalleeSaveRegisterCount = 5
+elsif X86 or X86_WIN
+    const CalleeSaveRegisterCount = 3
+elsif X86_64_WIN
+    const CalleeSaveRegisterCount = 7
+end
+
+const CalleeRegisterSaveSize = CalleeSaveRegisterCount * PtrSize
+
+# VMEntryTotalFrameSize includes the space for struct VMEntryRecord and the
+# callee save registers rounded up to keep the stack aligned
+const VMEntryTotalFrameSize = (CalleeRegisterSaveSize + sizeof VMEntryRecord + StackAlignment - 1) &amp; ~StackAlignmentMask
+
</ins><span class="cx"> macro pushCalleeSaves()
</span><span class="cx">     if C_LOOP
</span><span class="cx">     elsif ARM or ARMv7_TRADITIONAL
</span><span class="lines">@@ -417,75 +440,10 @@
</span><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-macro callToJavaScriptPrologue()
-    if X86_64 or X86_64_WIN
-        push cfr
-        push t0
-    elsif X86 or X86_WIN
-        push cfr
-    elsif ARM64
-        push cfr, lr
-    elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4
-        push lr
-        push cfr
-    end
-    pushCalleeSaves()
-    if X86
-        subp 12, sp
-    elsif X86_WIN
-        subp 16, sp
-        move sp, t4
-        move t4, t0
-        move t4, t2
-        andp 0xf, t2
-        andp 0xfffffff0, t0
-        move t0, sp
-        storep t4, [sp]
-    elsif ARM or ARMv7 or ARMv7_TRADITIONAL
-        subp 4, sp
-        move sp, t4
-        clrbp t4, 0xf, t5
-        move t5, sp
-        storep t4, [sp]
-    end
</del><ins>+macro vmEntryRecord(entryFramePointer, resultReg)
+    subp entryFramePointer, VMEntryTotalFrameSize, resultReg
</ins><span class="cx"> end
</span><span class="cx"> 
</span><del>-macro callToJavaScriptEpilogue()
-    if ARMv7
-        addp CallFrameHeaderSlots * 8, cfr, t4
-        move t4, sp
-    else
-        addp CallFrameHeaderSlots * 8, cfr, sp
-    end
-
-    loadp CallerFrame[cfr], cfr
-
-    if X86
-        addp 12, sp
-    elsif X86_WIN
-        pop t4
-        move t4, sp
-        addp 16, sp
-    elsif ARM or ARMv7 or ARMv7_TRADITIONAL
-        pop t4
-        move t4, sp
-        addp 4, sp
-    end
-
-    popCalleeSaves()
-    if X86_64 or X86_64_WIN
-        pop t2
-        pop cfr
-    elsif X86 or X86_WIN
-        pop cfr
-    elsif ARM64
-        pop lr, cfr
-    elsif C_LOOP or ARM or ARMv7 or ARMv7_TRADITIONAL or MIPS or SH4
-        pop cfr
-        pop lr
-    end
-end
-
</del><span class="cx"> macro moveStackPointerForCodeBlock(codeBlock, scratch)
</span><span class="cx">     loadi CodeBlock::m_numCalleeRegisters[codeBlock], scratch
</span><span class="cx">     lshiftp 3, scratch
</span><span class="lines">@@ -728,25 +686,25 @@
</span><span class="cx"> end
</span><span class="cx"> 
</span><span class="cx"> # stub to call into JavaScript or Native functions
</span><del>-# EncodedJSValue callToJavaScript(void* code, ExecState** vmTopCallFrame, ProtoCallFrame* protoFrame)
-# EncodedJSValue callToNativeFunction(void* code, ExecState** vmTopCallFrame, ProtoCallFrame* protoFrame)
</del><ins>+# EncodedJSValue vmEntryToJavaScript(void* code, VM* vm, ProtoCallFrame* protoFrame)
+# EncodedJSValue vmEntryToNativeFunction(void* code, VM* vm, ProtoCallFrame* protoFrame)
</ins><span class="cx"> 
</span><span class="cx"> if C_LOOP
</span><del>-_llint_call_to_javascript:
</del><ins>+_llint_vm_entry_to_javascript:
</ins><span class="cx"> else
</span><del>-global _callToJavaScript
-_callToJavaScript:
</del><ins>+global _vmEntryToJavaScript
+_vmEntryToJavaScript:
</ins><span class="cx"> end
</span><del>-    doCallToJavaScript(makeJavaScriptCall)
</del><ins>+    doVMEntry(makeJavaScriptCall)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> if C_LOOP
</span><del>-_llint_call_to_native_function:
</del><ins>+_llint_vm_entry_to_native:
</ins><span class="cx"> else
</span><del>-global _callToNativeFunction
-_callToNativeFunction:
</del><ins>+global _vmEntryToNative
+_vmEntryToNative:
</ins><span class="cx"> end
</span><del>-    doCallToJavaScript(makeHostFunctionCall)
</del><ins>+    doVMEntry(makeHostFunctionCall)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> if C_LOOP
</span><span class="lines">@@ -789,9 +747,32 @@
</span><span class="cx">     move sp, address
</span><span class="cx">     storep address, VM::m_lastStackTop[vm]
</span><span class="cx">     ret
</span><del>-end
</del><span class="cx"> 
</span><ins>+if C_LOOP
+else
+# VMEntryRecord* vmEntryRecord(const VMEntryFrame* entryFrame)
+global _vmEntryRecord
+_vmEntryRecord:
+    if X86_64
+        const entryFrame = t4
+        const result = t0
+    elsif X86 or X86_WIN
+        const entryFrame = t2
+        const result = t0
+    else
+        const entryFrame = a0
+        const result = t0
+    end
</ins><span class="cx"> 
</span><ins>+    if X86 or X86_WIN
+        loadp 4[sp], entryFrame
+    end
+
+    vmEntryRecord(entryFrame, result)
+    ret
+end
+end
+
</ins><span class="cx"> if C_LOOP
</span><span class="cx"> # Dummy entry point the C Loop uses to initialize.
</span><span class="cx"> _llint_entry:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx">     CallFrame* startCFR = cfr.callFrame;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // Initialize the incoming args for doCallToJavaScript:
</del><ins>+    // Initialize the incoming args for doVMEntryToJavaScript:
</ins><span class="cx">     t0.vp = executableAddress;
</span><span class="cx">     t1.vm = vm;
</span><span class="cx">     t2.protoCallFrame = protoCallFrame;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -155,16 +155,14 @@
</span><span class="cx">     move t0, PC
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-macro doCallToJavaScript(makeCall)
</del><ins>+macro doVMEntry(makeCall)
</ins><span class="cx">     if X86 or X86_WIN
</span><span class="cx">         const entry = t4
</span><span class="cx">         const vm = t3
</span><span class="cx">         const protoCallFrame = t5
</span><span class="cx"> 
</span><del>-        const previousCFR = t0
-        const previousPC = t1
-        const temp1 = t0 # Same as previousCFR
-        const temp2 = t1 # Same as previousPC
</del><ins>+        const temp1 = t0
+        const temp2 = t1
</ins><span class="cx">         const temp3 = t2
</span><span class="cx">         const temp4 = t3 # same as vm
</span><span class="cx">     elsif ARM or ARMv7 or ARMv7_TRADITIONAL or C_LOOP
</span><span class="lines">@@ -172,9 +170,7 @@
</span><span class="cx">         const vm = a1
</span><span class="cx">         const protoCallFrame = a2
</span><span class="cx"> 
</span><del>-        const previousCFR = t3
-        const previousPC = lr
-        const temp1 = t3 # Same as previousCFR
</del><ins>+        const temp1 = t3
</ins><span class="cx">         const temp2 = t4
</span><span class="cx">         const temp3 = t5
</span><span class="cx">         const temp4 = t4 # Same as temp2
</span><span class="lines">@@ -184,8 +180,6 @@
</span><span class="cx">         const protoCallFrame = a2
</span><span class="cx">         const topOfStack = a3
</span><span class="cx"> 
</span><del>-        const previousCFR = t2
-        const previousPC = lr
</del><span class="cx">         const temp1 = t3
</span><span class="cx">         const temp2 = t5
</span><span class="cx">         const temp3 = t4
</span><span class="lines">@@ -195,71 +189,53 @@
</span><span class="cx">         const vm = a1
</span><span class="cx">         const protoCallFrame = a2
</span><span class="cx"> 
</span><del>-        const previousCFR = t3
-        const previousPC = lr
-        const temp1 = t3 # Same as previousCFR
</del><ins>+        const temp1 = t3
</ins><span class="cx">         const temp2 = a3
</span><span class="cx">         const temp3 = t8
</span><span class="cx">         const temp4 = t9
</span><span class="cx">     end
</span><span class="cx"> 
</span><del>-    callToJavaScriptPrologue()
</del><ins>+    functionPrologue()
+    pushCalleeSaves()
</ins><span class="cx"> 
</span><del>-    if X86
-        loadp 36[sp], vm
-        loadp 32[sp], entry
-    elsif X86_WIN
-        loadp 40[sp, temp3], vm
-        loadp 36[sp, temp3], entry
-    else
-        move cfr, previousCFR
</del><ins>+    if X86 or X86_WIN
+        loadp 12[cfr], vm
+        loadp 8[cfr], entry
</ins><span class="cx">     end
</span><span class="cx"> 
</span><del>-    checkStackPointerAlignment(temp2, 0xbad0dc01)
</del><ins>+    vmEntryRecord(cfr, sp)
</ins><span class="cx"> 
</span><del>-    # The stack reserved zone ensures that we have adequate space for the
-    # VMEntrySentinelFrame. Proceed with allocating and initializing the
-    # sentinel frame.
-    move sp, cfr
-    subp CallFrameHeaderSlots * 8, cfr
-    storep 0, ArgumentCount[cfr]
-    storep vm, Callee[cfr]
</del><ins>+    storep vm, VMEntryRecord::m_vm[sp]
</ins><span class="cx">     loadp VM::topCallFrame[vm], temp2
</span><del>-    storep temp2, ScopeChain[cfr]
-    storep 1, CodeBlock[cfr]
-    if X86
-        loadp 28[sp], previousPC
-        loadp 24[sp], previousCFR
-    elsif X86_WIN
-        loadp 32[sp, temp3], previousPC
-        loadp 28[sp, temp3], previousCFR
</del><ins>+    storep temp2, VMEntryRecord::m_prevTopCallFrame[sp]
+    loadp VM::topVMEntryFrame[vm], temp2
+    storep temp2, VMEntryRecord::m_prevTopVMEntryFrame[sp]
+
+    # Align stack pointer
+    if X86_WIN
+        addp CallFrameAlignSlots * SlotSize, sp, temp1
+        andp ~StackAlignmentMask, temp1
+        subp temp1, CallFrameAlignSlots * SlotSize, sp
+    elsif ARM or ARMv7 or ARMv7_TRADITIONAL
+        addp CallFrameAlignSlots * SlotSize, sp, temp1
+        clrbp temp1, StackAlignmentMask, temp1
+        subp temp1, CallFrameAlignSlots * SlotSize, sp
</ins><span class="cx">     end
</span><del>-    storep previousPC, ReturnPC[cfr]
-    storep previousCFR, CallerFrame[cfr]
</del><span class="cx"> 
</span><del>-    if X86
-        loadp 40[sp], protoCallFrame
-    elsif X86_WIN
-        loadp 44[sp, temp3], protoCallFrame
</del><ins>+    if X86 or X86_WIN
+        loadp 16[cfr], protoCallFrame
</ins><span class="cx">     end
</span><span class="cx"> 
</span><span class="cx">     loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp2
</span><span class="cx">     addp CallFrameHeaderSlots, temp2, temp2
</span><span class="cx">     lshiftp 3, temp2
</span><del>-    subp cfr, temp2, temp1
</del><ins>+    subp sp, temp2, temp1
</ins><span class="cx"> 
</span><span class="cx">     # Ensure that we have enough additional stack capacity for the incoming args,
</span><span class="cx">     # and the frame for the JS code we're executing. We need to do this check
</span><span class="cx">     # before we start copying the args from the protoCallFrame below.
</span><span class="cx">     bpaeq temp1, VM::m_jsStackLimit[vm], .stackHeightOK
</span><span class="cx"> 
</span><del>-    if ARMv7
-        subp cfr, 8, temp2
-        move temp2, sp
-    else
-        subp cfr, 8, sp
-    end
-
</del><span class="cx">     if C_LOOP
</span><span class="cx">         move entry, temp2
</span><span class="cx">         move vm, temp3
</span><span class="lines">@@ -275,7 +251,19 @@
</span><span class="cx">     end
</span><span class="cx"> 
</span><span class="cx">     cCall2(_llint_throw_stack_overflow_error, vm, protoCallFrame)
</span><del>-    callToJavaScriptEpilogue()
</del><ins>+
+    vmEntryRecord(cfr, sp)
+
+    loadp VMEntryRecord::m_vm[sp], temp3
+    loadp VMEntryRecord::m_prevTopCallFrame[sp], temp4
+    storep temp4, VM::topCallFrame[temp3]
+    loadp VMEntryRecord::m_prevTopVMEntryFrame[sp], temp4
+    storep temp4, VM::topVMEntryFrame[temp3]
+
+    subp cfr, CalleeRegisterSaveSize, sp
+
+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx">     ret
</span><span class="cx"> 
</span><span class="cx"> .stackHeightOK:
</span><span class="lines">@@ -316,18 +304,22 @@
</span><span class="cx"> 
</span><span class="cx"> .copyArgsDone:
</span><span class="cx">     storep sp, VM::topCallFrame[vm]
</span><ins>+    storep cfr, VM::topVMEntryFrame[vm]
</ins><span class="cx"> 
</span><span class="cx">     makeCall(entry, temp1, temp2)
</span><span class="cx"> 
</span><del>-    bpeq CodeBlock[cfr], 1, .calleeFramePopped
-    loadp CallerFrame[cfr], cfr
</del><ins>+    vmEntryRecord(cfr, sp)
</ins><span class="cx"> 
</span><del>-.calleeFramePopped:
-    loadp Callee[cfr], temp3 # VM
-    loadp ScopeChain[cfr], temp4 # previous topCallFrame
</del><ins>+    loadp VMEntryRecord::m_vm[sp], temp3
+    loadp VMEntryRecord::m_prevTopCallFrame[sp], temp4
</ins><span class="cx">     storep temp4, VM::topCallFrame[temp3]
</span><ins>+    loadp VMEntryRecord::m_prevTopVMEntryFrame[sp], temp4
+    storep temp4, VM::topVMEntryFrame[temp3]
</ins><span class="cx"> 
</span><del>-    callToJavaScriptEpilogue()
</del><ins>+    subp cfr, CalleeRegisterSaveSize, sp
+
+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx">     ret
</span><span class="cx"> end
</span><span class="cx"> 
</span><span class="lines">@@ -378,19 +370,20 @@
</span><span class="cx">     loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
</span><span class="cx">     loadp VM::callFrameForThrow[t3], cfr
</span><span class="cx"> 
</span><del>-    # So far, we've unwound the stack to the frame just below the sentinel frame, except
-    # in the case of stack overflow in the first function called from callToJavaScript.
-    # Check if we need to pop to the sentinel frame and do the necessary clean up for
-    # returning to the caller C frame.
-    bpeq CodeBlock[cfr], 1, .handleUncaughtExceptionAlreadyIsSentinel
</del><span class="cx">     loadp CallerFrame + PayloadOffset[cfr], cfr
</span><del>-.handleUncaughtExceptionAlreadyIsSentinel:
</del><span class="cx"> 
</span><del>-    loadp Callee + PayloadOffset[cfr], t3 # VM
-    loadp ScopeChain + PayloadOffset[cfr], t5 # previous topCallFrame
</del><ins>+    vmEntryRecord(cfr, sp)
+
+    loadp VMEntryRecord::m_vm[sp], t3
+    loadp VMEntryRecord::m_prevTopCallFrame[sp], t5
</ins><span class="cx">     storep t5, VM::topCallFrame[t3]
</span><ins>+    loadp VMEntryRecord::m_prevTopVMEntryFrame[sp], t5
+    storep t5, VM::topVMEntryFrame[t3]
</ins><span class="cx"> 
</span><del>-    callToJavaScriptEpilogue()
</del><ins>+    subp cfr, CalleeRegisterSaveSize, sp
+
+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx">     ret
</span><span class="cx"> 
</span><span class="cx"> macro doReturnFromHostFunction(extraStackSpace)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx">     end
</span><span class="cx"> end
</span><span class="cx"> 
</span><del>-macro doCallToJavaScript(makeCall)
</del><ins>+macro doVMEntry(makeCall)
</ins><span class="cx">     if X86_64
</span><span class="cx">         const entry = t4
</span><span class="cx">         const vm = t5
</span><span class="lines">@@ -171,47 +171,29 @@
</span><span class="cx">         const temp3 = t6
</span><span class="cx">     end
</span><span class="cx"> 
</span><del>-    callToJavaScriptPrologue()
</del><ins>+    functionPrologue()
+    pushCalleeSaves()
</ins><span class="cx"> 
</span><del>-    if X86_64
-        loadp 7*8[sp], previousPC
-        move 6*8[sp], previousCFR
-    elsif X86_64_WIN
-        # Win64 pushes two more registers
-        loadp 9*8[sp], previousPC
-        move 8*8[sp], previousCFR
-    elsif ARM64
-        move cfr, previousCFR
-    end
</del><ins>+    vmEntryRecord(cfr, sp)
</ins><span class="cx"> 
</span><span class="cx">     checkStackPointerAlignment(temp2, 0xbad0dc01)
</span><span class="cx"> 
</span><del>-    # The stack reserved zone ensures that we have adequate space for the
-    # VMEntrySentinelFrame. Proceed with allocating and initializing the
-    # sentinel frame.
-    move sp, cfr
-    subp CallFrameHeaderSlots * 8, cfr
-    storep 0, ArgumentCount[cfr]
-    storep vm, Callee[cfr]
</del><ins>+    storep vm, VMEntryRecord::m_vm[sp]
</ins><span class="cx">     loadp VM::topCallFrame[vm], temp2
</span><del>-    storep temp2, ScopeChain[cfr]
-    storep 1, CodeBlock[cfr]
</del><ins>+    storep temp2, VMEntryRecord::m_prevTopCallFrame[sp]
+    loadp VM::topVMEntryFrame[vm], temp2
+    storep temp2, VMEntryRecord::m_prevTopVMEntryFrame[sp]
</ins><span class="cx"> 
</span><del>-    storep previousPC, ReturnPC[cfr]
-    storep previousCFR, CallerFrame[cfr]
-
</del><span class="cx">     loadi ProtoCallFrame::paddedArgCount[protoCallFrame], temp2
</span><span class="cx">     addp CallFrameHeaderSlots, temp2, temp2
</span><span class="cx">     lshiftp 3, temp2
</span><del>-    subp cfr, temp2, temp1
</del><ins>+    subp sp, temp2, temp1
</ins><span class="cx"> 
</span><span class="cx">     # Ensure that we have enough additional stack capacity for the incoming args,
</span><span class="cx">     # and the frame for the JS code we're executing. We need to do this check
</span><span class="cx">     # before we start copying the args from the protoCallFrame below.
</span><span class="cx">     bpaeq temp1, VM::m_jsStackLimit[vm], .stackHeightOK
</span><span class="cx"> 
</span><del>-    move cfr, sp
-
</del><span class="cx">     if C_LOOP
</span><span class="cx">         move entry, temp2
</span><span class="cx">         move vm, temp3
</span><span class="lines">@@ -227,7 +209,19 @@
</span><span class="cx">     end
</span><span class="cx"> 
</span><span class="cx">     cCall2(_llint_throw_stack_overflow_error, vm, protoCallFrame)
</span><del>-    callToJavaScriptEpilogue()
</del><ins>+
+    vmEntryRecord(cfr, temp2)
+
+    loadp VMEntryRecord::m_vm[temp2], vm
+    loadp VMEntryRecord::m_prevTopCallFrame[temp2], temp3
+    storep temp3, VM::topCallFrame[vm]
+    loadp VMEntryRecord::m_prevTopVMEntryFrame[temp2], temp3
+    storep temp3, VM::topVMEntryFrame[vm]
+
+    subp cfr, CalleeRegisterSaveSize, sp
+
+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx">     ret
</span><span class="cx"> 
</span><span class="cx"> .stackHeightOK:
</span><span class="lines">@@ -269,6 +263,7 @@
</span><span class="cx">     else
</span><span class="cx">         storep sp, VM::topCallFrame[vm]
</span><span class="cx">     end
</span><ins>+    storep cfr, VM::topVMEntryFrame[vm]
</ins><span class="cx"> 
</span><span class="cx">     move 0xffff000000000000, csr1
</span><span class="cx">     addp 2, csr1, csr2
</span><span class="lines">@@ -279,20 +274,18 @@
</span><span class="cx"> 
</span><span class="cx">     checkStackPointerAlignment(temp3, 0xbad0dc03)
</span><span class="cx"> 
</span><del>-    bpeq CodeBlock[cfr], 1, .calleeFramePopped
-    loadp CallerFrame[cfr], cfr
</del><ins>+    vmEntryRecord(cfr, temp2)
</ins><span class="cx"> 
</span><del>-.calleeFramePopped:
-    loadp Callee[cfr], temp2 # VM
-    loadp ScopeChain[cfr], temp3 # previous topCallFrame
-    storep temp3, VM::topCallFrame[temp2]
</del><ins>+    loadp VMEntryRecord::m_vm[temp2], vm
+    loadp VMEntryRecord::m_prevTopCallFrame[temp2], temp3
+    storep temp3, VM::topCallFrame[vm]
+    loadp VMEntryRecord::m_prevTopVMEntryFrame[temp2], temp3
+    storep temp3, VM::topVMEntryFrame[vm]
</ins><span class="cx"> 
</span><del>-    checkStackPointerAlignment(temp3, 0xbad0dc04)
</del><ins>+    subp cfr, CalleeRegisterSaveSize, sp
</ins><span class="cx"> 
</span><del>-    if X86_64 or X86_64_WIN
-        pop t5
-    end
-    callToJavaScriptEpilogue()
</del><ins>+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx"> 
</span><span class="cx">     ret
</span><span class="cx"> end
</span><span class="lines">@@ -346,19 +339,19 @@
</span><span class="cx">     loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
</span><span class="cx">     loadp VM::callFrameForThrow[t3], cfr
</span><span class="cx"> 
</span><del>-    # So far, we've unwound the stack to the frame just below the sentinel frame, except
-    # in the case of stack overflow in the first function called from callToJavaScript.
-    # Check if we need to pop to the sentinel frame and do the necessary clean up for
-    # returning to the caller C frame.
-    bpeq CodeBlock[cfr], 1, .handleUncaughtExceptionAlreadyIsSentinel
</del><span class="cx">     loadp CallerFrame[cfr], cfr
</span><del>-.handleUncaughtExceptionAlreadyIsSentinel:
</del><ins>+    vmEntryRecord(cfr, t2)
</ins><span class="cx"> 
</span><del>-    loadp Callee[cfr], t3 # VM
-    loadp ScopeChain[cfr], t5 # previous topCallFrame
</del><ins>+    loadp VMEntryRecord::m_vm[t2], t3
+    loadp VMEntryRecord::m_prevTopCallFrame[t2], t5
</ins><span class="cx">     storep t5, VM::topCallFrame[t3]
</span><ins>+    loadp VMEntryRecord::m_prevTopVMEntryFrame[t2], t5
+    storep t5, VM::topVMEntryFrame[t3]
</ins><span class="cx"> 
</span><del>-    callToJavaScriptEpilogue()
</del><ins>+    subp cfr, CalleeRegisterSaveSize, sp
+
+    popCalleeSaves()
+    functionEpilogue()
</ins><span class="cx">     ret
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> #include &quot;RegExpObject.h&quot;
</span><span class="cx"> #include &quot;SimpleTypedArrayController.h&quot;
</span><span class="cx"> #include &quot;SourceProviderCache.h&quot;
</span><ins>+#include &quot;StackVisitor.h&quot;
</ins><span class="cx"> #include &quot;StrictEvalActivation.h&quot;
</span><span class="cx"> #include &quot;StrongInlines.h&quot;
</span><span class="cx"> #include &quot;StructureInlines.h&quot;
</span><span class="lines">@@ -149,6 +150,7 @@
</span><span class="cx">     , heap(this, heapType)
</span><span class="cx">     , vmType(vmType)
</span><span class="cx">     , clientData(0)
</span><ins>+    , topVMEntryFrame(nullptr)
</ins><span class="cx">     , topCallFrame(CallFrame::noCaller())
</span><span class="cx">     , m_atomicStringTable(vmType == Default ? wtfThreadData().atomicStringTable() : new AtomicStringTable)
</span><span class="cx">     , propertyNames(nullptr)
</span><span class="lines">@@ -593,7 +595,42 @@
</span><span class="cx">     
</span><span class="cx">     exception-&gt;putDirect(*vm, vm-&gt;propertyNames-&gt;message, jsString(vm, message));
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+class FindFirstCallerFrameWithCodeblockFunctor {
+public:
+    FindFirstCallerFrameWithCodeblockFunctor(CallFrame* startCallFrame)
+        : m_startCallFrame(startCallFrame)
+        , m_foundCallFrame(nullptr)
+        , m_foundStartCallFrame(false)
+        , m_index(0)
+    { }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor)
+    {
+        if (!m_foundStartCallFrame &amp;&amp; (visitor-&gt;callFrame() == m_startCallFrame))
+            m_foundStartCallFrame = true;
+
+        if (m_foundStartCallFrame) {
+            if (visitor-&gt;callFrame()-&gt;codeBlock()) {
+                m_foundCallFrame = visitor-&gt;callFrame();
+                return StackVisitor::Done;
+            }
+            m_index++;
+        }
+
+        return StackVisitor::Continue;
+    }
+
+    CallFrame* foundCallFrame() const { return m_foundCallFrame; }
+    unsigned index() const { return m_index; }
+
+private:
+    CallFrame* m_startCallFrame;
+    CallFrame* m_foundCallFrame;
+    bool m_foundStartCallFrame;
+    unsigned m_index;
+};
+
</ins><span class="cx"> JSValue VM::throwException(ExecState* exec, JSValue error)
</span><span class="cx"> {
</span><span class="cx">     if (Options::breakOnThrow()) {
</span><span class="lines">@@ -631,12 +668,11 @@
</span><span class="cx">             exception-&gt;putDirect(*this, Identifier(this, &quot;sourceURL&quot;), jsString(this, stackFrame.sourceURL), ReadOnly | DontDelete);
</span><span class="cx">     }
</span><span class="cx">     if (exception-&gt;isErrorInstance() &amp;&amp; static_cast&lt;ErrorInstance*&gt;(exception)-&gt;appendSourceToMessage()) {
</span><del>-        unsigned stackIndex = 0;
-        CallFrame* callFrame;
-        for (callFrame = exec; callFrame &amp;&amp; !callFrame-&gt;codeBlock(); ) {
-            stackIndex++;
-            callFrame = callFrame-&gt;callerFrameSkippingVMEntrySentinel();
-        }
</del><ins>+        FindFirstCallerFrameWithCodeblockFunctor functor(exec);
+        topCallFrame-&gt;iterate(functor);
+        CallFrame* callFrame = functor.foundCallFrame();
+        unsigned stackIndex = functor.index();
+
</ins><span class="cx">         if (callFrame &amp;&amp; callFrame-&gt;codeBlock()) {
</span><span class="cx">             stackFrame = stackTrace.at(stackIndex);
</span><span class="cx">             bytecodeOffset = stackFrame.bytecodeOffset;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (172664 => 172665)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2014-08-16 01:39:04 UTC (rev 172664)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2014-08-16 01:45:40 UTC (rev 172665)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &quot;ThunkGenerators.h&quot;
</span><span class="cx"> #include &quot;TypedArrayController.h&quot;
</span><span class="cx"> #include &quot;TypeLocation.h&quot;
</span><ins>+#include &quot;VMEntryRecord.h&quot;
</ins><span class="cx"> #include &quot;Watchdog.h&quot;
</span><span class="cx"> #include &quot;Watchpoint.h&quot;
</span><span class="cx"> #include &quot;WeakRandom.h&quot;
</span><span class="lines">@@ -235,6 +236,7 @@
</span><span class="cx"> 
</span><span class="cx">         VMType vmType;
</span><span class="cx">         ClientData* clientData;
</span><ins>+        VMEntryFrame* topVMEntryFrame;
</ins><span class="cx">         ExecState* topCallFrame;
</span><span class="cx">         std::unique_ptr&lt;Watchdog&gt; watchdog;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>