<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Thanks!</div><div>We will probably address that in Pharo 40. I do not know if esteban cherrypicked this changes.</div><div><br></div><div>Stef</div><div><br><blockquote type="cite"><div dir="ltr"><div dir="auto">The global GC here is pretty unfortunate. &nbsp;It is there because the VM used to leave old instances lying around. &nbsp;It works like this:</div>
<div dir="auto"><br></div><div>we want to reshape instances of class C, e.g. by adding an inst var, and so</div><div><br></div><div>1. create C', which is C plus an inst var</div><div dir="auto">2. create a parallel set of instances of class C', one for each instance of class C</div>
<div dir="auto">3. for each corresponding pair of instances copy state from the instance of C to the instance of C'</div><div dir="auto">4. forward-become the instances of C to the instances of C' (now no references to the instances of C remain)</div>
<div dir="auto">5. become C to C' (now C' is the new C)</div><div dir="auto"><br></div><div dir="auto">The bug is that the old instances of C are still in the heap. &nbsp;Because of the become in 5. they look like instances of the new C, but are the wrong size; they lack space for the new inst var. &nbsp;They're not reachable (4. replaced all references to them with references to the instances of C') but they can be resurrected through allInstances (someInstance,nextInstance) which works not by following references from the roots (Smalltalk and the activeProcess) but by scanning objects in the heap.</div>
<div dir="auto"><br></div><div dir="auto">However, this was "fixed" in</div><div dir="auto"><br></div><div dir="auto"><div dir="auto"><span class="" style="white-space:pre">        </span>Name: VMMaker.oscog-eem.254</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>Author: eem</div><div dir="auto"><span class="" style="white-space:pre">        </span>Time: 11 January 2013, 7:05:37.389 pm</div><div dir="auto"><span class="" style="white-space:pre">        </span>UUID: 74e6a299-691e-4f7d-986c-1a7d3d0ec02c</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>Ancestors: VMMaker.oscog-eem.253</div><div dir="auto"><br></div><div dir="auto"><span class="" style="white-space:pre">        </span>Fix becomeForward: so that objects whose references are deleted are</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>freed and can no longer be resurrected via allObjects or allInstances.</div><div dir="auto"><br></div><div>The change is to free the objects replaced in a forwardBecome so they are no longer objects (effectively their class is null (not nil, but 0)). &nbsp;So they can't be resurrected and hence the global GC is un necessary. &nbsp;The Newspeak folks, in particular Ryan Macnak, spotted this and encouraged me to make the change. &nbsp;It of course speeds up instance mutation considerably.</div>
<div><br></div><div>I say fixed because there was a bug tail:</div><div><br></div></div><div dir="auto"><div dir="auto"><span class="" style="white-space:pre">        </span>Name: VMMaker.oscog-eem.258</div><div dir="auto"><span class="" style="white-space:pre">        </span>Author: eem</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>Time: 18 January 2013, 11:01:23.072 am</div><div dir="auto"><span class="" style="white-space:pre">        </span>UUID: da1433f1-de50-475f-be33-f462b300a2ea</div><div dir="auto">
<span class="" style="white-space:pre">        </span>Ancestors: VMMaker.oscog-eem.257</div><div dir="auto"><br></div><div dir="auto"><span class="" style="white-space:pre">        </span>Fix becomeForward: when the rootTable overflows. &nbsp;There were two</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>bugs here. &nbsp;One is that initializeMemoryFirstFree: used to clear the</div><div dir="auto"><span class="" style="white-space:pre">        </span>needGCFlag so if the rootTable overflowed noteAsRoot:headerLoc:'s setting of the needGCFlag would be undone after the sweep.</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>The other is that&nbsp;rootTable&nbsp;overflow was indicated by</div><div dir="auto"><span class="" style="white-space:pre">        </span>rootTableCount &gt;= RootTableSize which could be undone by</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>becomeForward: freeing roots which need to be removed from</div><div dir="auto"><span class="" style="white-space:pre">        </span>the rootTable. &nbsp;At some point in becomeForward the rootTable would</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>fill but at a later point a root would be freed, causing the table to</div><div dir="auto"><span class="" style="white-space:pre">        </span>become not full.</div>
<div dir="auto"><br></div><div dir="auto"><span class="" style="white-space:pre">        </span>The fix is two fold. &nbsp;1. Add an explicit rootTableOverflowed flag</div><div dir="auto"><span class="" style="white-space:pre">        </span>instead of relying on rootTableCount &gt;= RootTableSize.</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>2. move the clearing of the needGCFlag to the GC routines.</div><div dir="auto"><span class="" style="white-space:pre">        </span>Remove unnecessary senders of needGCFlag: false, and remove</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>the accessor.</div><div dir="auto"><br></div><div dir="auto"><span class="" style="white-space:pre">        </span>Name: VMMaker.oscog-eem.255</div><div dir="auto"><span class="" style="white-space:pre">        </span>Author: eem</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>Time: 12 January 2013, 6:28:41.398 pm</div><div dir="auto"><span class="" style="white-space:pre">        </span>UUID: 51e53ec1-8caf-41f6-9293-1088ef4b82d8</div><div dir="auto">
<span class="" style="white-space:pre">        </span>Ancestors: VMMaker.oscog-eem.254</div><div dir="auto"><br></div><div dir="auto"><span class="" style="white-space:pre">        </span>[New[Co]]ObjectMemory:</div><div dir="auto"><span class="" style="white-space:pre">        </span>Fix freeing of objects for becomeForward:. &nbsp;Remove freed young</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>roots from the rootsTable. &nbsp;Filter freed objects pointet to from the</div><div dir="auto"><span class="" style="white-space:pre">        </span>extraRootsTable (because these locations can change it is wrong</div>
<div dir="auto"><span class="" style="white-space:pre">        </span>to remove entries from the extraRootsTable).</div><div><span><br></span></div><div><span>But the bottom line is that, at least on the current Cog VM, that global GC is unnecessary. &nbsp;David, Tim, this still needs to be folded into ObjectMemory in the standard interpreter. But doing so is very worth-while. &nbsp;Monticello loads are noticeably faster.</span></div>
<div><span><br></span><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>KR</div><div>Phil&nbsp;</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">


<div dir="ltr"><div class="gmail_extra"><span><font color="#888888"></font></span></div><span><font color="#888888"><div class="gmail_extra"><br><br></div><div class="gmail_extra">
-- <br>Best regards,<br>Igor Stasenko.
</div></font></span></div>
</blockquote></div></div></div></blockquote><br><br><span>Eliot (phone)</span></div></div></div>
</blockquote></div><br></body></html>