On Mon, Sep 07, 2009 at 12:13:07PM -0700, Eliot Miranda wrote:
The attached change set for the image level code is also conflated with changes that allow the debugger to set the primitive error code correctly.
The VM also needs to implement the primitives. ?If the order of the arguments are the same as those of the corresponding non-reflective primitive (e.g. aContext object: theReceiver instVarAt: index put: value has the same order as theReceiver instVarAt: index put: value) and the primitive pops back the stack using self pop: argumentCount + 1, one can use the same VM primitive implementations as the non-reflective ones and so avoid needing extra primitives.
However, not all primitives are correctly implemented; e.g. at: and at:put: are, but size is not. ?So before we can use this there is some work to do in the standard VMs. ?I'm attaching here the implementation in the Stack VM which will require some back porting to the standard VM. ?None of these changes has performance implications because the special selector impelmentations of at: at:put: size and #== are not affected.
<snip>
I'm posting this rather than integrating because a) the VMs need to get updated before we can use the image level code and, b) the VM folks need code to test their VMs with. ?I'm happy to integrate the image-level changes once the VMs have been upgraded.
best Eliot
I opened a Mantis issue to track this, and uploaded Eliot's fileouts: Mantis 7429: Add Mirror Primitives to the VM http://bugs.squeak.org/view.php?id=7429
A bit of work will be required to integrate the mirror primitives in MirrorPrimitivesVM.st into the base Squeak VM (this has not yet been done). Note that unit tests for the mirror primitives are present in the Squeak trunk image, which of course fail without VM support, so there is some interest in getting this integrated into the VM to support the tests in the image.
Dave