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

commits at source.squeak.org commits at source.squeak.org
Thu Mar 5 19:48:31 UTC 2015


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

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

Name: VMMaker.oscog-eem.1085
Author: eem
Time: 5 March 2015, 11:46:45.763 am
UUID: bd028125-317e-40fe-ac8c-461e7f59dbb6
Ancestors: VMMaker.oscog-eem.1084

Fix slip in LargeIntegersPlugin (thanks Nicolas).

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

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 |
  	len := oldLen := self digitLength: aLargePositiveInteger.
  	[len ~= 0 and: [(self unsafeByteOf: aLargePositiveInteger at: len)
  			= 0]]
  		whileTrue: [len := len - 1].
  	len = 0 ifTrue: [^ 0 asOop: SmallInteger].
  	"Now check if in SmallInteger range"
+ 	sLen := interpreterProxy maxSmallInteger > 16r3FFFFFFF "SmallInteger maxVal digitLength."
- 	sLen := interpreterProxy minSmallInteger > 16r3FFFFFFF "SmallInteger maxVal digitLength."
  				ifTrue: [8]
  				ifFalse: [4].
  	(len <= sLen
  	 and: [(self digitOfBytes: aLargePositiveInteger at: sLen)
  			<= (self cDigitOfCSI: interpreterProxy maxSmallInteger at: sLen)
  		"SmallInteger maxVal"])
  		ifTrue: 
  			["If so, return its SmallInt value"
  			val := 0.
  			len
  				to: 1
  				by: -1
  				do: [:i | val := val * 256 + (self unsafeByteOf: aLargePositiveInteger at: i)].
  			^ val asOop: SmallInteger].
  	"Return self, or a shortened copy"
  	len < oldLen
  		ifTrue: ["^ self growto: len"
  			^ self bytes: aLargePositiveInteger growTo: len]
  		ifFalse: [^ aLargePositiveInteger]!



More information about the Vm-dev mailing list