[Vm-dev] Immutability through hardware

Igor Stasenko siguctua at gmail.com
Mon May 9 13:41:37 UTC 2011


On 9 May 2011 15:23, Gerardo Richarte <gera at corest.com> wrote:
>
> On 05/09/2011 09:16 AM, Igor Stasenko wrote:
>>
>> Just a follow-up to recent thread.
>>
>> Suppose that we have new object format which supports multiple memory regions.
>> I.e.
>> eden space
>> old space
>> pinned space
>> ...
>> and
>> immutable space
> interesting idea indeed!
>
> no sure what immutable means, so I'm throwing here some thoughts.
>
> Immutable means that the object (imm) can't change, does it mean they
> can't also move in space? (like, immutable implies pinned?). Not necessary
> true, however if we have in mind the next question:
>
> can immutable objects only refer other immutable/pinned objects?
> otherwise when this other objects move the GC would need to update
> the references, right? (including any class pointers)
>
>    of course the GC could change the permissions of the page to update
> this objects and then set it back to read only.
>

Yes, during GC you have to enable writing to these pages anyways,
because some of immutable objects can become a garbage, and you have
to condense space somehow.
But when it runs in normal mode, it could simply protect those pages
from writing.


>    other than this, I think the idea is good, and together with
> thorough exception
> handling, it could simplify the logic in the VM. Do we have now
> immutable objects?
> do we need them? does Newspeak need immutable objects?
>
>    gera
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list