[Vm-dev] VM Maker: VMMaker.oscog-eem.2042.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Dec 17 20:36:05 UTC 2016

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

==================== Summary ====================

Name: VMMaker.oscog-eem.2042
Author: eem
Time: 17 December 2016, 12:35:26.951861 pm
UUID: 6c0ea7a2-25c3-4375-9ca0-f865eb2197ed
Ancestors: VMMaker.oscog-eem.2041

Refactor globalGarbageCollect to do the scavenge outside of the compactor.

Provide the mechanism to specify a different compactor.

=============== Diff against VMMaker.oscog-eem.2041 ===============

Item was changed:
  ----- Method: SpurMemoryManager class>>compactorClass (in category 'accessing class hierarchy') -----
  	"Answer the compaction algorithm to use."
+ 	^Smalltalk classNamed: (initializationOptions at: #compactorClass ifAbsent: [#SpurPigCompactor])!
- 	^SpurPigCompactor!

Item was changed:
  ----- Method: SpurMemoryManager>>globalGarbageCollect (in category 'gc - global') -----
  	<inline: true> "inline into fullGC"
  	self assert: self validObjStacks.
  	self assert: (self isEmptyObjStack: markStack).
  	self assert: (self isEmptyObjStack: weaklingStack).
+ 	"Mark objects /before/ scavenging, to empty the rememberedTable of unmarked roots."
  	self markObjects: true.
+ 	scavenger forgetUnmarkedRememberedObjects.
+ 	self doScavenge: MarkOnTenure.
+ 	segmentManager prepareForGlobalSweep. "for notePinned:"
  	compactor freeUnmarkedObjectsAndPrepareFreeSpace.
  	"Mid-way the leak check must be more lenient.  Unmarked classes will have been
  	 expunged from the table, but unmarked instances will not yet have been reclaimed."
  	self runLeakCheckerFor: GCModeFull
  		excludeUnmarkedNewSpaceObjs: true
  		classIndicesShouldBeValid: true.
  	compactor compact.
  	self setHeapSizeAtPreviousGC.
  	self assert: self validObjStacks.
  	self assert: (self isEmptyObjStack: markStack).
  	self assert: (self isEmptyObjStack: weaklingStack).
  	self assert: self allObjectsUnmarked.
  	self runLeakCheckerFor: GCModeFull!

Item was changed:
  ----- Method: SpurPigCompactor>>freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact (in category 'compaction') -----
  	"Sweep all of old space, freeing unmarked objects, coalescing free chunks, and sorting free space.
  	 Doubly-link the free chunks in address order through the freeChunkNextIndex field using the
  	 xor trick to use only one field, see e.g.
  		The Art of Computer Programming, Vol 1, D.E. Knuth, 3rd Ed, Sec 2.2.4 `Circular Lists', exercise. 18
  	 Record the lowest free object in firstFreeChunk and the highest in lastFreeChunk.
  	 Let the segmentManager mark which segments contain pinned objects via notePinned:."
  	| prevPrevFree prevFree |
  	<inline: #never> "for profiling"
  	manager checkFreeSpace: GCModeFull.
- 	scavenger forgetUnmarkedRememberedObjects.
- 	manager doScavenge: MarkOnTenure.
- 	manager segmentManager prepareForGlobalSweep."for notePinned:"
  	"throw away the list heads, including the tree."
  	manager resetFreeListHeads.
  	firstFreeChunk := prevPrevFree := prevFree := 0.
  	manager allOldSpaceEntitiesForCoalescingFrom: manager firstObject do:
  		 self assert: (firstFreeChunk = 0 or: [manager isFreeObject: firstFreeChunk]).
  		 (manager isMarked: o)
  			ifTrue: "forwarders should have been followed in markAndTrace:"
  				[self assert: (manager isForwarded: o) not.
  				 manager setIsMarkedOf: o to: false. "this will unmark bridges. undo the damage in notePinned:"
  				 (manager isPinned: o) ifTrue:
  					[manager segmentManager notePinned: o]]
  			ifFalse: "unmarked; two cases, an unreachable object or a free chunk."
  				[| here |
  				 self assert: (manager isRemembered: o) not. "scavenger should have cleared this above"
  				 here := manager coallesceFreeChunk: o.
  				 manager setObjectFree: here.
  				 self inSortedFreeListLink: prevFree to: here given: prevPrevFree.
  				 prevPrevFree := prevFree.
  				 prevFree := here]].
  	prevFree ~= firstFreeChunk ifTrue:
  		[manager storePointer: manager freeChunkNextIndex
  			ofFreeChunk: prevFree
  			withValue: prevPrevFree].
  	lastFreeChunk := prevFree.
  	self inSortedFreeListLink: lastFreeChunk to: 0 given: prevPrevFree.
  	self assert: self checkTraversableSortedFreeList!

More information about the Vm-dev mailing list