Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscogSPC-eem.2132.mcz ==================== Summary ==================== Name: VMMaker.oscogSPC-eem.2132 Author: eem Time: 17 February 2017, 12:10:50.5886 pm UUID: c4446c56-57ae-474b-b3ed-c97ca117f957 Ancestors: VMMaker.oscogSPC-eem.2131 SpurPlanningCompactor: Fix the single-pass unmarking pass. It needs to begin at firstFreeObject, not lastMobileObject!! Spur: provide isUnmarked: for debugging with printOopsSuchThat:. remember the first unmarked object found by allObjectsUnmarked in the bogon variable, and keep hold on to it via printBogons so it is not deleted by the C optimizer. =============== Diff against VMMaker.oscogSPC-eem.2131 =============== Item was changed: CogClass subclass: #SpurMemoryManager (excessive size, no diff calculated) Item was changed: ----- Method: SpurMemoryManager>>allObjectsUnmarked (in category 'gc - global') ----- allObjectsUnmarked self allObjectsDo: + [:o| (self isMarked: o) ifTrue: [bogon := o. ^false]]. - [:o| (self isMarked: o) ifTrue: [^false]]. ^true! Item was added: + ----- Method: SpurMemoryManager>>isUnmarked: (in category 'header access') ----- + isUnmarked: objOop + "For debugging using printOopsSuchThat:" + <api> + ^(self isMarked: objOop) not! Item was added: + ----- Method: SpurMemoryManager>>printBogons (in category 'debug printing') ----- + printBogons + <api> + compactor printTheBogons: bogon! Item was added: + ----- Method: SpurPigCompactor>>printTheBogons: (in category 'debug support') ----- + printTheBogons: aBogon + <inline: true> + coInterpreter + print: 'bogon '; printHexnp: aBogon; cr! Item was changed: ----- Method: SpurPlanningCompactor>>copyAndUnmark: (in category 'compaction') ----- copyAndUnmark: firstPass "Sweep the heap, unmarking all objects and moving mobile objects to their correct positions, restoring their savedFirstFields." <inline: #never> | finalPass | self logPhase: 'copying and unmarking...'. firstPass ifTrue: [self unmarkInitialImmobileObjects]. finalPass := self copyAndUnmarkMobileObjects. (self thereAreObjectsToMove and: [finalPass not and: [biasForGC]]) ifTrue: "only ever one pass if biasForGC is true." + [self unmarkObjectsFromFirstFreeObject]! - [self unmarkObjectsAfterLastMobileObject]! Item was added: + ----- Method: SpurPlanningCompactor>>printTheBogons: (in category 'debug support') ----- + printTheBogons: aBogon + <inline: true> + coInterpreter + print: 'bogon '; printHexnp: aBogon; cr; + print: 'anomaly '; printHexnp: anomaly; cr! Item was added: + ----- Method: SpurPlanningCompactor>>unmarkObjectsFromFirstFreeObject (in category 'compaction') ----- + unmarkObjectsFromFirstFreeObject + "Sweep the final immobile heap, freeing and coalescing unmarked and free objects, + and unmarking all marked objects up to the end of memory." + | startOfFree freeBytes | + freeBytes := 0. + manager allOldSpaceEntitiesFrom: firstFreeObject do: + [:o| + self check: o. + (manager isMarked: o) + ifFalse: + [startOfFree ifNil: [startOfFree := manager startOfObject: o]. + freeBytes := freeBytes + (manager bytesInObject: o)] + ifTrue: + [startOfFree ifNotNil: + [manager addFreeChunkWithBytes: freeBytes at: startOfFree. + startOfFree := nil. + freeBytes := 0]. + (manager isPinned: o) + ifTrue: [self unmarkPinned: o] + ifFalse: [manager setIsMarkedOf: o to: false]]]! |
Free forum by Nabble | Edit this page |