<!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>[165129] 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/165129">165129</a></dd>
<dt>Author</dt> <dd>fpizlo@apple.com</dd>
<dt>Date</dt> <dd>2014-03-05 14:01:57 -0800 (Wed, 05 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>More FTL ARM fixes
https://bugs.webkit.org/show_bug.cgi?id=129755

Reviewed by Geoffrey Garen.
        
- Be more defensive about inline caches that have degenerate chains.
        
- Temporarily switch to allocating all MCJIT memory in the executable pool on non-x86
  platforms. The bug tracking the real fix is: https://bugs.webkit.org/show_bug.cgi?id=129756
        
- Don't even emit intrinsic declarations on non-x86 platforms.
        
- More debug printing support.
        
- Don't use vmCall() in the prologue. This should have crashed on all platforms all the time
  but somehow it gets lucky on x86.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::appendVariant):
(JSC::GetByIdStatus::computeForChain):
(JSC::GetByIdStatus::computeForStubInfo):
* bytecode/GetByIdStatus.h:
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::appendVariant):
(JSC::PutByIdStatus::computeForStubInfo):
* bytecode/PutByIdStatus.h:
* bytecode/StructureSet.h:
(JSC::StructureSet::overlaps):
* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
* ftl/FTLDataSection.cpp:
(JSC::FTL::DataSection::DataSection):
(JSC::FTL::DataSection::~DataSection):
* ftl/FTLDataSection.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):
* ftl/FTLOutput.h:
(JSC::FTL::Output::doubleSin):
(JSC::FTL::Output::doubleCos):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContext):
* runtime/JSCell.h:
(JSC::JSCell::structureID):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeGetByIdStatush">trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePutByIdStatuscpp">trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodePutByIdStatush">trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeStructureSeth">trunk/Source/JavaScriptCore/bytecode/StructureSet.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLCompilecpp">trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLDataSectioncpp">trunk/Source/JavaScriptCore/ftl/FTLDataSection.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLDataSectionh">trunk/Source/JavaScriptCore/ftl/FTLDataSection.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp">trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreftlFTLOutputh">trunk/Source/JavaScriptCore/ftl/FTLOutput.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCJSValuecpp">trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSCellh">trunk/Source/JavaScriptCore/runtime/JSCell.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2014-03-05  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+        More FTL ARM fixes
+        https://bugs.webkit.org/show_bug.cgi?id=129755
+
+        Reviewed by Geoffrey Garen.
+        
+        - Be more defensive about inline caches that have degenerate chains.
+        
+        - Temporarily switch to allocating all MCJIT memory in the executable pool on non-x86
+          platforms. The bug tracking the real fix is: https://bugs.webkit.org/show_bug.cgi?id=129756
+        
+        - Don't even emit intrinsic declarations on non-x86 platforms.
+        
+        - More debug printing support.
+        
+        - Don't use vmCall() in the prologue. This should have crashed on all platforms all the time
+          but somehow it gets lucky on x86.
+
+        * bytecode/GetByIdStatus.cpp:
+        (JSC::GetByIdStatus::appendVariant):
+        (JSC::GetByIdStatus::computeForChain):
+        (JSC::GetByIdStatus::computeForStubInfo):
+        * bytecode/GetByIdStatus.h:
+        * bytecode/PutByIdStatus.cpp:
+        (JSC::PutByIdStatus::appendVariant):
+        (JSC::PutByIdStatus::computeForStubInfo):
+        * bytecode/PutByIdStatus.h:
+        * bytecode/StructureSet.h:
+        (JSC::StructureSet::overlaps):
+        * ftl/FTLCompile.cpp:
+        (JSC::FTL::mmAllocateDataSection):
+        * ftl/FTLDataSection.cpp:
+        (JSC::FTL::DataSection::DataSection):
+        (JSC::FTL::DataSection::~DataSection):
+        * ftl/FTLDataSection.h:
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::lower):
+        * ftl/FTLOutput.h:
+        (JSC::FTL::Output::doubleSin):
+        (JSC::FTL::Output::doubleCos):
+        * runtime/JSCJSValue.cpp:
+        (JSC::JSValue::dumpInContext):
+        * runtime/JSCell.h:
+        (JSC::JSCell::structureID):
+
</ins><span class="cx"> 2014-03-05  peavo@outlook.com  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win32][LLINT] Crash when running JSC stress tests.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeGetByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -35,6 +35,16 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+bool GetByIdStatus::appendVariant(const GetByIdVariant&amp; variant)
+{
+    for (unsigned i = 0; i &lt; m_variants.size(); ++i) {
+        if (m_variants[i].structureSet().overlaps(variant.structureSet()))
+            return false;
+    }
+    m_variants.append(variant);
+    return true;
+}
+
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx"> bool GetByIdStatus::hasExitSite(const ConcurrentJITLocker&amp; locker, CodeBlock* profiledBlock, unsigned bytecodeIndex, ExitingJITType jitType)
</span><span class="cx"> {
</span><span class="lines">@@ -119,9 +129,7 @@
</span><span class="cx">     if (!isValidOffset(offset))
</span><span class="cx">         return false;
</span><span class="cx">     
</span><del>-    m_variants.append(
-        GetByIdVariant(StructureSet(chain-&gt;head()), offset, specificValue, chain));
-    return true;
</del><ins>+    return appendVariant(GetByIdVariant(StructureSet(chain-&gt;head()), offset, specificValue, chain));
</ins><span class="cx"> #else // ENABLE(JIT)
</span><span class="cx">     UNUSED_PARAM(profiledBlock);
</span><span class="cx">     UNUSED_PARAM(uid);
</span><span class="lines">@@ -202,7 +210,7 @@
</span><span class="cx">         
</span><span class="cx">         variant.m_structureSet.add(structure);
</span><span class="cx">         variant.m_specificValue = JSValue(specificValue);
</span><del>-        result.m_variants.append(variant);
</del><ins>+        result.appendVariant(variant);
</ins><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="lines">@@ -256,8 +264,8 @@
</span><span class="cx">             if (found)
</span><span class="cx">                 continue;
</span><span class="cx">             
</span><del>-            result.m_variants.append(
-                GetByIdVariant(StructureSet(structure), myOffset, specificValue));
</del><ins>+            if (!result.appendVariant(GetByIdVariant(StructureSet(structure), myOffset, specificValue)))
+                return GetByIdStatus(TakesSlowPath, true);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         return result;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeGetByIdStatush"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -99,6 +99,8 @@
</span><span class="cx">     bool computeForChain(CodeBlock*, StringImpl* uid, PassRefPtr&lt;IntendedStructureChain&gt;);
</span><span class="cx">     static GetByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, StringImpl* uid);
</span><span class="cx">     
</span><ins>+    bool appendVariant(const GetByIdVariant&amp;);
+    
</ins><span class="cx">     State m_state;
</span><span class="cx">     Vector&lt;GetByIdVariant, 1&gt; m_variants;
</span><span class="cx">     bool m_wasSeenInJIT;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePutByIdStatuscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -37,6 +37,16 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><ins>+bool PutByIdStatus::appendVariant(const PutByIdVariant&amp; variant)
+{
+    for (unsigned i = 0; i &lt; m_variants.size(); ++i) {
+        if (m_variants[i].oldStructure() == variant.oldStructure())
+            return false;
+    }
+    m_variants.append(variant);
+    return true;
+}
+
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><span class="cx"> bool PutByIdStatus::hasExitSite(const ConcurrentJITLocker&amp; locker, CodeBlock* profiledBlock, unsigned bytecodeIndex, ExitingJITType exitType)
</span><span class="cx"> {
</span><span class="lines">@@ -176,7 +186,8 @@
</span><span class="cx">                 PropertyOffset offset = structure-&gt;getConcurrently(*profiledBlock-&gt;vm(), uid);
</span><span class="cx">                 if (!isValidOffset(offset))
</span><span class="cx">                     return PutByIdStatus(TakesSlowPath);
</span><del>-                result.m_variants.append(PutByIdVariant::replace(structure, offset));
</del><ins>+                if (!result.appendVariant(PutByIdVariant::replace(structure, offset)))
+                    return PutByIdStatus(TakesSlowPath);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">                 
</span><span class="lines">@@ -185,11 +196,13 @@
</span><span class="cx">                     access.newStructure()-&gt;getConcurrently(*profiledBlock-&gt;vm(), uid);
</span><span class="cx">                 if (!isValidOffset(offset))
</span><span class="cx">                     return PutByIdStatus(TakesSlowPath);
</span><del>-                result.m_variants.append(PutByIdVariant::transition(
</del><ins>+                bool ok = result.appendVariant(PutByIdVariant::transition(
</ins><span class="cx">                     access.oldStructure(), access.newStructure(),
</span><span class="cx">                     access.chain() ? adoptRef(new IntendedStructureChain(
</span><span class="cx">                         profiledBlock, access.oldStructure(), access.chain())) : 0,
</span><span class="cx">                     offset));
</span><ins>+                if (!ok)
+                    return PutByIdStatus(TakesSlowPath);
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodePutByIdStatush"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -95,6 +95,8 @@
</span><span class="cx"> #endif
</span><span class="cx">     static PutByIdStatus computeFromLLInt(CodeBlock*, unsigned bytecodeIndex, StringImpl* uid);
</span><span class="cx">     
</span><ins>+    bool appendVariant(const PutByIdVariant&amp;);
+    
</ins><span class="cx">     State m_state;
</span><span class="cx">     Vector&lt;PutByIdVariant, 1&gt; m_variants;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeStructureSeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/StructureSet.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/StructureSet.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/bytecode/StructureSet.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -115,6 +115,15 @@
</span><span class="cx">         return other.isSubsetOf(*this);
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    bool overlaps(const StructureSet&amp; other) const
+    {
+        for (size_t i = 0; i &lt; m_structures.size(); ++i) {
+            if (other.contains(m_structures[i]))
+                return true;
+        }
+        return false;
+    }
+    
</ins><span class="cx">     size_t size() const { return m_structures.size(); }
</span><span class="cx">     
</span><span class="cx">     // Call this if you know that the structure set must consist of exactly
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLCompilecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -81,7 +81,8 @@
</span><span class="cx"> 
</span><span class="cx">     State&amp; state = *static_cast&lt;State*&gt;(opaqueState);
</span><span class="cx">     
</span><del>-    RefPtr&lt;DataSection&gt; section = adoptRef(new DataSection(size, alignment));
</del><ins>+    RefPtr&lt;DataSection&gt; section = adoptRef(new DataSection(
+        state.graph.m_vm, state.graph.m_codeBlock, size, alignment));
</ins><span class="cx">     
</span><span class="cx">     if (!strcmp(sectionName, &quot;__llvm_stackmaps&quot;))
</span><span class="cx">         state.stackmapsSection = section;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLDataSectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLDataSection.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLDataSection.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ftl/FTLDataSection.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -34,9 +34,30 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace FTL {
</span><span class="cx"> 
</span><del>-DataSection::DataSection(size_t size, unsigned alignment)
</del><ins>+#if CPU(ARM64)
+// FIXME: We should undo this once we fix relocation issues.
+// https://bugs.webkit.org/show_bug.cgi?id=129756
+static const bool useExecutableMemory = true;
+#else
+static const bool useExecutableMemory = false;
+#endif
+
+DataSection::DataSection(VM&amp; vm, CodeBlock* codeBlock, size_t size, unsigned alignment)
</ins><span class="cx">     : m_size(size)
</span><span class="cx"> {
</span><ins>+    if (useExecutableMemory) {
+        RELEASE_ASSERT(alignment &lt; jitAllocationGranule);
+        
+        RefPtr&lt;ExecutableMemoryHandle&gt; result =
+            vm.executableAllocator.allocate(
+                vm, size, codeBlock, JITCompilationMustSucceed);
+        m_base = result-&gt;start();
+        m_size = result-&gt;sizeInBytes();
+        
+        m_allocationBase = result.release().leakRef();
+        return;
+    }
+    
</ins><span class="cx">     RELEASE_ASSERT(WTF::bitCount(alignment) == 1);
</span><span class="cx">     
</span><span class="cx">     const unsigned nativeAlignment = 8;
</span><span class="lines">@@ -55,7 +76,10 @@
</span><span class="cx"> 
</span><span class="cx"> DataSection::~DataSection()
</span><span class="cx"> {
</span><del>-    fastFree(m_allocationBase);
</del><ins>+    if (useExecutableMemory)
+        static_cast&lt;ExecutableMemoryHandle*&gt;(m_allocationBase)-&gt;deref();
+    else
+        fastFree(m_allocationBase);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } } // namespace JSC::FTL
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLDataSectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLDataSection.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLDataSection.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ftl/FTLDataSection.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -28,13 +28,15 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FTL_JIT)
</span><span class="cx"> 
</span><ins>+#include &quot;CodeBlock.h&quot;
+#include &quot;VM.h&quot;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace JSC { namespace FTL {
</span><span class="cx"> 
</span><span class="cx"> class DataSection : public RefCounted&lt;DataSection&gt; {
</span><span class="cx"> public:
</span><del>-    DataSection(size_t size, unsigned alignment);
</del><ins>+    DataSection(VM&amp;, CodeBlock*, size_t, unsigned alignment);
</ins><span class="cx">     ~DataSection();
</span><span class="cx">     
</span><span class="cx">     void* base() { return m_base; }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLLowerDFGToLLVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -102,6 +102,9 @@
</span><span class="cx">             addTargetDependentFunctionAttr(m_ftlState.function, &quot;target-features&quot;, &quot;-avx&quot;);
</span><span class="cx">         }
</span><span class="cx">         
</span><ins>+        if (verboseCompilationEnabled())
+            dataLog(&quot;Function ready, beginning lowering.\n&quot;);
+        
</ins><span class="cx">         m_out.initialize(m_ftlState.module, m_ftlState.function, m_heaps);
</span><span class="cx">         
</span><span class="cx">         m_prologue = FTL_NEW_BLOCK(m_out, (&quot;Prologue&quot;));
</span><span class="lines">@@ -141,7 +144,7 @@
</span><span class="cx">             didOverflowStack(), rarely(stackOverflow), usually(lowBlock(m_graph.block(0))));
</span><span class="cx">         
</span><span class="cx">         m_out.appendTo(stackOverflow, m_handleExceptions);
</span><del>-        vmCall(m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock()), NoExceptions);
</del><ins>+        m_out.call(m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock()));
</ins><span class="cx">         m_ftlState.handleStackOverflowExceptionStackmapID = m_stackmapIDs++;
</span><span class="cx">         m_out.call(
</span><span class="cx">             m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleStackOverflowExceptionStackmapID),
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreftlFTLOutputh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ftl/FTLOutput.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ftl/FTLOutput.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/ftl/FTLOutput.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;FTLAbstractHeapRepository.h&quot;
</span><span class="cx"> #include &quot;FTLCommonValues.h&quot;
</span><span class="cx"> #include &quot;FTLIntrinsicRepository.h&quot;
</span><ins>+#include &quot;FTLState.h&quot;
</ins><span class="cx"> #include &quot;FTLSwitchCase.h&quot;
</span><span class="cx"> #include &quot;FTLTypedPointer.h&quot;
</span><span class="cx"> #include &quot;FTLWeight.h&quot;
</span><span class="lines">@@ -170,12 +171,12 @@
</span><span class="cx"> 
</span><span class="cx">     LValue doubleSin(LValue value)
</span><span class="cx">     {
</span><del>-        return call(intrinsicOrOperation(doubleSinIntrinsic(), sin), value);
</del><ins>+        return call(isX86() ? doubleSinIntrinsic() : operation(sin), value);
</ins><span class="cx">         
</span><span class="cx">     }
</span><span class="cx">     LValue doubleCos(LValue value)
</span><span class="cx">     {
</span><del>-        return call(intrinsicOrOperation(doubleCosIntrinsic(), cos), value);
</del><ins>+        return call(isX86() ? doubleCosIntrinsic() : operation(cos), value);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     LValue doubleSqrt(LValue value)
</span><span class="lines">@@ -362,21 +363,6 @@
</span><span class="cx">         return intToPtr(constIntPtr(function), pointerType(operationType(function)));
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    template&lt;typename FunctionType&gt;
-    LValue intrinsicOrOperation(LValue intrinsic, FunctionType function)
-    {
-        if (isX86())
-            return intrinsic;
-        
-        // LLVM's behavior with respect to math intrinsics that lower to calls is pretty odd
-        // on hardware that requires real effort during relocation.
-        // https://bugs.webkit.org/show_bug.cgi?id=129495
-        
-        // FIXME: At least mark these pure.
-        // https://bugs.webkit.org/show_bug.cgi?id=129494
-        return operation(function);
-    }
-    
</del><span class="cx">     void jump(LBasicBlock destination) { buildBr(m_builder, destination); }
</span><span class="cx">     void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight);
</span><span class="cx">     void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken)
</span><span class="lines">@@ -438,7 +424,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #define FTL_NEW_BLOCK(output, nameArguments) \
</span><del>-    (LIKELY(!::JSC::DFG::verboseCompilationEnabled()) \
</del><ins>+    (LIKELY(!verboseCompilationEnabled()) \
</ins><span class="cx">     ? (output).newBlock() \
</span><span class="cx">     : (output).newBlock((toCString nameArguments).data()))
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCJSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/runtime/JSCJSValue.cpp        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -229,6 +229,9 @@
</span><span class="cx">             out.print(&quot;Cell: &quot;, RawPointer(asCell()));
</span><span class="cx">             out.print(&quot; (&quot;, inContext(*asCell()-&gt;structure(), context), &quot;)&quot;);
</span><span class="cx">         }
</span><ins>+#if USE(JSVALUE64)
+        out.print(&quot;, ID: &quot;, asCell()-&gt;structureID());
+#endif
</ins><span class="cx">     } else if (isTrue())
</span><span class="cx">         out.print(&quot;True&quot;);
</span><span class="cx">     else if (isFalse())
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSCellh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSCell.h (165128 => 165129)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSCell.h        2014-03-05 21:57:26 UTC (rev 165128)
+++ trunk/Source/JavaScriptCore/runtime/JSCell.h        2014-03-05 22:01:57 UTC (rev 165129)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSType type() const;
</span><span class="cx">     IndexingType indexingType() const;
</span><ins>+    StructureID structureID() const { return m_structureID; }
</ins><span class="cx">     Structure* structure() const;
</span><span class="cx">     Structure* structure(VM&amp;) const;
</span><span class="cx">     void setStructure(VM&amp;, Structure*);
</span></span></pre>
</div>
</div>

</body>
</html>