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

commits at source.squeak.org commits at source.squeak.org
Thu Jun 12 22:20:37 UTC 2014


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

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

Name: Cog-eem.157
Author: eem
Time: 12 June 2014, 3:20:20.665 pm
UUID: cba88616-6d92-4085-a936-40403beaa944
Ancestors: Cog-tpr.156

Fix SpurBootstrap now that pigCompact leaves no empty
chunks.  Needs VMMaker.oscog-eem.770.  Have
SpurBootstrapMonticelloPackagePatcher create the output
directory if needed.

Provide default writePopPushDetailsIn:in:for: for the processor
aliens that doen't implement it.

=============== Diff against Cog-tpr.156 ===============

Item was added:
+ ----- Method: CogProcessorAlien>>writePopPushDetailsIn:in:for: (in category 'printing') -----
+ writePopPushDetailsIn:  memory in: transcript for: aCogit
+ 	"This is for debugging the ARM.  By default do nothing.  GdbARMAlien overrides."!

Item was changed:
+ ----- Method: GdbARMAlien>>writePopPushDetailsIn:in:for: (in category 'printing') -----
- ----- Method: GdbARMAlien>>writePopPushDetailsIn:in:for: (in category 'execution simulation') -----
  writePopPushDetailsIn:  memory in: transcript for: aCogit
  "if the next instruction is a pop or push, or a ldr/str that touches the SP, write the details ontranscript"
  	| instr |
  
  	[ instr := memory unsignedLongAt: self pc + 1 bigEndian: false] on: Error do:[:ex| ^self].
  	(self instructionIsPop: instr) ifTrue:[transcript tab; nextPutAll: 'pop ', (memory unsignedLongAt: self sp + 1 bigEndian: false) hex , ' from ', (self sp hex); cr].
  	(self instructionIsPush: instr) ifTrue:[transcript tab; nextPutAll: 'push ', (self register: ((instr bitAnd: 16rF000) >>12)) hex , ' to ', (self sp -4) hex; cr].
  
  	(self instructionIsLDRSP: instr)  ifTrue:[| val|
  		val := self r10 > memory size
  			ifTrue:[aCogit simulatedVariableAt: self r10]
  			ifFalse:[memory unsignedLongAt: self r10 + 1 bigEndian: false].
  		transcript tab; nextPutAll: 'load SP', val hex , ' from ', (self r10) hex; cr].
  
  	(self instructionIsSTRSP: instr)  ifTrue:[transcript tab; nextPutAll: 'store SP', (self sp) hex , ' to ', (self r10) hex; cr].!

Item was changed:
  ----- Method: SpurBootstrap>>writeSnapshot:ofTransformedImage:headerFlags:screenSize: (in category 'testing') -----
  writeSnapshot: imageFileName ofTransformedImage: spurHeap headerFlags: headerFlags screenSize: screenSizeInteger
  	"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."
  	| penultimate ultimate sizes counts barriers sim |
  	sim := StackInterpreterSimulator onObjectMemory: spurHeap.
  	sim bootstrapping: true.
+ 	spurHeap
+ 		coInterpreter: sim;
+ 		setEndOfMemory: spurHeap endOfMemory + spurHeap bridgeSize. "hack; initializeInterpreter: cuts it back by bridgeSize"
- 	spurHeap coInterpreter: sim.
  	sim initializeInterpreter: 0;
  		setImageHeaderFlagsFrom: headerFlags;
  		setDisplayForm: (Form extent: screenSizeInteger >> 16 @ (screenSizeInteger bitAnd: 16rFFFF)).
  	spurHeap allOldSpaceEntitiesDo: [:e| penultimate := ultimate. ultimate := e].
+ 	(spurHeap isFreeObject: penultimate) ifTrue: "old, pre-pigCompact segmented save"
+ 		[self assert: (spurHeap isSegmentBridge: ultimate).
+ 		 sizes := Bag new.
+ 		 spurHeap allObjectsInFreeTree: (spurHeap freeLists at: 0) do:
+ 			[:f|
+ 			sizes add: (spurHeap bytesInObject: f)].
+ 		 counts := sizes sortedCounts.
+ 		 self assert: counts last key = 1. "1 huge chunk"
+ 		 counts size > 1
+ 			ifTrue:
+ 				[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| spurHeap allocateOldSpaceChunkOfExactlyBytes: (counts at: counts size - 1) value].
+ 				barriers := barriers, {spurHeap allocateOldSpaceChunkOfExactlyBytes: (spurHeap bytesInObject: penultimate)}]
+ 			ifFalse:
+ 				[barriers := {spurHeap allocateOldSpaceChunkOfExactlyBytes: (spurHeap bytesInObject: penultimate)}].
+ 		 barriers last ifNotNil:
+ 			[:end|
+ 			spurHeap setEndOfMemory: end.
+ 			spurHeap allOldSpaceEntitiesDo: [:e| penultimate := ultimate. ultimate := e].
+ 			self assert: (spurHeap addressAfter: ultimate) = end]].
- 	self assert: (spurHeap isFreeObject: penultimate).
- 	self assert: (spurHeap isSegmentBridge: ultimate).
- 	sizes := Bag new.
- 	spurHeap allObjectsInFreeTree: (spurHeap freeLists at: 0) do:
- 		[:f|
- 		sizes add: (spurHeap bytesInObject: f)].
- 	counts := sizes sortedCounts.
- 	self assert: counts last key = 1. "1 huge chunk"
- 	counts size > 1
- 		ifTrue:
- 			[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| spurHeap allocateOldSpaceChunkOfExactlyBytes: (counts at: counts size - 1) value].
- 			barriers := barriers, {spurHeap allocateOldSpaceChunkOfExactlyBytes: (spurHeap bytesInObject: penultimate)}]
- 		ifFalse:
- 			[barriers := {spurHeap allocateOldSpaceChunkOfExactlyBytes: (spurHeap bytesInObject: penultimate)}].
- 	barriers last ifNotNil:
- 		[:end|
- 		spurHeap setEndOfMemory: end.
- 		spurHeap allOldSpaceEntitiesDo: [:e| penultimate := ultimate. ultimate := e].
- 		self assert: (spurHeap addressAfter: ultimate) = end].
  	spurHeap checkFreeSpace.
  	spurHeap runLeakCheckerForFullGC: true.
+ 	barriers ifNotNil: "old, pre-pigCompact segmented save"
+ 		[spurHeap segmentManager initializeFromFreeChunks: (barriers sort collect: [:b| spurHeap objectStartingAt: b])].
- 	spurHeap segmentManager initializeFromFreeChunks: (barriers sort collect: [:b| spurHeap objectStartingAt: b]).
  	spurHeap checkFreeSpace.
  	spurHeap runLeakCheckerForFullGC: true.
  	sim bereaveAllMarriedContextsForSnapshotFlushingExternalPrimitivesIf: true.
  	sim imageName: imageFileName.
  	sim writeImageFileIO!

Item was changed:
  ----- Method: SpurBootstrapMonticelloPackagePatcher>>patch (in category 'patching') -----
  patch
  	"(SpurBootstrapMonticelloPackagePatcher new
  			from: '/Users/eliot/Squeak/Squeak4.5-spur/squeakv3-package-cache'
  			to: '/Users/eliot/Squeak/Squeak4.5-spur/package-cache')
  		patch"
  	"(SpurBootstrapMonticelloPackagePatcher new
  			from: '/Users/eliot/Glue/repositories/nsboot/Squeak4.3/squeak-package-cache'
  			to: '/Users/eliot/Glue/repositories/nsboot/Squeak4.3/package-cache')
  		patch"
+ 	
+ 	sourceDir exists ifFalse:
+ 		[self error: 'source directory doest not exist'].
+ 	destDir assureExistence.
- 	(sourceDir exists and: [destDir exists]) ifFalse:
- 		[self error: 'one or both of the directories don''t exist'].
  	self packagesAndPatches keysAndValuesDo:
  		[:package :patches|
  		 (self filesForPackage: package in: sourceDir) do:
  			[:packageFile|
  			 self patchPackage: packageFile with: patches for: package]]!



More information about the Vm-dev mailing list