<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 14, 2014 at 10:17 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Nov 14, 2014 at 9:20 AM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>
On 14.11.2014, at 17:56, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt; wrote:<br>
<br>
&gt;&gt;&gt; Anyway, something to be aware of -- anywhere we have true, false or<br>
&gt;&gt;&gt; nil used in a hash calculation, now has a different hash in Spur vs.<br>
&gt;&gt;&gt; Cog.  Maybe we should think about separating those objects&#39; logical<br>
&gt;&gt;&gt; &quot;value&quot; hash from their identityHash in trunk..?  That could be useful<br>
&gt;&gt;&gt; when we move to 64-bit someday..<br>
&gt;&gt;<br>
&gt;&gt; Remember that Spur has a common header format for both 32-bit and 64-bit<br>
&gt;&gt; versions, so in both there is a 22-bit identityHash and hence the<br>
&gt;&gt; identityHashes of all objects in a 64-bit Spur image bootstrapped from a<br>
&gt;&gt; 32-bit Spur image will be _unchanged_.  Convenient. So no need to worry.<br>
&gt;&gt; And it should be the case that a freshly bootstrapped 64-bit Spur image does<br>
&gt;&gt; not need to be rehashed to function properly.<br>
&gt;<br>
&gt; Suprising that their identityHash needs to change for Spur<br>
<br>
</span>It didn&#39;t *have* to change. Eliot could have just re-used the old identity hash of nil, true, and false. He probably just didn&#39;t think to do that.<br></blockquote><div><br></div></span><div>Right. I thought since identityHashes would be changing (class identityHashes must change for Spur&#39;s class table, and there are more than 2^10 objects in an image) I would assign new hashes to all objects in the image that needed them and start with 1, 2 &amp; 3 as the hashes for the first objects, nil, false &amp; true.  Any system which relies on identityHashes not changing from V3 to Spur will be broken anyway, so why keep the hashes for those objects?</div><span class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>&gt; but not to go to 64-bit..<br>
<br>
</span>Spur already increases the number of bits to 22. It does not increase it again for 64 bits. 4 M different hashes should be enough, just like 4 M possible classes should be enough ;)<br>
<span><br>
&gt; Wait, I thought one of the benefits of 64-bit was to finally increase<br>
&gt; that small identityHash?<br>
<br>
</span>22 &gt; 10<br></blockquote><div><br></div></span><div>Right (see both Bert&#39;s &amp; Levente&#39;s responses).  Spur lifts the number of identityHashes from 2^10 to 2^22.  There&#39;s no room for more in a 64-bit system.  SPur is designed to go beyond 32-bits, but it isn&#39;t designed for terabyte heaps.  One step at a time ;-)</div></div></div></div></blockquote><div><br></div><div>I should say no room for more hash bits in *this* 64-bit system.  Here&#39;s the Sour object header:</div><div><br></div><div><div>headerForSlots: numSlots format: formatField classIndex: classIndex</div><div><span class="" style="white-space:pre">        </span>&lt;api&gt;</div><div><span class="" style="white-space:pre">        </span>&quot;The header format in LSB is</div><div><span class="" style="white-space:pre">        </span> MSB:<span class="" style="white-space:pre">        </span>| 8: numSlots<span class="" style="white-space:pre">                </span>| (on a byte boundary)</div><div><span class="" style="white-space:pre">                        </span>| 2 bits<span class="" style="white-space:pre">                        </span>|<span class="" style="white-space:pre">        </span>(msb,lsb = {isMarked,?})</div><div><span class="" style="white-space:pre">                        </span>| 22: identityHash<span class="" style="white-space:pre">        </span>| (on a word boundary)</div><div><span class="" style="white-space:pre">                        </span>| 3 bits<span class="" style="white-space:pre">                        </span>|<span class="" style="white-space:pre">        </span>(msb &lt;-&gt; lsb = {isGrey,isPinned,isRemembered}</div><div><span class="" style="white-space:pre">                        </span>| 5: format<span class="" style="white-space:pre">                </span>| (on a byte boundary)</div><div><span class="" style="white-space:pre">                        </span>| 2 bits<span class="" style="white-space:pre">                        </span>|<span class="" style="white-space:pre">        </span>(msb,lsb = {isImmutable,?})</div><div><span class="" style="white-space:pre">                        </span>| 22: classIndex<span class="" style="white-space:pre">        </span>| (on a word boundary) : LSB</div><div><span class="" style="white-space:pre">        </span> The remaining bits (7) are used for</div><div><span class="" style="white-space:pre">                </span>isImmutable<span style="white-space:pre">        </span><span class="" style="white-space:pre">        </span>(bit 23)</div><div><span class="" style="white-space:pre">                </span>isRemembered<span class="" style="white-space:pre">        </span>(bit 29)</div><div><span class="" style="white-space:pre">                </span>isPinned<span class="" style="white-space:pre">                </span><span style="white-space:pre">        </span>(bit 30)</div><div><span class="" style="white-space:pre">                </span>isGrey<span class="" style="white-space:pre">                        </span>(bit 31)</div><div><span class="" style="white-space:pre">                </span>isMarked<span class="" style="white-space:pre">                </span><span style="white-space:pre">        </span>(bit 55)</div><div><span class="" style="white-space:pre">        </span> leaving 2 unused bits, each next to a 22-bit field, allowing those fields to be</div><div><span class="" style="white-space:pre">        </span> expanded to 23 bits..  The three bit field { isGrey, isPinned, isRemembered }</div><div><span class="" style="white-space:pre">        </span> is for bits that are never set in young objects.  This allows the remembered</div><div><span class="" style="white-space:pre">        </span> table to be pruned when full by using these bits as a reference count of</div><div><span class="" style="white-space:pre">        </span> newSpace objects from the remembered table. Objects with a high count</div><div><span class="" style="white-space:pre">        </span> should be tenured to prune the remembered table.&quot;</div><div><span class="" style="white-space:pre">        </span>&lt;returnTypeC: #usqLong&gt;</div><div><span class="" style="white-space:pre">        </span>&lt;inline: true&gt;</div><div><span class="" style="white-space:pre">        </span>^ ((self cCoerceSimple: numSlots to: #usqLong) &lt;&lt; self numSlotsFullShift)</div><div><span class="" style="white-space:pre">        </span>+ (formatField &lt;&lt; self formatShift)</div><div><span class="" style="white-space:pre">        </span>+ classIndex</div></div><div><br></div><div>I hope this makes sense...</div></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>