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