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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 11 19:13:57 UTC 2014


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

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

Name: VMMaker.oscog-eem.976
Author: eem
Time: 11 December 2014, 11:11:19.176 am
UUID: 52a3f72e-3ba1-4f89-997b-261fa38345c0
Ancestors: VMMaker.oscog-eem.975

The criterion for promoting a shifted constant to
long was wrong.  It needs to compare against
sizeof(int) (the default type) not sizeof(long).

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

Item was changed:
  ----- Method: CCodeGenerator>>generateShiftLeft:on:indent: (in category 'C translation') -----
  generateShiftLeft: msgNode on: aStream indent: level
  	"Generate a C bitShift.  If we can determine the result
  	 would overflow the word size, cast to a long integer."
+ 	| rcvr arg bitSizeOfInt |
+ 	bitSizeOfInt := 1 bitShift: BytesPerWord * 4. "The default type of const << N is int."
- 	| rcvr arg |
  	rcvr := msgNode receiver.
  	arg := msgNode args first.
  	self emitCExpression: rcvr on: aStream.
  	(rcvr isConstant and: [arg isConstant
  	 and: [rcvr value isInteger and: [arg value isInteger
  	 and: [rcvr value < (1 bitShift: BytesPerWord * 8)
+ 	 and: [(rcvr value bitShift: arg value) >= bitSizeOfInt]]]]]) ifTrue:
- 	 and: [(rcvr value bitShift: arg value) >= (1 bitShift: BytesPerWord * 8)]]]]]) ifTrue:
  		[aStream nextPutAll: 'LL'].
  	aStream nextPutAll: ' << '.
  	self emitCExpression: arg on: aStream!



More information about the Vm-dev mailing list