[Vm-dev] Works in SqueakVM but not Cog

Eliot Miranda eliot.miranda at gmail.com
Mon Dec 13 19:21:01 UTC 2010


On Mon, Dec 13, 2010 at 6:14 AM, Igor Stasenko <siguctua at gmail.com> wrote:

>
> | newNil |
> newNil := UndefinedObject basicNew.
> nil becomeForward: newNil.
> (Array new: 1) first == newNil
>
> In Cog it just hangs VM (under Mac)
>
> Any ideas how to fix that?
>

I don't think it's worth fixing.  It is advantageous for the performance of
the VM to be able to embed nil in machine code without needing to mark it as
a GCable object, and nil doesn't really have to change.  Instead you can
change the UndefinedObject class via a become.  So for me it's not worth
fixing and in fact I would actively encourage expecting /not/ to be able to
redefine nil, true or false.  For example in Cog better code is generated
for conditional branches by assuming that true and false are contiguous (in
current images 8 bytes apart).  IMO, there are flexibilities that are so
unusual they are not worth paying for, and being able to become nil, true
and false are in this category.

best
Eliot


>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101213/aafdde95/attachment.htm


More information about the Vm-dev mailing list