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

commits at source.squeak.org commits at source.squeak.org
Mon Oct 3 02:50:18 UTC 2022


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

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

Name: VMMaker.oscog-eem.3253
Author: eem
Time: 2 October 2022, 7:49:57.1256 pm
UUID: 28effaaf-689b-4650-90e9-4c3534bffdd0
Ancestors: VMMaker.oscog-eem.3252

Fix a regression in the FFI plugin from VMMaker.oscog-mt.3181.  The type of ffiIntegerValueOf: *must* be signed for e.g. float conversions to operate correctly.  The symptom of having ffiIntegerValueOf: unsigned is lime green menu bars (top and bottom).

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

Item was changed:
  ----- Method: ThreadedFFIPlugin>>ffiIntegerValueOf: (in category 'callout support') -----
  ffiIntegerValueOf: oop
  	"Support for generic callout. Answer an integer value that is coerced as C would do."
  	<inline: true>
+ 	<returnTypeC: #sqLong> "Support up to int64_t or uint64_t, at least intptr_t; type *MUST* be signed for e.g. correct float conversion."
- 	<returnTypeC: #'usqLong'> "Support up to int64_t or uint64_t, at least intptr_t"
  	"Cheat with a tag test"
  	(oop anyMask: BytesPerWord - 1)
  		ifTrue:
+ 			[self cppIf: SPURVM
- 			[(interpreterProxy isIntegerObject: oop) ifTrue:
- 				[^interpreterProxy integerValueOf: oop].
- 			self cppIf: SPURVM
  				ifTrue:
+ 					[(interpreterProxy isIntegerObject: oop) ifTrue:
+ 						[^interpreterProxy integerValueOf: oop].
+ 					 (interpreterProxy isCharacterObject: oop) ifTrue: "Immediate in Spur"
- 					[(interpreterProxy isCharacterObject: oop) ifTrue: "Immediate in Spur"
  						[^interpreterProxy characterValueOf: oop].
+ 					 (BytesPerWord >= 8 and: [interpreterProxy isFloatObject: oop]) ifTrue: "Immediate in 64-bit Spur"
+ 						[^interpreterProxy floatValueOf: oop]]
+ 				ifFalse:
+ 					[^interpreterProxy integerValueOf: oop]] "only one kind of immediate in v3"
- 					 (interpreterProxy isFloatObject: oop) ifTrue: "Immediate in 64-bit Spur"
- 						[^interpreterProxy floatValueOf: oop]]]
  		ifFalse:
  			[self cppIf: SPURVM
  				ifTrue: "No non-immediate characters in Spur"
  					[]
  				ifFalse:
  					[(interpreterProxy isCharacterObject: oop) ifTrue:
  						[^interpreterProxy characterValueOf: oop]].
  			 (interpreterProxy isFloatObject: oop) ifTrue:
  				[^interpreterProxy floatValueOf: oop].
+ 			"In Squeak nil, true & false are always contiguous at the start of old space..."
+ 			 (self oop: oop isGreaterThanOrEqualTo: interpreterProxy nilObject andLessThanOrEqualTo: interpreterProxy trueObject) ifTrue:
+ 				["i.e. cheaper than but equivalent to:
+ 					oop = interpreterProxy nilObject ifTrue: [^0]. @@: should we really allow this????
+ 					oop = interpreterProxy falseObject ifTrue: [^0].
+ 					oop = interpreterProxy trueObject ifTrue: [^1]."
+ 					^oop = interpreterProxy trueObject ifTrue: [1] ifFalse: [0]].
- 			 oop = interpreterProxy nilObject ifTrue: [^0]. "@@: should we really allow this????"
- 			 oop = interpreterProxy falseObject ifTrue: [^0].
- 			 oop = interpreterProxy trueObject ifTrue: [^1].
  			 (interpreterProxy isLargePositiveIntegerObject: oop) ifTrue:
  				[^interpreterProxy positive64BitValueOf: oop].
  			 (interpreterProxy isLargeNegativeIntegerObject: oop) ifTrue:
  				[^interpreterProxy signed64BitValueOf: oop]].
  	^interpreterProxy signedMachineIntegerValueOf: oop "<- will fail if not integer"!

Item was added:
+ ----- Method: ThreadedFFIPlugin>>oop:isGreaterThanOrEqualTo:andLessThanOrEqualTo: (in category 'oop comparison') -----
+ oop: anOop isGreaterThanOrEqualTo: baseOop andLessThanOrEqualTo: limitOop
+ 	"Compare two oop values, treating them as object memory locations; i.e. use unsigned comparisons.
+ 	 Use a macro, instead of #cCoerce:to: to provide fast simulation and inline code in conditionals,
+ 	 since the inliner doesn't inline in condtionals.
+ 
+ 	Override (actually copy) to get around Slang limitations; VMClass is not one of the included classes for plugins; dunno why... eem 10/2/2022"
+ 	<cmacro: '(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop))'>
+ 	^anOop >= baseOop and: [anOop <= limitOop]!



More information about the Vm-dev mailing list