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

commits at source.squeak.org commits at source.squeak.org
Wed Apr 1 18:07:04 UTC 2015


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

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

Name: VMMaker.oscog-eem.1145
Author: eem
Time: 1 April 2015, 11:04:56.527 am
UUID: 945d0a43-e29d-4fb4-a1b8-263465636aec
Ancestors: VMMaker.oscog-eem.1144

Retract the decision to type the results of the bitwise
operators as unsigned; it breaks at least the BitBlt plugin.

=============== Diff against VMMaker.oscog-tpr.1143 ===============

Item was changed:
  ----- Method: CCodeGenerator>>returnTypeForSend:in: (in category 'type inference') -----
  returnTypeForSend: sendNode in: aTMethod
  	"Answer the return type for a send.  Absent sends default to #sqInt.
  	 The bitwise operators answer unsigned versions of their argument types, at least in gcc
  	 although this author can't find that in the C99 spec.  If you can find this, please let me know."
  	| sel |
  	^(self anyMethodNamed: (sel := sendNode selector))
  		ifNil: [kernelReturnTypes
  				at: sel
  				ifAbsent:
  					[^sel
  						caseOf: {
  						[#+]					->	[self typeForArithmetic: sendNode in: aTMethod].
  						[#-]						->	[self typeForArithmetic: sendNode in: aTMethod].
  						[#*]					->	[self typeForArithmetic: sendNode in: aTMethod].
  						[#/]						->	[self typeForArithmetic: sendNode in: aTMethod].
  						[#addressOf:]			->	[(self typeFor: sendNode receiver in: aTMethod)
  														ifNil: [#sqInt]
  														ifNotNil: [:type| type, (type last isLetter ifTrue: [' *'] ifFalse: ['*'])]].
  						[#at:]					->	[self typeForDereference: sendNode in: aTMethod].
+ 						[#bitAnd:]				->	[self typeForArithmetic: sendNode in: aTMethod].
+ 						[#bitOr:]				->	[self typeForArithmetic: sendNode in: aTMethod].
+ 						[#bitXor:]				->	[self typeForArithmetic: sendNode in: aTMethod].
- 						[#bitAnd:]				->	[self unsignedTypeForBitwiseSend: sendNode in: aTMethod].
- 						[#bitOr:]				->	[self unsignedTypeForBitwiseSend: sendNode in: aTMethod].
- 						[#bitXor:]				->	[self unsignedTypeForBitwiseSend: sendNode in: aTMethod].
  						[#asFloat]				->	[#double].
  						[#atan]					->	[#double].
  						[#exp]					->	[#double].
  						[#log]					->	[#double].
  						[#sin]					->	[#double].
  						[#sqrt]					->	[#double].
  						[#asLong]				->	[#long].
  						[#asUnsignedInteger]	->	[#usqInt].
  						[#asUnsignedLong]		->	[#'unsigned long'].
  						[#asVoidPointer]		->	[#'void *'].
  						[#signedIntToLong]		->	[#usqInt]. "c.f. generateSignedIntToLong:on:indent:"
  						[#signedIntToShort]	->	[#usqInt]. "c.f. generateSignedIntToShort:on:indent:"
  						[#cCoerce:to:]			->	[sendNode args last value].
  						[#cCoerceSimple:to:]	->	[sendNode args last value].
  						[#ifTrue:ifFalse:]		->	[self typeForConditional: sendNode in: aTMethod].
  						[#ifFalse:ifTrue:]		->	[self typeForConditional: sendNode in: aTMethod].
  						[#ifTrue:]				->	[self typeForConditional: sendNode in: aTMethod].
  						[#ifFalse:]				->	[self typeForConditional: sendNode in: aTMethod] }
  						otherwise: [#sqInt]]]
  		ifNotNil:
  			[:m|
  			 m returnType ifNotNil:
  				[:type|
  				 self baseTypeForType: type]]!

Item was removed:
- ----- Method: CCodeGenerator>>unsignedTypeForBitwiseSend:in: (in category 'type inference') -----
- unsignedTypeForBitwiseSend: aTSendNode in: aTMethod
- 	"The result of the bitwise operators in C is unsigned.
- 	 We make an exception for currentBytecode bitAnd: N to allow better inlining in cases."
- 	| t1 t2 type |
- 	(aTSendNode receiver isVariable
- 	and: [aTSendNode receiver name = 'currentBytecode'
- 	and: [aTSendNode selector == #bitAnd:]]) ifTrue:
- 		[^#sqInt].
- 	t1 := (self typeFor: aTSendNode receiver in: aTMethod) ifNil: [^nil].
- 	t2 := (self typeFor: aTSendNode args first in: aTMethod) ifNil: [^nil].
- 	type := (self sizeOfIntegralCType: t1) >= (self sizeOfIntegralCType: t1)
- 				ifTrue: [t1]
- 				ifFalse: [t2].
- 	^type first = $u
- 		ifTrue: [type]
- 		ifFalse:
- 			[(type beginsWith: 'sq')
- 				ifTrue: ['u', type]
- 				ifFalse: ['unsigned ', type]]!

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveAdoptInstance (in category 'object access primitives') -----
  primitiveAdoptInstance
  	"Primitive. Change the class of the argument to make it an instance of the receiver
  	 given that the format of the receiver matches the format of the argument's class.
  	 Fail if receiver or argument are SmallIntegers, or the receiver is an instance of a
  	 compact class and the argument isn't, or when the argument's class is compact and
  	 the receiver isn't, or when the format of the receiver is different from the format of
  	 the argument's class, or when the arguments class is fixed and the receiver's size
  	 differs from the size that an instance of the argument's class should have."
  	| rcvr arg err |
  
  	arg := self stackObjectValue: 0.
  	rcvr := self stackObjectValue: 1.
+ 	self successful ifFalse:[^nil].
  
  	err := objectMemory changeClassOf: arg to: rcvr.
  	err = 0
  		ifTrue: ["Flush at cache because rcvr's class has changed."
  				self flushAtCache.
  				self pop: self methodArgumentCount]
  		ifFalse: [self primitiveFailFor: err].
  	^nil!

Item was added:
+ ----- Method: InterpreterPrimitives>>primitiveIsBigEnder (in category 'other primitives') -----
+ primitiveIsBigEnder
+ 	"Answer if running on a big endian machine."
+ 	<export: true>
+ 	self pop: 1 thenPushBool: self isBigEnder!

Item was changed:
  ----- Method: NSSendCacheSurrogate32>>enclosingObject: (in category 'accessing') -----
  enclosingObject: aValue
  	^memory
  		unsignedLongAt: address + 13
  		put: aValue!



More information about the Vm-dev mailing list