Adding a word to Squeak's object header

Andreas Raab Andreas.Raab at gmx.de
Fri Aug 24 05:19:39 UTC 2001


Stephen,

> 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 sure hope you're running it using the InterpreterSimulator...

> 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?

Both sound reasonable to me.

> What about the plugins?  Should I be looking in there as well for code
> that hardcodes object header offsets?

Not unless they're extremely badly written. If written correctly, then the
plugins should have no knowledge whatsoever about headers and such - the
interpreter proxy exposes various functions for accessing fields in objects
(which you probably checked) and I *think* that all plugins use them. In the
rare case that you find any which do not play by the rules, please let us
know. They ought to be fixed.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list