[Vm-dev] Questions related to immutability in Cog

Clément Bera bera.clement at gmail.com
Tue Nov 10 14:17:32 UTC 2015

Hello everyone,

I tried to understand how immutability is implemented in the CogVM
(NewSpeak flavor). I have some questions:

- Does it actually work and is it used ?
- Does an object being immutable means that you can't edit its variable
fields only or that you can't either edit its instance variables ? Because
I don't see any code checking for instance variable stores in the Newspeak
- How does the immutability check works in machine code ? In the Newspeak
interpreter there is an immutability check in #at:put: . In the at:put:
generated by the JIT (for example CogObjectRepresentationFor32BitSpur) I
don't see any immutability check. Did I miss some clever bit trick ? Does
the Newspeak spur VMs use the #at:put: machine code version of the
primitive ?

Thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151110/16343dfa/attachment-0001.htm

More information about the Vm-dev mailing list