<!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>[171611] branches/ftlopt/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/171611">171611</a></dd>
<dt>Author</dt> <dd>mhahnenberg@apple.com</dd>
<dt>Date</dt> <dd>2014-07-25 13:26:35 -0700 (Fri, 25 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix 32-bit build breakage for type profiling
https://bugs.webkit.org/process_bug.cgi

Patch by Saam Barati &lt;sbarati@apple.com&gt; on 2014-07-25
Reviewed by Mark Hahnenberg.

32-bit builds currently break because global variable IDs for high
fidelity type profiling are int64_t. Change this to intptr_t so that
it's 32 bits on 32-bit platforms and 64 bits on 64-bit platforms.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::scopeDependentProfile):
* bytecode/TypeLocation.h:
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::uniqueIDForVariable):
(JSC::SymbolTable::uniqueIDForRegister):
* runtime/SymbolTable.h:
* runtime/TypeLocationCache.cpp:
(JSC::TypeLocationCache::getTypeLocation):
* runtime/TypeLocationCache.h:
* runtime/VM.h:
(JSC::VM::getNextUniqueVariableID):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesftloptSourceJavaScriptCoreChangeLog">branches/ftlopt/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesftloptSourceJavaScriptCorebytecodeCodeBlockcpp">branches/ftlopt/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCorebytecodeTypeLocationh">branches/ftlopt/Source/JavaScriptCore/bytecode/TypeLocation.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeSymbolTablecpp">branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeSymbolTableh">branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeTypeLocationCachecpp">branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.cpp</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeTypeLocationCacheh">branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.h</a></li>
<li><a href="#branchesftloptSourceJavaScriptCoreruntimeVMh">branches/ftlopt/Source/JavaScriptCore/runtime/VM.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesftloptSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/ChangeLog (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/ChangeLog        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-07-25  Saam Barati  &lt;sbarati@apple.com&gt;
+
+        Fix 32-bit build breakage for type profiling
+        https://bugs.webkit.org/process_bug.cgi
+
+        Reviewed by Mark Hahnenberg.
+
+        32-bit builds currently break because global variable IDs for high
+        fidelity type profiling are int64_t. Change this to intptr_t so that
+        it's 32 bits on 32-bit platforms and 64 bits on 64-bit platforms.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::CodeBlock):
+        (JSC::CodeBlock::scopeDependentProfile):
+        * bytecode/TypeLocation.h:
+        * runtime/SymbolTable.cpp:
+        (JSC::SymbolTable::uniqueIDForVariable):
+        (JSC::SymbolTable::uniqueIDForRegister):
+        * runtime/SymbolTable.h:
+        * runtime/TypeLocationCache.cpp:
+        (JSC::TypeLocationCache::getTypeLocation):
+        * runtime/TypeLocationCache.h:
+        * runtime/VM.h:
+        (JSC::VM::getNextUniqueVariableID):
+
</ins><span class="cx"> 2014-07-25  Mark Hahnenberg  &lt;mhahnenberg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reindent PropertyNameArray.h
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/bytecode/CodeBlock.cpp (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -2057,7 +2057,7 @@
</span><span class="cx">         case op_profile_types_with_high_fidelity: {
</span><span class="cx">             size_t instructionOffset = i + opLength - 1;
</span><span class="cx">             unsigned divotStart, divotEnd;
</span><del>-            intptr_t globalVariableID;
</del><ins>+            GlobalVariableID globalVariableID;
</ins><span class="cx">             RefPtr&lt;TypeSet&gt; globalTypeSet;
</span><span class="cx">             bool shouldAnalyze = m_unlinkedCode-&gt;highFidelityTypeProfileExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
</span><span class="cx">             VirtualRegister virtualRegister(pc[1].u.operand);
</span><span class="lines">@@ -3993,7 +3993,7 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned divotStart, divotEnd;
</span><span class="cx">     bool shouldAnalyze = m_unlinkedCode-&gt;highFidelityTypeProfileExpressionInfoForBytecodeOffset(instructionOffset, divotStart, divotEnd);
</span><del>-    intptr_t globalVariableID;
</del><ins>+    GlobalVariableID globalVariableID;
</ins><span class="cx">     RefPtr&lt;TypeSet&gt; globalTypeSet;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: handle other values for op.type here, and also consider what to do when we can't statically determine the globalID
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCorebytecodeTypeLocationh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/bytecode/TypeLocation.h (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/bytecode/TypeLocation.h        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/bytecode/TypeLocation.h        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -37,6 +37,8 @@
</span><span class="cx">     HighFidelityThisStatement = -4
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+typedef intptr_t GlobalVariableID;
+
</ins><span class="cx"> class TypeLocation {
</span><span class="cx"> public:
</span><span class="cx">     TypeLocation() 
</span><span class="lines">@@ -46,7 +48,7 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    int64_t m_globalVariableID;
</del><ins>+    GlobalVariableID m_globalVariableID;
</ins><span class="cx">     intptr_t m_sourceID;
</span><span class="cx">     unsigned m_divotStart;
</span><span class="cx">     unsigned m_divotEnd;
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeSymbolTablecpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.cpp (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.cpp        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.cpp        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -192,13 +192,13 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int64_t SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&amp;, StringImpl* key, VM&amp; vm)
</del><ins>+GlobalVariableID SymbolTable::uniqueIDForVariable(const ConcurrentJITLocker&amp;, StringImpl* key, VM&amp; vm)
</ins><span class="cx"> {
</span><span class="cx">     auto iter = m_uniqueIDMap-&gt;find(key);
</span><span class="cx">     auto end = m_uniqueIDMap-&gt;end();
</span><span class="cx">     ASSERT_UNUSED(end, iter != end);
</span><span class="cx"> 
</span><del>-    int64_t&amp; id = iter-&gt;value;
</del><ins>+    GlobalVariableID&amp; id = iter-&gt;value;
</ins><span class="cx">     if (id == HighFidelityNeedsUniqueIDGeneration) {
</span><span class="cx">         id = vm.getNextUniqueVariableID();
</span><span class="cx">         m_uniqueTypeSetMap-&gt;set(key, TypeSet::create()); //make a new global typeset for the ID
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx">     return id;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int64_t SymbolTable::uniqueIDForRegister(const ConcurrentJITLocker&amp; locker, int registerIndex, VM&amp; vm)
</del><ins>+GlobalVariableID SymbolTable::uniqueIDForRegister(const ConcurrentJITLocker&amp; locker, int registerIndex, VM&amp; vm)
</ins><span class="cx"> {
</span><span class="cx">     auto iter = m_registerToVariableMap-&gt;find(registerIndex);
</span><span class="cx">     auto end = m_registerToVariableMap-&gt;end();
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeSymbolTableh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.h (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.h        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/SymbolTable.h        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -337,7 +337,7 @@
</span><span class="cx">     typedef JSCell Base;
</span><span class="cx"> 
</span><span class="cx">     typedef HashMap&lt;RefPtr&lt;StringImpl&gt;, SymbolTableEntry, IdentifierRepHash, HashTraits&lt;RefPtr&lt;StringImpl&gt;&gt;, SymbolTableIndexHashTraits&gt; Map;
</span><del>-    typedef HashMap&lt;RefPtr&lt;StringImpl&gt;, int64_t&gt; UniqueIDMap;
</del><ins>+    typedef HashMap&lt;RefPtr&lt;StringImpl&gt;, GlobalVariableID&gt; UniqueIDMap;
</ins><span class="cx">     typedef HashMap&lt;RefPtr&lt;StringImpl&gt;, RefPtr&lt;TypeSet&gt;&gt; UniqueTypeSetMap;
</span><span class="cx">     typedef HashMap&lt;int, RefPtr&lt;StringImpl&gt;, WTF::IntHash&lt;int&gt;, WTF::UnsignedWithZeroKeyHashTraits&lt;int&gt;&gt; RegisterToVariableMap;
</span><span class="cx"> 
</span><span class="lines">@@ -458,8 +458,8 @@
</span><span class="cx">         return contains(locker, key);
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    int64_t uniqueIDForVariable(const ConcurrentJITLocker&amp;, StringImpl* key, VM&amp; vm);
-    int64_t uniqueIDForRegister(const ConcurrentJITLocker&amp; locker, int registerIndex, VM&amp; vm);
</del><ins>+    GlobalVariableID uniqueIDForVariable(const ConcurrentJITLocker&amp;, StringImpl* key, VM&amp; vm);
+    GlobalVariableID uniqueIDForRegister(const ConcurrentJITLocker&amp; locker, int registerIndex, VM&amp; vm);
</ins><span class="cx">     RefPtr&lt;TypeSet&gt; globalTypeSetForRegister(const ConcurrentJITLocker&amp; locker, int registerIndex, VM&amp; vm);
</span><span class="cx">     RefPtr&lt;TypeSet&gt; globalTypeSetForVariable(const ConcurrentJITLocker&amp; locker, StringImpl* key, VM&amp; vm);
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeTypeLocationCachecpp"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.cpp (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.cpp        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.cpp        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-std::pair&lt;TypeLocation*, bool&gt; TypeLocationCache::getTypeLocation(int64_t globalVariableID, intptr_t sourceID, unsigned start, unsigned end, PassRefPtr&lt;TypeSet&gt; globalTypeSet, VM* vm)
</del><ins>+std::pair&lt;TypeLocation*, bool&gt; TypeLocationCache::getTypeLocation(GlobalVariableID globalVariableID, intptr_t sourceID, unsigned start, unsigned end, PassRefPtr&lt;TypeSet&gt; globalTypeSet, VM* vm)
</ins><span class="cx"> {
</span><span class="cx">     LocationKey key;
</span><span class="cx">     key.m_globalVariableID = globalVariableID;
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeTypeLocationCacheh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.h (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.h        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/TypeLocationCache.h        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -51,13 +51,13 @@
</span><span class="cx">             return m_globalVariableID + m_sourceID + m_start + m_end;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        int64_t m_globalVariableID;
</del><ins>+        GlobalVariableID m_globalVariableID;
</ins><span class="cx">         intptr_t m_sourceID;
</span><span class="cx">         unsigned m_start;
</span><span class="cx">         unsigned m_end;
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    std::pair&lt;TypeLocation*, bool&gt; getTypeLocation(int64_t, intptr_t, unsigned start, unsigned end, PassRefPtr&lt;TypeSet&gt;, VM*);
</del><ins>+    std::pair&lt;TypeLocation*, bool&gt; getTypeLocation(GlobalVariableID, intptr_t, unsigned start, unsigned end, PassRefPtr&lt;TypeSet&gt;, VM*);
</ins><span class="cx"> private:     
</span><span class="cx">     typedef std::unordered_map&lt;LocationKey, TypeLocation*, HashMethod&lt;LocationKey&gt;&gt; LocationMap;
</span><span class="cx">     LocationMap m_locationMap;
</span></span></pre></div>
<a id="branchesftloptSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: branches/ftlopt/Source/JavaScriptCore/runtime/VM.h (171610 => 171611)</h4>
<pre class="diff"><span>
<span class="info">--- branches/ftlopt/Source/JavaScriptCore/runtime/VM.h        2014-07-25 20:07:34 UTC (rev 171610)
+++ branches/ftlopt/Source/JavaScriptCore/runtime/VM.h        2014-07-25 20:26:35 UTC (rev 171611)
</span><span class="lines">@@ -521,7 +521,7 @@
</span><span class="cx">         HighFidelityTypeProfiler* highFidelityTypeProfiler() { return m_highFidelityTypeProfiler.get(); }
</span><span class="cx">         TypeLocation* nextLocation() { return m_locationInfo.add(); } //TODO: possible optmization: when codeblocks die, report which locations are no longer being changed so we don't walk over them
</span><span class="cx">         JS_EXPORT_PRIVATE void dumpHighFidelityProfilingTypes();
</span><del>-        int64_t getNextUniqueVariableID() { return m_nextUniqueVariableID++; }
</del><ins>+        GlobalVariableID getNextUniqueVariableID() { return m_nextUniqueVariableID++; }
</ins><span class="cx"> 
</span><span class="cx">     private:
</span><span class="cx">         friend class LLIntOffsetsExtractor;
</span><span class="lines">@@ -573,7 +573,7 @@
</span><span class="cx">         HashMap&lt;String, RefPtr&lt;WatchpointSet&gt;&gt; m_impurePropertyWatchpointSets;
</span><span class="cx">         std::unique_ptr&lt;HighFidelityTypeProfiler&gt; m_highFidelityTypeProfiler;
</span><span class="cx">         std::unique_ptr&lt;HighFidelityLog&gt; m_highFidelityLog;
</span><del>-        int64_t m_nextUniqueVariableID;
</del><ins>+        GlobalVariableID m_nextUniqueVariableID;
</ins><span class="cx">         Bag&lt;TypeLocation&gt; m_locationInfo;
</span><span class="cx">     };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>