Adding a new imediate type
bryce at kampjes.demon.co.uk
Mon Jan 9 22:55:21 UTC 2006
Joerg Beekmann writes:
> In a nutshell I want to add persistance as a uniform attribute of all
> objects. The on disk representation of an object will replace object
> pointers with disk pointers. I want the additional imediate type and the
> header extension to allow translation between representations without an
> object table.
Why not use an existing Squeak object DB like Magma? Persistence is
transparent, and it supports sharing objects between images.
If you're adding an extra header to every single object in your image
then I'd think about adding it as an instance variable of
Object. You'd still probably need to run the SystemTracer to create
your new image but you wouldn't need to touch the GC. Hmm, that might
not be easy because there are a few special objects that the
interpreter knows about like CompiledMethods and contexts.
Adding a real header theoretically shouldn't be too hard. Especially
if every object has this header. I think, all of the interpreter code
accesses headers through named constants. So you could increase both
constants for the optional header words by a word. The problem is
any bug will be an GC related bug and they're not fun. Also, there's
no guarantees that some code somewhere hasn't hardcoded the constant.
I guess you could add your header after the two optional ones which
would be safer, but getting to it will be slower.
More information about the Squeak-dev