Adding a word to Squeak's object header

Stephen Pair spair at advantive.com
Fri Aug 24 04:45:16 UTC 2001


I'm trying to add 4 bytes to the object header (mainly for educational
purposes)...but I'm having a terrible time getting it work.  I've been
able to use the SystemTracer to produce what I think is a clone with the
extra header bytes inserted (and I've successfully tested a regular
clone), however, I can't get it to run successfully on a modified VM.

I've tried adding the new header word before the oop (oop - 4) and
sliding the class and size headers further back.  I've also tried
increasing BaseHeaderSize to 8 (from 4) such that the new word follows
the normal base header.  Which is the best approach?  I've picked
through almost all of the methods in ObjectMemory and Interpreter
looking for hardcoded assumptions about the structure of the header.
What about the plugins?  Should I be looking in there as well for code
that hardcodes object header offsets?

I'm not familiar enough with the VM code to know what kind of snafus I
should be looking for.  I'm hoping someone who's been there and done it
before might have some tips.

Cheers,
Stephen





More information about the Squeak-dev mailing list