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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 18 21:39:42 UTC 2014


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

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

Name: Cog-eem.229
Author: eem
Time: 18 December 2014, 1:39:22.561 pm
UUID: 9d911f27-07b2-406f-8b8c-59684644d6a9
Ancestors: Cog-eem.228

Spur Bootstrap:
Map floats that can be to immediate floats.
Add a prototype for SmallInteger>>decimalDigitLength
that copes with 64-bit SmallIntegers.

=============== Diff against Cog-eem.228 ===============

Item was changed:
  ----- Method: Spur32to64BitBootstrap>>cloneObjects (in category 'bootstrap image') -----
  cloneObjects
  	"Clone all normal objects.  Of hidden objects only clone the freeLists object and
  	 the classTableRoot and class table pages. In particular, dont clone objStacks.
  	 The refs to the objStacks are nilled out in fillInHeap."
+ 	| i freeListsObject |
+ 	i := 0.
- 	| freeListsObject |
  	freeListsObject := heap32 freeListsObject.
  	heap32 allOldSpaceObjectsDo:
+ 		[:obj32|
+ 		(i := i + 1) >= 100000 ifTrue:
+ 			[Transcript nextPut: $:; flush. i := 0].
+ 		 obj32 = freeListsObject
- 		[:obj32| | classIndex value |
- 		classIndex := heap32 classIndexOf: obj32.
- 		obj32 = freeListsObject
  			ifTrue:
  				[self cloneFreeLists: obj32]
  			ifFalse:
+ 				[(self shouldClone: obj32) ifTrue:
+ 					[self clone: obj32]]]!
- 				[(heap32 isValidObjStackPage: obj32) ifFalse:
- 					[((classIndex between: ClassLargeNegativeIntegerCompactIndex and: ClassLargePositiveIntegerCompactIndex)
- 					  and: [interpreter32 initPrimCall.
- 						value := interpreter32 signed64BitValueOf: obj32.
- 						interpreter32 failed not
- 					  and: [heap64 isIntegerValue: value]]) ifFalse:
- 						[self clone: obj32]]]]!

Item was changed:
  ----- Method: Spur32to64BitBootstrap>>fillInObjects (in category 'bootstrap image') -----
  fillInObjects
  	"interpreter32 printOop: obj32"
+ 	| i |
  	{heap32 markStack. heap32 weaklingStack. heap32 ephemeronQueue} do:
  		[:obj|
  		obj ~= heap32 nilObject ifTrue:
  			[map at: obj put: (map at: heap32 nilObject)]].
+ 	i := 0.
  	heap32 allObjectsDo:
  		[:obj32|
+ 		(i := i + 1) >= 10000 ifTrue:
+ 			[Transcript nextPut: $.; flush. i := 0].
  		(map at: obj32 ifAbsent: nil)
  			ifNotNil:
  				[:obj64| | format classIndex |
  				(heap64 numSlotsOf: obj64) > 0 ifTrue: "filter-out filtered objStack pages"
  					[format := heap32 formatOf: obj32.
  					 (heap64 isPointersFormat: format)
  						ifTrue:
  							[((heap64 isIndexableFormat: format)
  								and: [(classIndex := heap64 classIndexOf: obj64) <= ClassBlockClosureCompactIndex
  								and: [classIndex >= ClassMethodContextCompactIndex]])
  								ifTrue: [self fillInPointerObjectWithPC: obj64 from: obj32]
  								ifFalse: [self fillInPointerObject: obj64 from: obj32]]
  						ifFalse:
  							[(heap64 isCompiledMethodFormat: format)
  								ifTrue: [self fillInCompiledMethod: obj64 from: obj32]
  								ifFalse: [self fillInBitsObject: obj64 from: obj32]]]]
  			ifNil: [self assert: (self isUnmappedObject: obj32)]]!

Item was changed:
  ----- Method: Spur32to64BitBootstrap>>isUnmappedObject: (in category 'bootstrap image') -----
  isUnmappedObject: obj32
  	"Answer if obj32 is an object that is not cloned by the bootstrap."
  	^((heap32 classIndexOf: obj32)
  			between: ClassLargeNegativeIntegerCompactIndex
+ 			and: ClassFloatCompactIndex)
- 			and: ClassLargePositiveIntegerCompactIndex)
  	  or: [obj32 = heap32 freeListsObject
+ 	  or: [(heap32 isValidObjStackPage: obj32)]]!
- 	  or: [heap32 isValidObjStackPage: obj32]]!

Item was changed:
  ----- Method: Spur32to64BitBootstrap>>map32BitOop: (in category 'bootstrap image') -----
+ map32BitOop: obj32
+ 	"interpreter32 printOop: obj32"
- map32BitOop: oop32
- 	"interpreter32 printOop: oop32"
  	^map
+ 		at: obj32
- 		at: oop32
  		ifAbsent:
+ 			[(heap32 isImmediate: obj32)
- 			[(heap32 isImmediate: oop32)
  				ifTrue:
+ 					[(heap32 isImmediateCharacter: obj32)
+ 						ifTrue: [heap64 characterObjectOf: (heap32 characterValueOf: obj32)]
+ 						ifFalse: [heap64 integerObjectOf: (heap32 integerValueOf: obj32)]]
- 					[(heap32 isImmediateCharacter: oop32)
- 						ifTrue: [heap64 characterObjectOf: (heap32 characterValueOf: oop32)]
- 						ifFalse: [heap64 integerObjectOf: (heap32 integerValueOf: oop32)]]
  				ifFalse:
  					[| value |
+ 					 self assert: (self isUnmappedObject: obj32).
+ 					 (heap32 isFloatInstance: obj32)
+ 						ifTrue:
+ 							[heap64 smallFloatObjectOf: (heap32 floatValueOf: obj32)]
+ 						ifFalse:
+ 							[interpreter32 initPrimCall.
+ 							 value := interpreter32 signed64BitValueOf: obj32.
+ 							 self deny: interpreter32 failed.
+ 							 heap64 integerObjectOf: value]]]!
- 					 self assert: (self isUnmappedObject: oop32).
- 					 interpreter32 initPrimCall.
- 					 value := interpreter32 signed64BitValueOf: oop32.
- 					 self deny: interpreter32 failed.
- 					 heap64 integerObjectOf: value]]!

Item was added:
+ ----- Method: Spur32to64BitBootstrap>>shouldClone: (in category 'bootstrap image') -----
+ shouldClone: obj32
+ 	| classIndex value |
+ 	(heap32 isValidObjStackPage: obj32) ifTrue:
+ 		[^false].
+ 
+ 	classIndex := heap32 classIndexOf: obj32.
+ 
+ 	((classIndex between: ClassLargeNegativeIntegerCompactIndex and: ClassLargePositiveIntegerCompactIndex)
+ 	 and: [interpreter32 initPrimCall.
+ 		   value := interpreter32 signed64BitValueOf: obj32.
+ 		   interpreter32 failed not
+ 		   and: [heap64 isIntegerValue: value]]) ifTrue:
+ 		[^false].
+ 
+ 	(classIndex = ClassFloatCompactIndex
+ 	and: [value := heap32 floatValueOf: obj32.
+ 		heap64 isSmallFloatValue: value]) ifTrue:
+ 		[^false].
+ 
+ 	^true!

Item was added:
+ ----- Method: SpurBootstrapPrototypes>>SmallIntegerPROTOTYPEdecimalDigitLength (in category 'method prototypes') -----
+ SmallIntegerPROTOTYPEdecimalDigitLength
+ 	"Answer the number of digits printed out in base 10.
+ 	 Note that this only works for positive SmallIntegers up to 64-bits."
+ 	
+ 	^self < 10000
+ 		ifTrue:
+ 			[self < 100
+ 				ifTrue:
+ 					[self < 10 ifTrue: [1] ifFalse: [2]]
+ 				ifFalse:
+ 					[self < 1000 ifTrue: [3] ifFalse: [4]]]
+ 		ifFalse:
+ 			[self < 100000000
+ 				ifTrue:
+ 					[self < 1000000
+ 						ifTrue: [self < 100000 ifTrue: [5] ifFalse: [6]]
+ 						ifFalse: [self < 10000000 ifTrue: [7] ifFalse: [8]]]
+ 				ifFalse:
+ 					[self < 1000000000000
+ 						ifTrue:
+ 							[self < 10000000000
+ 								ifTrue: [self < 1000000000 ifTrue: [9] ifFalse: [10]]
+ 								ifFalse: [self < 100000000000 ifTrue: [11] ifFalse: [12]]]
+ 						ifFalse:
+ 							[self < 10000000000000000
+ 								ifTrue:
+ 									[self < 100000000000000
+ 										ifTrue: [self < 10000000000000 ifTrue: [13] ifFalse: [14]]
+ 										ifFalse: [self < 1000000000000000 ifTrue: [15] ifFalse: [16]]]
+ 								ifFalse:
+ 									[self < 1000000000000000000
+ 										ifTrue: [self < 100000000000000000 ifTrue: [17] ifFalse: [18]]
+ 										ifFalse: [self < 10000000000000000000 ifTrue: [19] ifFalse: [20]]]]]]!



More information about the Vm-dev mailing list