'From Squeak3.1alpha of 5 February 2001 [latest update: #4075] on 25 May 2001 at 3:10 pm'! "Change Set: GCWeakScanFixNOT Date: 25 May 2001 Author: Dan Ingalls Reverts an attempt to avoid scanning weak arrays that are roots (in old space pointing to new space). This won't work without a mechanism for rectifying obsolete pointers in the root. Also the fast freeing (if we bothered to make this work) would compromise the current use of weak arrays as caches. "! !ObjectMemory methodsFor: 'gc -- mark and sweep' stamp: 'di 10/6/1999 10:02'! markAndTrace: oop "Mark all objects reachable from the given one. Trace from the given object even if it is old. Do not trace if it is already marked. Mark it only if it is a young object." "Tracer state variables: child object being examined field next field of child to examine parentField field where child was stored in its referencing object" | header lastFieldOffset action | header _ self longAt: oop. (header bitAnd: MarkBit) = 0 ifFalse: [^ 0 "already marked"]. "record tracing status in object's header" header _ (header bitAnd: AllButTypeMask) bitOr: HeaderTypeGC. oop >= youngStart ifTrue: [ header _ header bitOr: MarkBit ]. "mark only if young" self longAt: oop put: header. "initialize the tracer state machine" parentField _ GCTopMarker. child _ oop. lastFieldOffset _ self lastPointerOf: oop. field _ oop + lastFieldOffset. action _ StartField. "run the tracer state machine until all objects reachable from oop are marked" [action = Done] whileFalse: [ action = StartField ifTrue: [ action _ self startField ]. action = StartObj ifTrue: [ action _ self startObj ]. action = Upward ifTrue: [ action _ self upward ]. ].! !