<br><br><div class="gmail_quote">On Wed, May 23, 2012 at 2:13 PM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></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">> On Wed, May 23, 2012 at 12:04 PM, Andreas Raab <<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>> wrote:<br>
><br>
> > On 5/23/2012 20:51, Eliot Miranda wrote:<br>
> ><br>
> >> 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>
> >><br>
> ><br>
> > It should be possible to write the mirror prims relatively safely, e.g.:<br>
> ><br>
> > object: anObject instVarAt: anIndex<br>
> > "Primitive. Answer a fixed variable in an object. The numbering of<br>
> > the<br>
> > variables corresponds to the named instance variables. Fail if the<br>
> > index<br>
> > is not an Integer or is not the index of a fixed variable.<br>
> > Essential for the<br>
> > debugger. See Object documentation whatIsAPrimitive."<br>
> ><br>
> > <primitive: 73><br>
> > anIndex <= (self objectClass: anObject) instSize<br>
> > ifTrue:["Assume mirror primitives are missing"<br>
> > ^anObject instVarAt: index]<br>
> > ifFalse:["Access beyond fixed variables."<br>
> > ^self object: anObject basicAt: anIndex - (self<br>
> > objectClass: anObject) instSize].<br>
> ><br>
><br>
> That's a good idea. Alas it doesn't work because the primitives won't fail<br>
> on the older VMs. Note that the same primitive is used for instVarAt: and<br>
> object:instVarAt: (and likewise for object:instVarAt:put: & objectClass:<br>
> etc). The difference is that in the older VM the prims assume a fixed<br>
> argument count and only pop that many objects from the stack. Hence there<br>
> is the potential of stack overflow in the older VMs. In any case things<br>
> are likely to limp along rather than fail catastrophically. I'm not sure<br>
> that that'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'll be clumsy. It'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>