| |
ImageSegmentRootStub
category: System-Object Storage
superclass: ProtoObject
subclasses:
An ImageSegmentRootStub is a stub that replaces one of the root of an ImageSegment that has been extracted from the Squeak ObjectMemory. It has two very simple roles:
1. If any message is sent to one of these objects, it will be caught by doesNotUnderstand:, and bring about a reinstallation of the missing segment. This exception is caused by the fact that no other messages are defined in this class, and neither does it inherit any from above, since its superclass is nil. When the reinstallation has been accomplished, the message will be resent as though nothing was amiss.
2. If one of these objects is a class, and a message is sent to one of its instances, it will cause a similar fault which will be caught by cannotInterpret:. This exception is caused by a somewhat more subtle condition: the primitive operations of the virtual machine do not have time to check whether classes are resident or not -- they assume that all classes are resident. However every non-cached message lookup does test for a nil in the methodDictionary slot. If a rootStub replaces a class (or any behavior), it masquerades as the class, but it will have a nil in the slot where the method Dictionary is expected. This will cause the VM to send cannotInterpret:, eventually leading to the same process for reinstalling the missing segment and resending the message as above.
Just to be on the safe side, a rootStub that replaces a Behavior also carries a copy of both the superclass and format fields from the original class. This insures that, even if some operations of the VM require these values, things will continue to operate properly when the segment is absent.




|
|