[Vm-dev] VM Maker: VMMaker.oscog-nice.1987.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Nov 9 22:37:05 UTC 2016


Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1987.mcz

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

Name: VMMaker.oscog-nice.1987
Author: nice
Time: 9 November 2016, 11:35:44.410941 pm
UUID: 78e735bd-f947-48ff-b768-22887642e0ef
Ancestors: VMMaker.oscog-nice.1986

Fix two forgotten C Compiler warnings about taking abs value of an unsigned integer.

Of course, we want to take absolute value of signed difference.

=============== Diff against VMMaker.oscog-nice.1986 ===============

Item was changed:
  ----- Method: CogX64Compiler>>rewriteCPICJumpAt:target: (in category 'inline cacheing') -----
  rewriteCPICJumpAt: addressFollowingJump target: jumpTargetAddress
  	"Rewrite the short jump instruction to jump to a new cpic case target. "
  	<var: #addressFollowingJump type: #usqInt>
  	<var: #jumpTargetAddress type: #usqInt>
+ 	<var: #callDistance type: #sqInt> "prevent type inference for avoiding warning on abs"
  	| callDistance |
  	callDistance := jumpTargetAddress - addressFollowingJump.
  	self assert: callDistance abs < 128.
  	objectMemory
  		byteAt: addressFollowingJump - 1
  		put:  (callDistance bitAnd: 16rFF).
  	"self cCode: ''
  		inSmalltalk: [cogit disassembleFrom: addressFollowingJump - 10 to: addressFollowingJump - 1]."
  	^2!

Item was changed:
  ----- Method: SpurSegmentManager>>findEmptySegNearestInSizeTo: (in category 'growing/shrinking memory') -----
  findEmptySegNearestInSizeTo: size
  	| seg best delta |
  	<var: #seg type: #'SpurSegmentInfo *'>
  	<var: #best type: #'SpurSegmentInfo *'>
  	best := nil.
  	delta := size.
  	0 to: numSegments - 1 do:
  		[:i|
  		seg := self addressOf: (segments at: i).
  		(self isEmptySegment: seg) ifTrue:
  			[best
  				ifNil: [best := seg]
  				ifNotNil:
  					[(size >= (seg segSize * 0.75)
  					 and: [(self cCoerce: (seg segSize - size) to: #sqInt ) abs < delta]) ifTrue:
+ 						[best := seg. delta := (self cCoerce: (seg segSize - size) to: #sqInt ) abs]]]].
- 						[best := seg. delta := (seg segSize - size) abs]]]].
  	^best!



More information about the Vm-dev mailing list