<br><br><div class="gmail_quote">On Wed, May 23, 2012 at 12:04 PM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de" target="_blank">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 5/23/2012 20:51, Eliot Miranda wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So given that the Interpreter VM now supports the mirror primitives,<br>
does anyone object if I add the debugger changes to trunk that use the<br>
mirror primitives and hence make accurate debugging of proxies possible?<br>
The downside of doing this is that the debugger will be broken on<br>
older VMs.<br>
</blockquote>
<br>
It should be possible to write the mirror prims relatively safely, e.g.:<br>
<br>
object: anObject instVarAt: anIndex<br>
        &quot;Primitive. Answer a fixed variable in an object. The numbering of the<br>
        variables corresponds to the named instance variables. Fail if the index<br>
        is not an Integer or is not the index of a fixed variable. Essential for the<br>
        debugger. See  Object documentation whatIsAPrimitive.&quot;<br>
<br>
        &lt;primitive: 73&gt;<br>
        anIndex &lt;= (self objectClass: anObject) instSize<br>
                ifTrue:[&quot;Assume mirror primitives are missing&quot;<br>
                        ^anObject instVarAt: index]<br>
                ifFalse:[&quot;Access beyond fixed variables.&quot;<br>
                        ^self object: anObject basicAt: anIndex - (self objectClass: anObject) instSize].<br></blockquote><div><br></div><div>That&#39;s a good idea.  Alas it doesn&#39;t work because the primitives won&#39;t fail on the older VMs.  Note that the same primitive is used for instVarAt: and object:instVarAt: (and likewise for object:instVarAt:put: &amp; objectClass: etc).  The difference is that in the older VM the prims assume a fixed argument count and only pop that many objects from the stack.  Hence there is the potential of stack overflow in the older VMs.  In any case things are likely to limp along rather than fail catastrophically.  I&#39;m not sure that that&#39;s a good thing or not ;)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
Cheers,<br>
  - Andreas<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>