<!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>[187629] branches/jsc-tailcall/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/187629">187629</a></dd>
<dt>Author</dt> <dd>basile_clement@apple.com</dd>
<dt>Date</dt> <dd>2015-07-30 17:43:25 -0700 (Thu, 30 Jul 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>jsc-tailcall: Add enums for type-safety
https://bugs.webkit.org/show_bug.cgi?id=147475

Reviewed by Michael Saboff.

This adds:

 - A CallMode enum to distinguish tail calls from regular calls from construct

 - A FrameAction enum to indicate whether to keep or reuse the call
   frame. It also changes JITOperations.h to correctly use this to tell
   slowPathFor to *not* trash the frame on a regular call (before
   <a href="http://trac.webkit.org/projects/webkit/changeset/187505">r187505</a>, this was statically known in slowPathFor).

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall):
* assembler/CodeLocation.h:
(JSC::CodeLocationNearCall::CodeLocationNearCall):
(JSC::CodeLocationNearCall::callMode):
(JSC::CodeLocationCommon::nearCallAtOffset):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::locationOfNearCall):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::callModeFor):
(JSC::CallLinkInfo::callMode):
(JSC::CallLinkInfo::isTailCall):
(JSC::CallLinkInfo::isVarargs):
* bytecode/CallMode.cpp: Added.
(WTF::printInternal):
* bytecode/CallMode.h: Added.
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::slowPathFor):
(JSC::virtualThunkFor):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreCMakeListstxt">branches/jsc-tailcall/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreChangeLog">branches/jsc-tailcall/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj">branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters">branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreassemblerAbstractMacroAssemblerh">branches/jsc-tailcall/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreassemblerCodeLocationh">branches/jsc-tailcall/Source/JavaScriptCore/assembler/CodeLocation.h</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCoreassemblerLinkBufferh">branches/jsc-tailcall/Source/JavaScriptCore/assembler/LinkBuffer.h</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCorebytecodeCallLinkInfoh">branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallLinkInfo.h</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCorejitJITOperationscpp">branches/jsc-tailcall/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCorejitRepatchcpp">branches/jsc-tailcall/Source/JavaScriptCore/jit/Repatch.cpp</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCorejitThunkGeneratorscpp">branches/jsc-tailcall/Source/JavaScriptCore/jit/ThunkGenerators.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchesjsctailcallSourceJavaScriptCorebytecodeCallModecpp">branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.cpp</a></li>
<li><a href="#branchesjsctailcallSourceJavaScriptCorebytecodeCallModeh">branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesjsctailcallSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/CMakeLists.txt (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/CMakeLists.txt        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/CMakeLists.txt        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx">     bytecode/CallEdge.cpp
</span><span class="cx">     bytecode/CallLinkInfo.cpp
</span><span class="cx">     bytecode/CallLinkStatus.cpp
</span><ins>+    bytecode/CallMode.cpp
</ins><span class="cx">     bytecode/CallVariant.cpp
</span><span class="cx">     bytecode/CodeBlock.cpp
</span><span class="cx">     bytecode/CodeBlockHash.cpp
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/ChangeLog (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/ChangeLog        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/ChangeLog        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -1,5 +1,48 @@
</span><span class="cx"> 2015-07-30  Basile Clement  &lt;basile_clement@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        jsc-tailcall: Add enums for type-safety
+        https://bugs.webkit.org/show_bug.cgi?id=147475
+
+        Reviewed by Michael Saboff.
+
+        This adds:
+
+         - A CallMode enum to distinguish tail calls from regular calls from construct
+
+         - A FrameAction enum to indicate whether to keep or reuse the call
+           frame. It also changes JITOperations.h to correctly use this to tell
+           slowPathFor to *not* trash the frame on a regular call (before
+           r187505, this was statically known in slowPathFor).
+
+        * CMakeLists.txt:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
+        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * assembler/AbstractMacroAssembler.h:
+        (JSC::AbstractMacroAssembler::repatchNearCall):
+        * assembler/CodeLocation.h:
+        (JSC::CodeLocationNearCall::CodeLocationNearCall):
+        (JSC::CodeLocationNearCall::callMode):
+        (JSC::CodeLocationCommon::nearCallAtOffset):
+        * assembler/LinkBuffer.h:
+        (JSC::LinkBuffer::locationOfNearCall):
+        * bytecode/CallLinkInfo.h:
+        (JSC::CallLinkInfo::callModeFor):
+        (JSC::CallLinkInfo::callMode):
+        (JSC::CallLinkInfo::isTailCall):
+        (JSC::CallLinkInfo::isVarargs):
+        * bytecode/CallMode.cpp: Added.
+        (WTF::printInternal):
+        * bytecode/CallMode.h: Added.
+        * jit/JITOperations.cpp:
+        * jit/Repatch.cpp:
+        (JSC::linkPolymorphicCall):
+        * jit/ThunkGenerators.cpp:
+        (JSC::slowPathFor):
+        (JSC::virtualThunkFor):
+
+2015-07-30  Basile Clement  &lt;basile_clement@apple.com&gt;
+
</ins><span class="cx">         jsc-tailcall: Don't waste stack space when arity fixup was performed
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=147447
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxproj"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -317,6 +317,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CallEdge.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CallLinkInfo.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CallLinkStatus.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bytecode\CallMode.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CallVariant.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CodeBlock.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CodeBlockHash.cpp&quot; /&gt;
</span><span class="lines">@@ -967,6 +968,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallEdge.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallLinkInfo.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallLinkStatus.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\bytecode\CallMode.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallReturnOffsetToBytecodeOffset.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallVariant.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CodeBlock.h&quot; /&gt;
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreJavaScriptCorevcxprojJavaScriptCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -156,6 +156,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CallLinkStatus.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;bytecode&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bytecode\CallMode.cpp&quot;&gt;
+      &lt;Filter&gt;bytecode&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bytecode\CodeBlock.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;bytecode&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -1935,6 +1938,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallLinkStatus.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;bytecode&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\bytecode\CallMode.h&quot;&gt;
+      &lt;Filter&gt;bytecode&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\bytecode\CallReturnOffsetToBytecodeOffset.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;bytecode&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -962,6 +962,8 @@
</span><span class="cx">                 5DBB151B131D0B310056AD36 /* testapi.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 14D857740A4696C80032146C /* testapi.js */; };
</span><span class="cx">                 5DBB1525131D0BD70056AD36 /* minidom.js in Copy Support Script */ = {isa = PBXBuildFile; fileRef = 1412110D0A48788700480255 /* minidom.js */; };
</span><span class="cx">                 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */ = {isa = PBXBuildFile; fileRef = F692A8540255597D01FF60F7 /* create_hash_table */; settings = {ATTRIBUTES = (); }; };
</span><ins>+                627673231B680C1E00FD9F2E /* CallMode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 627673211B680C1E00FD9F2E /* CallMode.cpp */; };
+                627673241B680C1E00FD9F2E /* CallMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 627673221B680C1E00FD9F2E /* CallMode.h */; };
</ins><span class="cx">                 62D2D38F1ADF103F000206C1 /* FunctionRareData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */; };
</span><span class="cx">                 62D2D3901ADF103F000206C1 /* FunctionRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 62D2D38E1ADF103F000206C1 /* FunctionRareData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 62F2AA371B0BEDE300610C7A /* DFGLazyNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 62A9A29E1B0BED4800BD54CA /* DFGLazyNode.cpp */; };
</span><span class="lines">@@ -2676,6 +2678,8 @@
</span><span class="cx">                 5DAFD6CB146B686300FBEFB4 /* JSC.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = JSC.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DDDF44614FEE72200B4FB4D /* LLIntDesiredOffsets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntDesiredOffsets.h; path = LLIntOffsets/LLIntDesiredOffsets.h; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 5DE3D0F40DD8DDFB00468714 /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                627673211B680C1E00FD9F2E /* CallMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallMode.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                627673221B680C1E00FD9F2E /* CallMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallMode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 62A9A29E1B0BED4800BD54CA /* DFGLazyNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGLazyNode.cpp; path = dfg/DFGLazyNode.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 62A9A29F1B0BED4800BD54CA /* DFGLazyNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGLazyNode.h; path = dfg/DFGLazyNode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 62D2D38D1ADF103F000206C1 /* FunctionRareData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionRareData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5257,6 +5261,8 @@
</span><span class="cx">                                 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */,
</span><span class="cx">                                 0F93329314CA7DC10085F3C6 /* CallLinkStatus.cpp */,
</span><span class="cx">                                 0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */,
</span><ins>+                                627673211B680C1E00FD9F2E /* CallMode.cpp */,
+                                627673221B680C1E00FD9F2E /* CallMode.h */,
</ins><span class="cx">                                 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */,
</span><span class="cx">                                 0F3B7E2419A11B8000D9BC56 /* CallVariant.cpp */,
</span><span class="cx">                                 0F3B7E2519A11B8000D9BC56 /* CallVariant.h */,
</span><span class="lines">@@ -5278,6 +5284,8 @@
</span><span class="cx">                                 0F426A4A1460CD6B00131F8F /* DataFormat.h */,
</span><span class="cx">                                 0FC712DC17CD8778008CC93C /* DeferredCompilationCallback.cpp */,
</span><span class="cx">                                 0FC712DD17CD8778008CC93C /* DeferredCompilationCallback.h */,
</span><ins>+                                FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */,
+                                FE5068641AE246390009DAB7 /* DeferredSourceDump.h */,
</ins><span class="cx">                                 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */,
</span><span class="cx">                                 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */,
</span><span class="cx">                                 969A07920ED1D3AE00F1F681 /* EvalCodeCache.h */,
</span><span class="lines">@@ -5325,8 +5333,6 @@
</span><span class="cx">                                 0FF60AC016740F8100029779 /* ReduceWhitespace.h */,
</span><span class="cx">                                 1429D8830ED21C3D00B89619 /* SamplingTool.cpp */,
</span><span class="cx">                                 1429D8840ED21C3D00B89619 /* SamplingTool.h */,
</span><del>-                                FE5068661AE25E280009DAB7 /* DeferredSourceDump.cpp */,
-                                FE5068641AE246390009DAB7 /* DeferredSourceDump.h */,
</del><span class="cx">                                 0F5541AF1613C1FB00CE3E25 /* SpecialPointer.cpp */,
</span><span class="cx">                                 0F5541B01613C1FB00CE3E25 /* SpecialPointer.h */,
</span><span class="cx">                                 0FD82E84141F3FDA00179C94 /* SpeculatedType.cpp */,
</span><span class="lines">@@ -5865,6 +5871,7 @@
</span><span class="cx">                                 86EC9DD01328DF82002B2AD7 /* DFGOperations.h in Headers */,
</span><span class="cx">                                 A7D89CFE17A0B8CC00773AD8 /* DFGOSRAvailabilityAnalysisPhase.h in Headers */,
</span><span class="cx">                                 0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
</span><ins>+                                627673241B680C1E00FD9F2E /* CallMode.h in Headers */,
</ins><span class="cx">                                 0FD8A32617D51F5700CA2C40 /* DFGOSREntrypointCreationPhase.h in Headers */,
</span><span class="cx">                                 62F2AA381B0BEDE300610C7A /* DFGLazyNode.h in Headers */,
</span><span class="cx">                                 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */,
</span><span class="lines">@@ -7567,6 +7574,7 @@
</span><span class="cx">                                 0F2D4DEF19832DD3007D4B19 /* TypeSet.cpp in Sources */,
</span><span class="cx">                                 9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */,
</span><span class="cx">                                 BCDE3B430E6C832D001453A7 /* Structure.cpp in Sources */,
</span><ins>+                                627673231B680C1E00FD9F2E /* CallMode.cpp in Sources */,
</ins><span class="cx">                                 7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */,
</span><span class="cx">                                 C2F0F2D116BAEEE900187C19 /* StructureRareData.cpp in Sources */,
</span><span class="cx">                                 7013CA8B1B491A9400CAE613 /* JSJob.cpp in Sources */,
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreassemblerAbstractMacroAssemblerh"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -1154,10 +1154,10 @@
</span><span class="cx">     static void repatchNearCall(CodeLocationNearCall nearCall, CodeLocationLabel destination)
</span><span class="cx">     {
</span><span class="cx">         switch (nearCall.callMode()) {
</span><del>-        case CallMode::Tail:
</del><ins>+        case NearCallMode::Tail:
</ins><span class="cx">             AssemblerType::relinkJump(nearCall.dataLocation(), destination.executableAddress());
</span><span class="cx">             return;
</span><del>-        case CallMode::Regular:
</del><ins>+        case NearCallMode::Regular:
</ins><span class="cx">             AssemblerType::relinkCall(nearCall.dataLocation(), destination.executableAddress());
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreassemblerCodeLocationh"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/assembler/CodeLocation.h (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/assembler/CodeLocation.h        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/assembler/CodeLocation.h        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-enum CallMode { Regular, Tail };
</del><ins>+enum NearCallMode { Regular, Tail };
</ins><span class="cx"> 
</span><span class="cx"> class CodeLocationInstruction;
</span><span class="cx"> class CodeLocationLabel;
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     CodeLocationLabel labelAtOffset(int offset);
</span><span class="cx">     CodeLocationJump jumpAtOffset(int offset);
</span><span class="cx">     CodeLocationCall callAtOffset(int offset);
</span><del>-    CodeLocationNearCall nearCallAtOffset(int offset, CallMode);
</del><ins>+    CodeLocationNearCall nearCallAtOffset(int offset, NearCallMode);
</ins><span class="cx">     CodeLocationDataLabelPtr dataLabelPtrAtOffset(int offset);
</span><span class="cx">     CodeLocationDataLabel32 dataLabel32AtOffset(int offset);
</span><span class="cx">     CodeLocationDataLabelCompact dataLabelCompactAtOffset(int offset);
</span><span class="lines">@@ -117,13 +117,13 @@
</span><span class="cx"> class CodeLocationNearCall : public CodeLocationCommon {
</span><span class="cx"> public:
</span><span class="cx">     CodeLocationNearCall() {}
</span><del>-    explicit CodeLocationNearCall(MacroAssemblerCodePtr location, CallMode callMode)
</del><ins>+    explicit CodeLocationNearCall(MacroAssemblerCodePtr location, NearCallMode callMode)
</ins><span class="cx">         : CodeLocationCommon(location), m_callMode(callMode) {}
</span><del>-    explicit CodeLocationNearCall(void* location, CallMode callMode)
</del><ins>+    explicit CodeLocationNearCall(void* location, NearCallMode callMode)
</ins><span class="cx">         : CodeLocationCommon(MacroAssemblerCodePtr(location)), m_callMode(callMode) {}
</span><del>-    CallMode callMode() { return m_callMode; }
</del><ins>+    NearCallMode callMode() { return m_callMode; }
</ins><span class="cx"> private:
</span><del>-    CallMode m_callMode = CallMode::Regular;
</del><ins>+    NearCallMode m_callMode = NearCallMode::Regular;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class CodeLocationDataLabel32 : public CodeLocationCommon {
</span><span class="lines">@@ -186,7 +186,7 @@
</span><span class="cx">     return CodeLocationCall(reinterpret_cast&lt;char*&gt;(dataLocation()) + offset);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline CodeLocationNearCall CodeLocationCommon::nearCallAtOffset(int offset, CallMode callMode)
</del><ins>+inline CodeLocationNearCall CodeLocationCommon::nearCallAtOffset(int offset, NearCallMode callMode)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_VALID_CODE_OFFSET(offset);
</span><span class="cx">     return CodeLocationNearCall(reinterpret_cast&lt;char*&gt;(dataLocation()) + offset, callMode);
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCoreassemblerLinkBufferh"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/assembler/LinkBuffer.h (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/assembler/LinkBuffer.h        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/assembler/LinkBuffer.h        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">         ASSERT(call.isFlagSet(Call::Linkable));
</span><span class="cx">         ASSERT(call.isFlagSet(Call::Near));
</span><span class="cx">         return CodeLocationNearCall(MacroAssembler::getLinkerAddress(code(), applyOffset(call.m_label)),
</span><del>-            call.isFlagSet(Call::Tail) ? CallMode::Tail : CallMode::Regular);
</del><ins>+            call.isFlagSet(Call::Tail) ? NearCallMode::Tail : NearCallMode::Regular);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     CodeLocationLabel locationOf(PatchableJump jump)
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorebytecodeCallLinkInfoh"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallLinkInfo.h (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallLinkInfo.h        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallLinkInfo.h        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef CallLinkInfo_h
</span><span class="cx"> #define CallLinkInfo_h
</span><span class="cx"> 
</span><ins>+#include &quot;CallMode.h&quot;
</ins><span class="cx"> #include &quot;CodeLocation.h&quot;
</span><span class="cx"> #include &quot;CodeSpecializationKind.h&quot;
</span><span class="cx"> #include &quot;JITWriteBarrier.h&quot;
</span><span class="lines">@@ -73,18 +74,6 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static bool isTailCallType(CallType callType)
-    {
-        switch (callType) {
-        case TailCall:
-        case TailCallVarargs:
-            return true;
-
-        default:
-            return false;
-        }
-    }
-    
</del><span class="cx">     CallLinkInfo()
</span><span class="cx">         : m_registerPreservationMode(static_cast&lt;unsigned&gt;(RegisterPreservationNotRequired))
</span><span class="cx">         , m_hasSeenShouldRepatch(false)
</span><span class="lines">@@ -113,6 +102,37 @@
</span><span class="cx">         return specializationKindFor(static_cast&lt;CallType&gt;(m_callType));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    static CallMode callModeFor(CallType callType)
+    {
+        switch (callType) {
+        case Call:
+        case CallVarargs:
+            return CallMode::Regular;
+        case TailCall:
+        case TailCallVarargs:
+            return CallMode::Tail;
+        case Construct:
+        case ConstructVarargs:
+            return CallMode::Construct;
+        case None:
+            RELEASE_ASSERT_NOT_REACHED();
+        }
+    }
+    CallMode callMode() const
+    {
+        return callModeFor(static_cast&lt;CallType&gt;(m_callType));
+    }
+
+    bool isTailCall() const
+    {
+        return callMode() == CallMode::Tail;
+    }
+
+    bool isVarargs() const
+    {
+        return isVarargsCallType(static_cast&lt;CallType&gt;(m_callType));
+    }
+
</ins><span class="cx">     RegisterPreservationMode registerPreservationMode() const
</span><span class="cx">     {
</span><span class="cx">         return static_cast&lt;RegisterPreservationMode&gt;(m_registerPreservationMode);
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorebytecodeCallModecpp"></a>
<div class="addfile"><h4>Added: branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.cpp (0 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.cpp                                (rev 0)
+++ branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.cpp        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2015 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. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;CallMode.h&quot;
+
+#include &lt;wtf/PrintStream.h&gt;
+
+namespace WTF {
+
+void printInternal(PrintStream&amp; out, JSC::CallMode callMode)
+{
+    switch (callMode) {
+    case JSC::CallMode::Tail:
+        out.print(&quot;TailCall&quot;);
+        return;
+    case JSC::CallMode::Regular:
+        out.print(&quot;Call&quot;);
+        return;
+    case JSC::CallMode::Construct:
+        out.print(&quot;Construct&quot;);
+        return;
+    }
+    RELEASE_ASSERT_NOT_REACHED();
+}
+
+} // namespace WTF
</ins></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorebytecodeCallModeh"></a>
<div class="addfile"><h4>Added: branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.h (0 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.h                                (rev 0)
+++ branches/jsc-tailcall/Source/JavaScriptCore/bytecode/CallMode.h        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2015 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 CallMode_h
+#define CallMode_h
+
+namespace JSC {
+
+enum class CallMode { Regular, Tail, Construct };
+
+enum FrameAction { KeepTheFrame = 0, ReuseTheFrame };
+
+} // namespace JSC
+
+namespace WTF {
+
+class PrintStream;
+void printInternal(PrintStream&amp;, JSC::CallMode);
+
+} // namespace WTF
+
+#endif // CallMode_h
+
</ins></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/jit/JITOperations.cpp (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/jit/JITOperations.cpp        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/jit/JITOperations.cpp        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -705,14 +705,14 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static SlowPathReturnType handleHostCall(ExecState* execCallee, JSValue callee, CodeSpecializationKind kind)
</del><ins>+static SlowPathReturnType handleHostCall(ExecState* execCallee, JSValue callee, CallLinkInfo* callLinkInfo)
</ins><span class="cx"> {
</span><span class="cx">     ExecState* exec = execCallee-&gt;callerFrame();
</span><span class="cx">     VM* vm = &amp;exec-&gt;vm();
</span><span class="cx"> 
</span><span class="cx">     execCallee-&gt;setCodeBlock(0);
</span><span class="cx"> 
</span><del>-    if (kind == CodeForCall) {
</del><ins>+    if (callLinkInfo-&gt;specializationKind() == CodeForCall) {
</ins><span class="cx">         CallData callData;
</span><span class="cx">         CallType callType = getCallData(callee, callData);
</span><span class="cx">     
</span><span class="lines">@@ -722,18 +722,25 @@
</span><span class="cx">             NativeCallFrameTracer tracer(vm, execCallee);
</span><span class="cx">             execCallee-&gt;setCallee(asObject(callee));
</span><span class="cx">             vm-&gt;hostCallReturnValue = JSValue::decode(callData.native.function(execCallee));
</span><del>-            if (vm-&gt;exception())
-                return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+            if (vm-&gt;exception()) {
+                return encodeResult(
+                    vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                    reinterpret_cast&lt;void*&gt;(KeepTheFrame));
+            }
</ins><span class="cx"> 
</span><del>-            return encodeResult(bitwise_cast&lt;void*&gt;(getHostCallReturnValue), reinterpret_cast&lt;void*&gt;(1));
</del><ins>+            return encodeResult(
+                bitwise_cast&lt;void*&gt;(getHostCallReturnValue),
+                reinterpret_cast&lt;void*&gt;(callLinkInfo-&gt;callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
</ins><span class="cx">         }
</span><span class="cx">     
</span><span class="cx">         ASSERT(callType == CallTypeNone);
</span><span class="cx">         exec-&gt;vm().throwException(exec, createNotAFunctionError(exec, callee));
</span><del>-        return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+        return encodeResult(
+            vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+            reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(kind == CodeForConstruct);
</del><ins>+    ASSERT(callLinkInfo-&gt;specializationKind() == CodeForConstruct);
</ins><span class="cx">     
</span><span class="cx">     ConstructData constructData;
</span><span class="cx">     ConstructType constructType = getConstructData(callee, constructData);
</span><span class="lines">@@ -744,15 +751,20 @@
</span><span class="cx">         NativeCallFrameTracer tracer(vm, execCallee);
</span><span class="cx">         execCallee-&gt;setCallee(asObject(callee));
</span><span class="cx">         vm-&gt;hostCallReturnValue = JSValue::decode(constructData.native.function(execCallee));
</span><del>-        if (vm-&gt;exception())
-            return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+        if (vm-&gt;exception()) {
+            return encodeResult(
+                vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                reinterpret_cast&lt;void*&gt;(KeepTheFrame));
+        }
</ins><span class="cx"> 
</span><del>-        return encodeResult(bitwise_cast&lt;void*&gt;(getHostCallReturnValue), reinterpret_cast&lt;void*&gt;(1));
</del><ins>+        return encodeResult(bitwise_cast&lt;void*&gt;(getHostCallReturnValue), reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     ASSERT(constructType == ConstructTypeNone);
</span><span class="cx">     exec-&gt;vm().throwException(exec, createNotAConstructorError(exec, callee));
</span><del>-    return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+    return encodeResult(
+        vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+        reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SlowPathReturnType JIT_OPERATION operationLinkCall(ExecState* execCallee, CallLinkInfo* callLinkInfo)
</span><span class="lines">@@ -768,7 +780,7 @@
</span><span class="cx">         // FIXME: We should cache these kinds of calls. They can be common and currently they are
</span><span class="cx">         // expensive.
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=144458
</span><del>-        return handleHostCall(execCallee, calleeAsValue, kind);
</del><ins>+        return handleHostCall(execCallee, calleeAsValue, callLinkInfo);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSFunction* callee = jsCast&lt;JSFunction*&gt;(calleeAsFunctionCell);
</span><span class="lines">@@ -784,17 +796,21 @@
</span><span class="cx"> 
</span><span class="cx">         if (!isCall(kind) &amp;&amp; functionExecutable-&gt;isBuiltinFunction()) {
</span><span class="cx">             exec-&gt;vm().throwException(exec, createNotAConstructorError(exec, callee));
</span><del>-            return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+            return encodeResult(
+                vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         JSObject* error = functionExecutable-&gt;prepareForExecution(execCallee, callee, scope, kind);
</span><span class="cx">         if (error) {
</span><span class="cx">             exec-&gt;vm().throwException(exec, error);
</span><del>-            return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+            return encodeResult(
+                vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">         }
</span><span class="cx">         codeBlock = functionExecutable-&gt;codeBlockFor(kind);
</span><span class="cx">         ArityCheckMode arity;
</span><del>-        if (execCallee-&gt;argumentCountIncludingThis() &lt; static_cast&lt;size_t&gt;(codeBlock-&gt;numParameters()) || CallLinkInfo::isVarargsCallType(callLinkInfo-&gt;callType()))
</del><ins>+        if (execCallee-&gt;argumentCountIncludingThis() &lt; static_cast&lt;size_t&gt;(codeBlock-&gt;numParameters()) || callLinkInfo-&gt;isVarargs())
</ins><span class="cx">             arity = MustCheckArity;
</span><span class="cx">         else
</span><span class="cx">             arity = ArityCheckNotRequired;
</span><span class="lines">@@ -805,7 +821,7 @@
</span><span class="cx">     else
</span><span class="cx">         linkFor(execCallee, *callLinkInfo, codeBlock, callee, codePtr);
</span><span class="cx">     
</span><del>-    return encodeResult(codePtr.executableAddress(), reinterpret_cast&lt;void*&gt;(1));
</del><ins>+    return encodeResult(codePtr.executableAddress(), reinterpret_cast&lt;void*&gt;(callLinkInfo-&gt;callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline SlowPathReturnType virtualForWithFunction(
</span><span class="lines">@@ -819,7 +835,7 @@
</span><span class="cx">     JSValue calleeAsValue = execCallee-&gt;calleeAsValue();
</span><span class="cx">     calleeAsFunctionCell = getJSFunction(calleeAsValue);
</span><span class="cx">     if (UNLIKELY(!calleeAsFunctionCell))
</span><del>-        return handleHostCall(execCallee, calleeAsValue, kind);
</del><ins>+        return handleHostCall(execCallee, calleeAsValue, callLinkInfo);
</ins><span class="cx">     
</span><span class="cx">     JSFunction* function = jsCast&lt;JSFunction*&gt;(calleeAsFunctionCell);
</span><span class="cx">     JSScope* scope = function-&gt;scopeUnchecked();
</span><span class="lines">@@ -829,18 +845,22 @@
</span><span class="cx"> 
</span><span class="cx">         if (!isCall(kind) &amp;&amp; functionExecutable-&gt;isBuiltinFunction()) {
</span><span class="cx">             exec-&gt;vm().throwException(exec, createNotAConstructorError(exec, function));
</span><del>-            return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+            return encodeResult(
+                vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         JSObject* error = functionExecutable-&gt;prepareForExecution(execCallee, function, scope, kind);
</span><span class="cx">         if (error) {
</span><span class="cx">             exec-&gt;vm().throwException(exec, error);
</span><del>-            return encodeResult(vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(), reinterpret_cast&lt;void*&gt;(0));
</del><ins>+            return encodeResult(
+                vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
+                reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return encodeResult(executable-&gt;entrypointFor(
</span><span class="cx">         *vm, kind, MustCheckArity, callLinkInfo-&gt;registerPreservationMode()).executableAddress(),
</span><del>-        reinterpret_cast&lt;void*&gt;(1));
</del><ins>+        reinterpret_cast&lt;void*&gt;(callLinkInfo-&gt;callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SlowPathReturnType JIT_OPERATION operationLinkPolymorphicCall(ExecState* execCallee, CallLinkInfo* callLinkInfo)
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorejitRepatchcpp"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/jit/Repatch.cpp (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/jit/Repatch.cpp        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/jit/Repatch.cpp        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -1757,7 +1757,7 @@
</span><span class="cx">             
</span><span class="cx">             // If we cannot handle a callee, assume that it's better for this whole thing to be a
</span><span class="cx">             // virtual call.
</span><del>-            if (exec-&gt;argumentCountIncludingThis() &lt; static_cast&lt;size_t&gt;(codeBlock-&gt;numParameters()) || CallLinkInfo::isVarargsCallType(callLinkInfo.callType())) {
</del><ins>+            if (exec-&gt;argumentCountIncludingThis() &lt; static_cast&lt;size_t&gt;(codeBlock-&gt;numParameters()) || callLinkInfo.isVarargs()) {
</ins><span class="cx">                 linkVirtualFor(exec, callLinkInfo);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="lines">@@ -1880,7 +1880,7 @@
</span><span class="cx">                 CCallHelpers::TrustedImm32(1),
</span><span class="cx">                 CCallHelpers::Address(fastCountsBaseGPR, caseIndex * sizeof(uint32_t)));
</span><span class="cx">         }
</span><del>-        if (CallLinkInfo::isTailCallType(callLinkInfo.callType())) {
</del><ins>+        if (callLinkInfo.isTailCall()) {
</ins><span class="cx">             stubJit.prepareForTailCallSlow();
</span><span class="cx">             calls[caseIndex].call = stubJit.nearTailCall();
</span><span class="cx">         } else
</span></span></pre></div>
<a id="branchesjsctailcallSourceJavaScriptCorejitThunkGeneratorscpp"></a>
<div class="modfile"><h4>Modified: branches/jsc-tailcall/Source/JavaScriptCore/jit/ThunkGenerators.cpp (187628 => 187629)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsc-tailcall/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2015-07-31 00:37:38 UTC (rev 187628)
+++ branches/jsc-tailcall/Source/JavaScriptCore/jit/ThunkGenerators.cpp        2015-07-31 00:43:25 UTC (rev 187629)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx">     emitPointerValidation(jit, GPRInfo::returnValueGPR);
</span><span class="cx">     jit.emitFunctionEpilogue();
</span><span class="cx"> 
</span><ins>+    RELEASE_ASSERT(reinterpret_cast&lt;void*&gt;(KeepTheFrame) == reinterpret_cast&lt;void*&gt;(0));
</ins><span class="cx">     CCallHelpers::Jump doNotTrash = jit.branchTestPtr(CCallHelpers::Zero, GPRInfo::returnValueGPR2);
</span><span class="cx"> 
</span><span class="cx">     jit.preserveReturnAddressAfterCall(GPRInfo::nonPreservedNonReturnGPR);
</span><span class="lines">@@ -191,7 +192,7 @@
</span><span class="cx">     
</span><span class="cx">     // Make a tail call. This will return back to JIT code.
</span><span class="cx">     emitPointerValidation(jit, GPRInfo::regT4);
</span><del>-    if (CallLinkInfo::isTailCallType(callLinkInfo.callType())) {
</del><ins>+    if (callLinkInfo.isTailCall()) {
</ins><span class="cx">         jit.preserveReturnAddressAfterCall(GPRInfo::regT0);
</span><span class="cx">         jit.prepareForTailCallSlow(GPRInfo::regT4);
</span><span class="cx">     }
</span><span class="lines">@@ -205,9 +206,8 @@
</span><span class="cx">     LinkBuffer patchBuffer(*vm, jit, GLOBAL_THUNK_ID);
</span><span class="cx">     return FINALIZE_CODE(
</span><span class="cx">         patchBuffer,
</span><del>-        (&quot;Virtual %s%s slow path thunk at CodePtr(%p)&quot;,
-        callLinkInfo.specializationKind() == CodeForCall ? &quot;call&quot; : &quot;construct&quot;,
-        callLinkInfo.registerPreservationMode() == MustPreserveRegisters ? &quot; that preserves registers&quot; : &quot;&quot;,
</del><ins>+        (&quot;Virtual %s slow path thunk at CodePtr(%p)&quot;,
+        callLinkInfo.callMode() == CallMode::Regular ? &quot;call&quot; : callLinkInfo.callMode() == CallMode::Tail ? &quot;tail call&quot; : &quot;construct&quot;,
</ins><span class="cx">         callLinkInfo.callReturnLocation().dataLocation()));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>