[Vm-dev] VM Maker: VMMaker.oscog-eem.1644.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 16 18:25:03 UTC 2016


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

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

Name: VMMaker.oscog-eem.1644
Author: eem
Time: 16 January 2016, 10:23:22.538484 am
UUID: 937e3a17-80a3-4def-ad31-64ecf88b41f9
Ancestors: VMMaker.oscog-eem.1643

Fix normalizePositive: for 64-bit Spur.

Correct the checking for in-SmallInteger-range large integers in commentary.

=============== Diff against VMMaker.oscog-eem.1643 ===============

Item was changed:
  ----- Method: LargeIntegersPlugin>>normalizePositive: (in category 'oop functions') -----
  normalizePositive: aLargePositiveInteger 
  	"Check for leading zeroes and return shortened copy if so."
  	"First establish len = significant length."
  	| sLen val len oldLen pointer |
  	<var: #pointer type: #'unsigned char *'>
  	len := oldLen := self digitLengthOfNonImmediate: aLargePositiveInteger.
  	pointer := interpreterProxy
  				cCoerce: (interpreterProxy firstIndexableField: aLargePositiveInteger)
  				to: #'unsigned char *'.
  	[len > 0 and: [(pointer at: len - 1) = 0]] whileTrue:
  		[len := len - 1].
  	len = 0 ifTrue: [^ 0 asOop: SmallInteger].
  
  	"Now check if in SmallInteger range"
  	sLen := interpreterProxy maxSmallInteger > 16r3FFFFFFF "SmallInteger maxVal digitLength."
  				ifTrue: [8]
  				ifFalse: [4].
+ 	len <= sLen ifTrue: 
+ 		[(len < sLen
+ 		  or: [(pointer at: sLen - 1) <= (self cDigitOfCSI: interpreterProxy maxSmallInteger at: sLen)]) ifTrue: 
+ 			["If so, return its SmallInt value"
+ 			 val := pointer at: (len := len - 1).
+ 			 len - 1 to: 0 by: -1 do:
+ 				[:i | val := val * 256 + (pointer at: i)].
+ 			^val asOop: SmallInteger]].
- 	(len <= sLen
- 	 and: [(pointer at: sLen - 1) <= (self cDigitOfCSI: interpreterProxy maxSmallInteger at: sLen)]) ifTrue: 
- 		["If so, return its SmallInt value"
- 		 val := pointer at: (len := len - 1).
- 		 len - 1 to: 0 by: -1 do:
- 			[:i | val := val * 256 + (pointer at: i)].
- 		^val asOop: SmallInteger].
  	"Return self, or a shortened copy"
  	len < oldLen ifTrue: "^ self growto: len"
  		[^self bytes: aLargePositiveInteger growTo: len].
  	^aLargePositiveInteger!

Item was changed:
  ----- Method: SpurMemoryManager>>defaultEdenBytes (in category 'snapshot') -----
  defaultEdenBytes
  	"Answer the default amount of memory to allocate for the eden space.
  	 The actual value can be set via vmParameterAt: and/or a preference in the ini file.
  	 The shootout tests seem to plateau at 5 or 6Mb.
  
  	 Both the 32-bit and 64-bit versions use the same 4Mb default.  Measuring
  	 the simulator on image start-up, the 64-bit system's eden at the same point
  	 in start-up (the first copyBits) is only 8% larger in bytes because it allocates
  	 26% fewer objects.  Some 21% of the objects in the 32-bit version's eden
  	 are large integers and floats that are representable as 64-bit immediates."
  	<inline: false>
  	^4 * 1024 * 1024
  
  	"Here are the expressions used to collect the above-mentioned figures:"
  	"freeStart - self newSpaceStart"
  	"| n | n := 0. self allNewSpaceObjectsDo: [:o| n := n + 1]. n"
  	"| f | f := 0. self allNewSpaceObjectsDo: [:o| (self isFloatObject: o) ifTrue: [f := f + 1]]. f"
  	"| l | l := 0. self allNewSpaceObjectsDo: [:o|
  		(((self classIndexOf: o)
+ 			between: ClassLargeNegativeIntegerCompactIndex
+ 			and: ClassLargePositiveIntegerCompactIndex)
+ 		 and: [(self numBytesOfBytes: o) <= 8
+ 		 and: [self isIntegerValue: (coInterpreter signed64BitValueOf: o)]]) ifTrue: [l := l + 1]]. l"!
- 				between: ClassLargeNegativeIntegerCompactIndex
- 				and: ClassLargePositiveIntegerCompactIndex)
- 		and: [(self numBytesOfBytes: o) < 8
- 			or: [(self numBytesOfBytes: o) = 8 and: [(self fetchByte: 7 ofObject: o) < 32]]])
- 		ifTrue: [l := l + 1]]"!



More information about the Vm-dev mailing list