Hi Chris,<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>the mirror primitives are basic object access and testing primitives that take the objects they operate upon as arguments.  Compare these with the basic object access and testing primitives that operate on their receiver:</div>
<div><br></div><div><div>ContextPart&gt;&gt;#object:basicAt:<span class="Apple-tab-span" style="white-space:pre">                                        </span>Object&gt;&gt;#basicAt:</div><div>ContextPart&gt;&gt;#object:basicAt:put:<span class="Apple-tab-span" style="white-space:pre">                                </span>Object&gt;&gt;#basicAt:put:</div>
<div>ContextPart&gt;&gt;#object:eqeq:<span class="Apple-tab-span" style="white-space:pre">                                        </span>Object&gt;&gt;#==</div><div>ContextPart&gt;&gt;#object:instVarAt:<span class="Apple-tab-span" style="white-space:pre">                                        </span>Object&gt;&gt;#instVarAt:</div>
<div>ContextPart&gt;&gt;#object:instVarAt:put:<span class="Apple-tab-span" style="white-space:pre">                                </span>Object&gt;&gt;#instVarAt:put:</div><div>ContextPart&gt;&gt;#object:perform:withArguments:inClass:<span class="Apple-tab-span" style="white-space:pre">        </span>Object&gt;&gt;#perform:withArguments:inClass:</div>
<div>ContextPart&gt;&gt;#objectClass:<span class="Apple-tab-span" style="white-space:pre">                                        </span>Object&gt;&gt;#class</div><div>ContextPart&gt;&gt;#objectSize:<span class="Apple-tab-span" style="white-space:pre">                                                </span>Object&gt;&gt;#basicSize</div>
<div><br></div>The execution machinery needs just these primitives to simulate bytecodes correctly (it needs to use primitives in the VM to evaluate primitives in general).  If the execution simulation machinery /doesn&#39;t/ use these primitives and uses the Object ones instead then code involving proxies will not simulate correctly because instead of operating on the receiver they may be forwarded to some other object through a doesNotUnderstand: implementation.  e.g.  if you have some instance of a class that doesn&#39;t understand any messages, say a forwarder, and you try and simulate execution, then any attempt to access an inst var of the instance via instVarAt: is doomed to fail and will access the inst var of the object being forwarded to, rendering the debugger useless for debugging proxies.  If the system uses the mirror primitives on the other hand simulation is correct because these primitives operate on their arguments instead of their receiver and so in being sent to a context they are always received as intended.</div>
<div><br></div><div>As soon as the standard VM implements these primitives correctly we can upgrade the execution simulation machinery in ContextPart and MethodContext to use them.  We&#39;ve been using these at Teleplace for quite a while now, and they&#39;ve been in VisualWorks for a long time.</div>
<div><br></div><div>But as I understand your issue with Magma I don&#39;t think these solve your problem.  Instead I guess all you&#39;d need is to wrap all your primitives and put the send of yourself in the wrappers.</div>
<div><br></div><div>HTH</div><div>Eliot</div><div><br></div><div><br><div class="gmail_quote">On Thu, Dec 23, 2010 at 12:51 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@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;">In going through all of the package versions for the 4.2<br>
release-notes, I came across this:<br>
<br>
--------------<br>
Name: Kernel-eem.501<br>
Author: eem<br>
Time: 25 September 2010, 7:55:34.708 pm<br>
UUID: 5b55eae3-594b-4416-9d47-5a4ebaabb238<br>
Ancestors: Kernel-ul.500<br>
<br>
Add mirror primitives which can be used for accurate<br>
execution simulation (a.k.a. debugging) of proxies.<br>
---------------<br>
<br>
One of the things that concerns Magma applications are instances of<br>
its own proxies being sent as an argument to a primitive.  I&#39;m able to<br>
rectify most cases with a simple #yourself to the argument in the<br>
_sender_ (unfortunately I cannot do it in the top of the primitive<br>
method itself, which would be ideal).<br>
<br>
It&#39;s an unfortunate piercing of the transparency and so this made me<br>
wonder whether there isn&#39;t a more general solution to this problem to<br>
handle all cases.<br>
<font color="#888888"><br>
 - Chris<br>
<br>
</font></blockquote></div><br></div>