[Vm-dev] VM Maker: Cog-eem.107.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 8 21:55:22 UTC 2013


Eliot Miranda uploaded a new version of Cog to project VM Maker:
http://source.squeak.org/VMMaker/Cog-eem.107.mcz

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

Name: Cog-eem.107
Author: eem
Time: 8 October 2013, 2:55:03.033 pm
UUID: eb9867bb-181f-4ddd-8f17-753aa210f90f
Ancestors: Cog-eem.106

Use neater wordSizeClassIndexPun & wordIndexableFormat for
free list bootstrap.

Add a "test" to write a segmented snapshot file.

=============== Diff against Cog-eem.106 ===============

Item was changed:
  ----- Method: SpurBootstrap>>allocateFreeLists (in category 'bootstrap image') -----
  allocateFreeLists
  	"Allocate the freeLists array."
  	| freeListsOop |
  	freeListsOop := newHeap
  						allocateSlots: newHeap numFreeLists
+ 						format: newHeap wordIndexableFormat
+ 						classIndex: newHeap wordSizeClassIndexPun.
- 						format: (newHeap wordSize = 4
- 									ifTrue: [newHeap firstLongFormat]
- 									ifFalse: [newHeap sixtyFourBitIndexableFormat])
- 						classIndex: (newHeap wordSize = 4
- 									ifTrue: [newHeap thirtyTwoBitLongsClassIndexPun]
- 									ifFalse: [newHeap sixtyFourBitLongsClassIndexPun]).
  	self assert: (newHeap objectAfter: newHeap trueObject) = freeListsOop.
  	0 to: newHeap numFreeLists - 1 do:
  		[:i|
  		newHeap
  			storePointerUnchecked: freeListsOop
  			ofObject: freeListsOop
  			withValue: 0]!

Item was added:
+ ----- Method: SpurBootstrap>>writeSnapshotOfTransformedImage (in category 'testing') -----
+ writeSnapshotOfTransformedImage
+ 	"The bootstrapped image typically contains a few big free chunks and one huge free chunk.
+ 	 Test snapshot writing and loading by turning the largest non-huge chunks into segment bridges
+ 	 and saving."
+ 	| heap sizes counts barriers sim |
+ 	heap := TransformedImage veryDeepCopy.
+ 	sim := StackInterpreterSimulator onObjectMemory: heap.
+ 	heap coInterpreter: sim.
+ 	sim initializeInterpreter: 0.
+ 	sizes := Bag new.
+ 	heap allObjectsInFreeTree: (heap freeLists at: 0) do:
+ 		[:f|
+ 		sizes add: (heap bytesInObject: f)].
+ 	counts := sizes sortedCounts.
+ 	self assert: counts last key = 1. "1 huge chunk"
+ 	self assert: ((counts at: counts size - 1) key > 2
+ 				and: [(counts at: counts size - 1) value > 1024]).
+ 	barriers := (1 to: (counts at: counts size - 1) key) collect:
+ 					[:ign| heap allocateOldSpaceChunkOfExactlyBytes: (counts at: counts size - 1) value].
+ 	heap segmentManager initializeFromFreeChunks: (barriers sort collect: [:b| heap objectStartingAt: b]).
+ 	sim imageName: 'spur.image'.
+ 	sim writeImageFileIO: heap !



More information about the Vm-dev mailing list