<br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 3:32 PM, Camillo Bruni <span dir="ltr">&lt;<a href="mailto:camillobruni@gmail.com">camillobruni@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div class="h5"><br>
On 2012-03-22, at 17:26, Eliot Miranda wrote:<br>
<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Mar 22, 2012 at 7:26 AM, Camillo Bruni &lt;<a href="mailto:camillobruni@gmail.com">camillobruni@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On 2012-03-22, at 15:06, Stefan Marr wrote:<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; On 22 Mar 2012, at 14:45, Camillo Bruni wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; let&#39;s have some fun and do<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Object subclass: #Behavior<br>
&gt; &gt;&gt;      uses: TPureBehavior<br>
&gt; &gt;&gt;      instanceVariableNames: &#39;superclass methodDict format layout&#39;<br>
&gt; &gt;&gt;      classVariableNames: &#39;ObsoleteSubclasses&#39;<br>
&gt; &gt;&gt;      poolDictionaries: &#39;&#39;<br>
&gt; &gt;&gt;      category: &#39;Kernel-Classes&#39;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; proceed over the several warnings not to change Behavior and BOOM! :D<br>
&gt; &gt;<br>
&gt; &gt; Check classNameIndex and thisClassIndex in the VM implementation.<br>
&gt; &gt; They are typically the hardcoded indices into the expected object layout of Class objects.<br>
&gt; &gt;<br>
&gt; &gt; And you just changed the layout -&gt; BOOM! magic ;)<br>
&gt; &gt;<br>
&gt; &gt; I don&#39;t know how much overhead it is to examine such kind of indices dynamically, but we do deduce indices based on inst var names to be able to support the different object layouts.<br>
&gt; &gt; For my stuff, I do that at VM startup, which would not help you.<br>
&gt;<br>
&gt; They would be expensive to recompute all the time (they&#39;re used in debug printing).  But they&#39;re not expensive to compute. So they could be recomputed easily.  See below.<br>
&gt;<br>
&gt;<br>
&gt; &gt; David did it dynamically for the Process class and checked the object identity of the class I think, to know when to update the index table after a layout change.<br>
&gt;<br>
&gt; right. I guess I will have to move it to some further position...<br>
&gt; although I have an old image with:<br>
&gt;<br>
&gt; Behavior subclass: #ClassDescription<br>
&gt;        layout: PointerLayout<br>
&gt;        uses: TClassAndTraitDescription<br>
&gt;        slots: {<br>
&gt;                #instanceVariables =&gt; Slot.<br>
&gt;                #organization =&gt; Slot.<br>
&gt;                #layout =&gt; Slot.<br>
&gt;        }<br>
&gt;        classSlots: {}<br>
&gt;        globals: &#39;&#39;<br>
&gt;        category: #&#39;Kernel-Classes&#39;<br>
&gt;<br>
&gt;<br>
&gt; which works under said Cog version :/. I guess I will just have to find some older VM which will support the changes<br>
&gt;<br>
&gt; I think we should make the VM work for this.   classNameIndex and thisClassIndex should only be used for debug printing, at least thats my intent, and it would be possible to flush them and recompute them as a side-effect of e.g. a flushCache primitive.<br>

&gt;<br>
&gt; Camilo, would you create a reproducible case for me, an image that applies this change at start-up?  Thanks.<br>
&gt;<br>
&gt; Also, can we please get into the habit of cc&#39;ing vm-dev for issues that touch on the VM?  I ask this so that subsequent searching for VM issues can be confined to a search of vm-dev archives.  Again AdvThanksance.<br>

<br>
</div></div>Submitted a bug report here:<br>
        <a href="http://code.google.com/p/cog/issues/detail?id=76" target="_blank">http://code.google.com/p/cog/issues/detail?id=76</a><br>
<br>
the attached *.st files fail under Cog / StackVM. It would be indeed nice if they would work.<br></blockquote><div><br></div><div>Which maybe it will one day if you can put in the effort to describe how to reproduce the bug properly.  There&#39;s no pointer to a suitable image.  There are no instructions beyond &quot;use these files&quot;.  How about a link to an image, plus a small script that files in the files?  Or even better how about constructing an image that does this at startup so that the VM maintainers only have to fire up the image instead of wasting time setting up files?  </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
best<br>
cami<br>
<br>
<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>