modification of ContextPart?

Bryce Kampjes bryce at kampjes.demon.co.uk
Sat Nov 12 17:53:58 UTC 2005


Michael Haupt writes:
 > Hi,
 > 
 > I'd like to do some VM hacking. In particular, I'd like, as a first
 > step, to add a field to the ContextPart class. That does not work in
 > Squeak itself; it keeps telling me that this class cannot be modified.
 > 
 > So far, that's understandable.
 > 
 > But what steps do I need to take to add that field to the class? I
 > have obtained the VM sources, but where in there is ContextPart, or
 > its counterpart?

That's going to be a hard modification to make. The problem is the VM
directly deals with context objects. Even the GC needs to know where
the the stack pointer is located, and where the stack top is so it
will only collect live stack locations.

Look at Interpreter>>activateNewMethod, it accesses the context fairly
heavily. It should give you enough knowledge to find other references.

Also, if you add a variable how are you going to migrate your image?
I'd guess that you're going to need to use the SystemTracer to create
a new image with your new variable in it. Then those images will only
run with your modified VMs.

There may be a better way to achieve your goals.

Bryce



More information about the Squeak-dev mailing list