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

commits at source.squeak.org commits at source.squeak.org
Fri Oct 11 17:10:05 UTC 2013


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

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

Name: Cog-eem.113
Author: eem
Time: 11 October 2013, 10:09:35.348 am
UUID: 79cf1a1f-f091-4e6d-921f-610983da576e
Ancestors: Cog-eem.112

Set the display size in the saved transformed Spur image.

=============== Diff against Cog-eem.112 ===============

Item was changed:
  Object subclass: #SpurBootstrap
  	instanceVariableNames: 'oldHeap newHeap oldHeapSize newHeapSize map reverseMap classToIndex oldInterpreter lastClassTablePage literalMap methodClasses installedPrototypes sizeSym rehashSym classMetaclass'
+ 	classVariableNames: 'ImageHeaderFlags ImageName ImageScreenSize TransformedImage'
- 	classVariableNames: 'ImageHeaderFlags ImageName TransformedImage'
  	poolDictionaries: 'VMObjectIndices'
  	category: 'Cog-Bootstrapping'!
  
  !SpurBootstrap commentStamp: 'eem 9/11/2013 05:45' prior: 0!
  SpurBootstrap bootstraps an image in SpurMemoryManager format from a Squeak V3 + closures format.
  
  e.g.
  	(SpurBootstrap32 new on: '/Users/eliot/Cog/startreader.image')
  		transform;
  		launch
  
  Bootstrap issues:
  - should it implement a deterministic Symbol identityHash? This means set a Symbol's identityHash at instance creation time
    based on its string hash so that e.g. MethodDIctionary instances have a deterministic order and don't need to be rehashed on load.
  - should it collapse ContextPart and MethodContext down onto Context (and perhaps eliminate BlockContext)?
  
  Instance Variables
  	classToIndex:			<Dictionary>
  	lastClassTablePage:	<Integer>
  	map:					<Dictionary>
  	methodClasses:		<Set>
  	newHeap:				<SpurMemoryManager>
  	oldHeap:				<NewObjectMemory>
  	oldInterpreter:			<StackInterpreterSimulator>
  	reverseMap:			<Dictionary>
  	symbolMap:				<Dictionary>
  
  classToIndex
  	- oldClass to new classIndex map
  
  lastClassTablePage
  	- oop in newHeap of last classTable page.  U<sed in validation to filter-out class table.
  
  methodClasses
  	- cache of methodClassAssociations for classes in which modified methods are installed
  
  map
  	- oldObject to newObject map
  
  newHeap
  	- the output, bootstrapped image
  
  oldHeap
  	- the input, image
  
  oldInterpreter
  	- the interpreter associated with oldHeap, needed for a hack to grab WeakArray
  
  reverseMap
  	- newObject to oldObject map
  
  symbolMap
  	- symbol toi symbol oop in oldHeap, used to map prototype methdos to methods in oldHeap!

Item was changed:
  ----- Method: SpurBootstrap>>saveTransformedImage (in category 'development support') -----
  saveTransformedImage
  	ImageHeaderFlags := oldInterpreter getImageHeaderFlags.
+ 	ImageScreenSize := oldInterpreter savedWindowSize.
  	ImageName := oldInterpreter imageName.
  	newHeap coInterpreter: nil.
  	(newHeap class allInstVarNames select: [:ivn| ivn beginsWith: 'stat']) do:
  		[:ivn| newHeap instVarNamed: ivn put: 0].
  	TransformedImage := newHeap veryDeepCopy!

Item was changed:
  ----- 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."
  	| last heap sizes counts barriers sim |
  	heap := TransformedImage veryDeepCopy.
  	sim := StackInterpreterSimulator onObjectMemory: heap.
  	heap coInterpreter: sim.
  	sim initializeInterpreter: 0;
+ 		setImageHeaderFlagsFrom: ImageHeaderFlags;
+ 		setDisplayForm: (Form extent: ImageScreenSize >> 16 @ (ImageScreenSize bitAnd: 16rFFFF)).
- 		setImageHeaderFlagsFrom: ImageHeaderFlags.
  	heap allOldSpaceEntitiesDo: [:e| last := e].
  	self assert: (heap isFreeObject: last).
  	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].
  	barriers := barriers, {heap allocateOldSpaceChunkOfExactlyBytes: (heap bytesInObject: last)}.
  	heap setEndOfMemory: barriers last.
  	heap allOldSpaceEntitiesDo: [:e| last := e].
  	self assert: (heap addressAfter: last) = barriers last.
  	heap checkFreeSpace.
  	heap runLeakCheckerForFullGC: true.
  	heap segmentManager initializeFromFreeChunks: (barriers sort collect: [:b| heap objectStartingAt: b]).
  	heap checkFreeSpace.
  	heap runLeakCheckerForFullGC: true.
  	sim imageName: 'spur.image'.
  	sim writeImageFileIO!



More information about the Vm-dev mailing list