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

commits at source.squeak.org commits at source.squeak.org
Tue Oct 8 17:43:44 UTC 2013


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

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

Name: Cog-eem.106
Author: eem
Time: 8 October 2013, 10:43:28.787 am
UUID: f62ab9c1-dec9-4bd3-93ea-b8506da65428
Ancestors: Cog-ClementBera.105

Merge with Cog-ClementBera.105.  Fix a Stream extension category name.

Spur Bootstrap:
Move freeLists to heap, immediately following trueObj.

Make freeLists size of a machine word. 98.8% of objects are <= 31
allocationUnits in size in the 32-bit VM.  So making freeListsMask
64-bits doesn't make sense.  Best keep it in 32-bits and have it fit
in a register.

=============== Diff against Cog-ClementBera.105 ===============

Item was changed:
  SystemOrganization addCategory: #Cog!
  SystemOrganization addCategory: #'Cog-Benchmarks-DeltaBlue'!
  SystemOrganization addCategory: #'Cog-Benchmarks-Richards'!
  SystemOrganization addCategory: #'Cog-Benchmarks-SMark'!
  SystemOrganization addCategory: #'Cog-Benchmarks-Shootout'!
  SystemOrganization addCategory: #'Cog-Bootstrapping'!
  SystemOrganization addCategory: #'Cog-Morphing Bytecode Set'!
  SystemOrganization addCategory: #'Cog-ProcessorPlugins'!
  SystemOrganization addCategory: #'Cog-Processors'!
  SystemOrganization addCategory: #'Cog-Processors-Tests'!
  SystemOrganization addCategory: #'Cog-Scripting'!
  SystemOrganization addCategory: #'Cog-Scripts'!
  SystemOrganization addCategory: #'Cog-Tests'!
+ SystemOrganization addCategory: #'Cog-Benchmarks'!

Item was added:
+ ----- Method: SpurBootstrap>>allocateFreeLists (in category 'bootstrap image') -----
+ allocateFreeLists
+ 	"Allocate the freeLists array."
+ 	| freeListsOop |
+ 	freeListsOop := newHeap
+ 						allocateSlots: newHeap numFreeLists
+ 						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 changed:
  ----- Method: SpurBootstrap>>bootstrapImage (in category 'bootstrap image') -----
  bootstrapImage
  	oldHeap fullGC.
  	oldHeapSize := oldHeap freeStart.
  	Transcript cr; nextPutAll: 'transforming image...'; flush.
  	self cloneNilTrueAndFalse.
+ 	self allocateFreeLists.
  	self buildClassMap.
  	self allocateClassTable.
  	self cloneObjects.
  	self fillInObjects.
  	self fillInClassTable.
  	newHeapSize := newHeap freeStart.
  	newHeap initializePostBootstrap!

Item was changed:
  ----- Method: SpurBootstrap>>validate (in category 'bootstrap image') -----
  validate
  	| p n duplicates maxClassIndex |
  	self assert: (reverseMap at: newHeap specialObjectsOop) = oldHeap specialObjectsOop.
  	self assert: (map at: oldHeap specialObjectsOop) = newHeap specialObjectsOop.
  	self assert: (reverseMap at: newHeap classTableRootObj ifAbsent: []) isNil.
  
  	duplicates := { 3. newHeap arrayClassIndexPun. newHeap weakArrayClassIndexPun }.
  	maxClassIndex := classToIndex inject: 0 into: [:a :b| a max: b].
  	self assert: ((newHeap arrayClassIndexPun to: maxClassIndex) select:
  					[:idx| | classObj |
  					(classObj := newHeap classAtIndex: idx) ~= newHeap nilObject
  					and: [(newHeap classIndexOf: classObj) = (newHeap rawHashBitsOf: classObj)]]) isEmpty.
  	0 to: maxClassIndex do:
  		[:index| | classObj |
  		(index <= newHeap tagMask
  		 and: [index > newHeap isForwardedObjectClassIndexPun]) ifTrue:
  			[(classObj := newHeap classAtIndex: index) = newHeap nilObject
  				ifTrue:
  					[self assert: (classToIndex keyAtValue: index ifAbsent: []) isNil]
  				ifFalse:
  					[self assert: (newHeap classIndexOf: classObj) ~= (newHeap rawHashBitsOf: classObj).
  					(duplicates includes: index) ifFalse:
  						[self assert: (newHeap rawHashBitsOf: classObj) = index]]]].
  	classToIndex keysAndValuesDo:
  		[:oldClass :idx|
  		self assert: (newHeap rawHashBitsOf: (map at: oldClass)) = idx. 
  		self assert: oldClass = (reverseMap at: (newHeap classAtIndex: idx))].
  	n := 0.
  	newHeap allObjectsDo:
  		[:o|
  		(o <= newHeap trueObject
  		 or: [o > lastClassTablePage]) ifTrue:
  			[self assert: (reverseMap includesKey: o).
  			 self assert: (newHeap fetchClassOfNonImm: o) = (map at: (oldHeap fetchClassOfNonImm: (reverseMap at: o)))].
  		n := n + 1.
  		p := o].
  	p class.
+ 	self assert: (n between: map size and: map size + 6). "+ 6 is room for freelists & classTable"
- 	self assert: (n between: map size and: map size + 5). "+ 5 is room for classTable"
  
  	"check some class properties to ensure the format changes are correct"
  	self assert: (newHeap fixedFieldsOfClassFormat: (newHeap formatOfClass: newHeap classArray)) = 0.
  	self assert: (newHeap instSpecOfClassFormat: (newHeap formatOfClass: newHeap classArray)) = newHeap arrayFormat!

Item was changed:
+ ----- Method: Stream>>nl (in category '*Cog-Benchmarks-Shootout-platform') -----
- ----- Method: Stream>>nl (in category '*Cog-Benchmarks-Shootout-Shootout-Shootout-platform') -----
  nl
     self nextPut: Character lf!

Item was changed:
+ ----- Method: Stream>>print:digits: (in category '*Cog-Benchmarks-Shootout-platform') -----
- ----- Method: Stream>>print:digits: (in category '*Cog-Benchmarks-Shootout-Shootout-Shootout-platform') -----
  print: number digits: decimalPlaces
     | precision rounded |
     decimalPlaces <= 0 ifTrue: [^ number rounded printString].
     precision := Utilities floatPrecisionForDecimalPlaces: decimalPlaces.
     rounded := number roundTo: precision.
     self nextPutAll: 
        ((rounded asScaledDecimal: decimalPlaces) printString copyUpTo: $s)!

Item was changed:
+ ----- Method: Stream>>print:paddedTo: (in category '*Cog-Benchmarks-Shootout-platform') -----
- ----- Method: Stream>>print:paddedTo: (in category '*Cog-Benchmarks-Shootout-Shootout-Shootout-platform') -----
  print: number paddedTo: width
     self nextPutAll: (number printStringLength: width padded: false)!



More information about the Vm-dev mailing list