> Hi folks: I am trying to understand ImageSegment methods like activeClasses, > swapOutInactiveClasses, discoverActiveClasses among others. One of the > comments of those methods says: > > "NOTE: discoverActiveClasses uses Squeak's ability to detect and recover > from faults due to a nil method dictionary. It staches the method dict in > with the organization during the time when discovery is in progress (Gag me > with a spoon). This is why the faults need to be cleared promptly before > resuming normal work with the system. It is also important that classes *do > not* refer directly to their method dictionary, but only via the accessor > message." > > So, it seems to HACK (it forces a fault) this MD fault recover to discover > inactive classes and other things. Ok, forget that hack for a moment. > > What questions is, what are these faults? Why a method dictionary can be in > nil ? How is this produced ? And how is it fixed? > > I saw for example this: > > Behaviour>>methodDict > methodDict == nil ifTrue: [self recoverFromMDFaultWithTrace]. > ^ methodDict > > > But again...how can that be nil ???
VM code put it to nil. The idea is that the methodDict is stored in the class or method cat and nil is put in place of the methodDict. Then when the VM detects that the methodDict is nil then it copies the methodDict stored into the category This way you know which class has been used during your interaction. We tried to use it with mathieu but we often got all the classes back on place. And it crashed a lot :) Stef > > Thank you very much. > > Marian > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
