Adding a word to Squeak's object header
Stephen Pair
spair at acm.org
Fri Aug 24 21:43:50 UTC 2001
Thanks for the tips (all)...
Regarding the Slang Interpreter and the Interpreter Simulator, let me
just say: thank you! thank you! thank you! What a nice piece of work!
- Stephen
> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On
> Behalf Of Dan Ingalls
> Sent: Friday, August 24, 2001 1:15 AM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Re: Adding a word to Squeak's object header
>
>
> "Stephen Pair" <spair at advantive.com> wrote...
>
> >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.
>
> Stephen -
>
> You go, guy!
>
> This is likely a tough one to do. There are probably lots of
> places that expect the base header to be where the oop
> points, and it may be hard to track them all down.
>
> If you increase BaseHeaderSize, I think you still want to
> leave the base header at 0, and insert your new word at -4.
>
> Another approach would be to force all headers to be 4 (count
> 'em) words long -- like the current three-word headers plus
> your additional word at oop-12. Even before this, you may
> want to get rid of compact classes, but I think they'll still
> work with big headers (and I think the quick checks for
> contexts expect they have compact class fields). Hope this helps.
>
> I assume you are running the simulator to try it out. Check
> the integrity of the entire memory between every bytecode at first.
>
> Good luck.
>
> - Dan
> --
>
>
More information about the Squeak-dev
mailing list
|