SystemTracer fixes and an extension

Tim Rowledge rowledge at interval.com
Tue Feb 9 17:31:09 UTC 1999


Yesterday I finally mailed Dan the fixes to the cloner to cope with both
the context changes in 2.3 and a problem relating to compact clas indices.
My patch also includes a small extension to the cloner that I have found
useful in creating the new CompiledMethod format images and which I suspect
might more general value.

I hope to explain what the change is in this message.

The cloner already does a great job of allowing one to leave out classes,
individual instances, change representation of particular objects etc.

However, when doing the ncm stuff I needed a way to build the new class in
the image and test it before cloning. Thus at clone-time I needed to
a) replace each compiled method with a new compiled method
b) replace the class CompiledMethod with  NewCompiledMethod
c) get rid of the now-redundant CompiledMethod class

Doing a) is easy, that is the stock in trade of the cloner.
Doing b) & c) is a little more complicated since I wanted to catch every
reference to CM and write it out as a reference to NCM and also  needed to
'clamp' CM.

To do this we need to make sure that when a ref to CM is found we not only
write out the replacement reference to NCM instead, but that we log both CM
and NCM as having been dealt with by putting _both_ into the oopmap with
the same new-oop. Thus when we find a reference to NCM (for example when
the subclass list of its superclass is scanned) it will already have been
'dealt with'. The system also has to cope with arbitrary order of finding
either of the involved objects; you cannot guarantee that one will be
spotted before the other and rely on that.

Take a look at SystemTracer>replace:withNew:class:length:trace:write: to
see the diferences from the normal #new:class:length:trace:write:. One also
needs to check Associations in order to 'correct' the value instvar if it
refers to a replaced class - you might like to imagine the debugging fun I
had getting that fine tuned!

So, if you design an entirely new Behavior hierarchy and want to use the
cloner to install it for you, I think it would now be possible.

tim
 
-- 
Useful random insult:- Has a random memory fault.
Tim Rowledge:  rowledge at interval.com (w)  +1 (650) 842-6110 (w)
 tim at sumeru.stanford.edu (h)  <http://sumeru.stanford.edu/tim>





More information about the Squeak-dev mailing list