[Vm-dev] Re: [Pharo-dev] Should literals be immutable ?

Eliot Miranda eliot.miranda at gmail.com
Mon Oct 27 17:35:49 UTC 2014


On Mon, Oct 27, 2014 at 9:55 AM, Levente Uzonyi <leves at elte.hu> wrote:

>
> On Mon, 27 Oct 2014, Eliot Miranda wrote:
>
>  See my message earlier in the thread.  Via a per-object isImmutable bit.
>>
>
> So you would set the bit for the CompiledMethod and all literals
> (including sub-arrays, floats, integers, booleans etc)?
>

The literals, definitely.  Whether the bit is set for compiled methods or
not depends on things like how easy you want to be able to update the
source pointer or add/delete properties.


>
> Does the set immutability bit also mean that the object can't be swapped
> with #become:?
>

That's debatable, but in VW we disallowed two-way become: and allowed
one-way become: for immutables.  I think that's right.  one-way become is
about references to objects, two-way become is about changing objects
themselves.

-- 
best,
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20141027/3d0fe0bc/attachment.htm


More information about the Vm-dev mailing list