[Vm-dev] Small finding about NewObjectMemory>>clone:

Eliot Miranda eliot.miranda at gmail.com
Tue Aug 16 16:11:16 UTC 2011



On Aug 15, 2011, at 6:58 PM, Dimitry Golubovsky <golubovsky at gmail.com> wrote:

> 
> Hi,
> 
> I have just spotted that the method NewObjectMemory>>clone as found in
> VMMaker-oscog-IgorStasenko.116.mcz (with hyphen):
> 
> clone: oop
>    "Return a shallow copy of the given object. May cause GC"
>    "Assume: Oop is a real object, not a small integer.
>     Override to assert it's not a married context"
>    self assert: ((coInterpreter isContext: oop) not
>                or: [(coInterpreter isMarriedOrWidowedContext: oop) not]).
>    ^super clone: oop
> 
> causes compilation error in the interpreter.
> 
> It seems that it has been fixed in VMMaker.oscog-eem.116.mcz (with dot)
> 
> clone: obj
>    "Return a shallow copy of the given object. May cause GC"
>    "Assume: Oop is a real object, not a small integer.
>     Override to assert it's not a married context"
>    self assert: ((coInterpreter isContext: obj) not
>                or: [(coInterpreter isMarriedOrWidowedContext: obj) not]).
>    ^super clone: obj
> 
> basically s/oop/obj/g - I had to make similar change in my local copy
> of VMMaker.
> 
> So, Igor: please merge this into the CMMaker-oscog branch.
> 
> Thanks.
> 
> PS Is this some kind of inliner bug? When super method is inlined,
> argument identifier remains the same instead of being substituted.

yes, bug or limitation.  The super send inliner is a very simple-minded quick hack that can't rename argument names when inlining the superclass method, and so argument names in the super- and sub-class methods must match.  In 115 I didn't notice the bug since it only affected code in an assert.  In 116 I made the argument names match and added an error check to the super inliner.

Eliot (phone)
> -- 
> Dimitry Golubovsky
> 
> Anywhere on the Web


More information about the Vm-dev mailing list