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

commits at source.squeak.org commits at source.squeak.org
Wed Feb 24 05:47:58 UTC 2016


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

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

Name: VMMaker.oscog-eem.1698
Author: eem
Time: 23 February 2016, 9:46:11.903576 pm
UUID: 5135ebff-13d3-4d8c-8bce-ed314399b14e
Ancestors: VMMaker.oscog-eem.1697

Fix a wild goose chase.  ake sure that simulated translate dprmitives fail if given the wrong types of bits arrays.  This fixes simulated aByteString asUppercase which uses the primitiveTranslateStringWithTable primitive with the UppercasingTable.  When UppercasingTable is a wide string the primitive should fail.

Add tests for 16-bit and 64-bit indexable objects to SpurMemoryManager.

Fix simulation of literal32BeforeFollowingAddress:

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

Item was changed:
  ----- Method: CogClass>>cCoerceSimple:to: (in category 'translation support') -----
  cCoerceSimple: value to: cTypeString
  	<doNotGenerate>
  	"Type coercion for translation and simulation.
  	 For simulation answer a suitable surrogate for the struct types"
  	^cTypeString caseOf:
  	   {	[#'unsigned long']							->	[value].
+ 		[#'unsigned int']							->	[value].
  		[#sqInt]										->	[value].
  		[#usqInt]									->	[value].
  		[#sqLong]									->	[value].
  		[#usqLong]									->	[value].
  		[#'AbstractInstruction *']					->	[value].
  		[#'BytecodeFixup *']						->	[value].
  		[#'CogMethod *']							->	[value].
  		[#'char *']									->	[value].
  		[#'sqInt *']									->	[value].
  		[#'void *']									->	[value].
  		[#void]										->	[value].
  		[#'void (*)()']								->	[value].
  		[#'void (*)(void)']							->	[value].
  		[#'unsigned long (*)(void)']					->	[value].
  		[#'void (*)(unsigned long,unsigned long)']	->	[value] }!

Item was changed:
  ----- Method: CogInLineLiteralsX64Compiler>>literal32BeforeFollowingAddress: (in category 'inline cacheing') -----
  literal32BeforeFollowingAddress: followingAddress
  	"Answer the 32-bit literal embedded in the instruction immediately preceding followingAddress."
+ 	^cogit
- 	^self
  		cCoerceSimple: (self unalignedLong32At: followingAddress - 4)
  		to: #'unsigned int'!

Item was changed:
  ----- Method: InterpreterPlugin>>translatedPrimitiveArgument:ofType:using: (in category 'simulation') -----
  translatedPrimitiveArgument: index ofType: cTypeString using: aCCodeGenerator
+ 	| oop unitSize |
- 	| oop |
  	oop := interpreterProxy stackValue: interpreterProxy methodArgumentCount - index.
  	(interpreterProxy isOopForwarded: oop) ifTrue: [^nil]. 
  	cTypeString last == $* ifTrue:
+ 		[unitSize := self sizeof: (aCCodeGenerator baseTypeForPointerType: cTypeString) asSymbol.
+ 		 unitSize caseOf: {
+ 			[1]	->	[(interpreterProxy isBytes: oop) ifFalse: [^nil]].
+ 			[2]	->	[(interpreterProxy isShorts: oop) ifFalse: [^nil]].
+ 			[4]	->	[(interpreterProxy isWords: oop) ifFalse: [^nil]].
+ 			[8]	->	[(interpreterProxy isLong64s: oop) ifFalse: [^nil]] }
+ 			otherwise: [^nil].
+ 		^ObjectProxyForTranslatedPrimitiveSimulation new
- 		[^ObjectProxyForTranslatedPrimitiveSimulation new
  			interpreter: interpreterProxy
  			oop: oop
+ 			unitSize: unitSize].
- 			unitSize: (self sizeof: (aCCodeGenerator baseTypeForPointerType: cTypeString) asSymbol)].
  	((interpreterProxy isIntegerObject: oop)
  	 and: [aCCodeGenerator isIntegralCType: cTypeString]) ifTrue:
  		[^interpreterProxy integerValueOf: oop].
  	self halt!

Item was changed:
  ----- Method: Spur64BitMemoryManager>>isWordsNonImm: (in category 'object testing') -----
  isWordsNonImm: objOop
  	"Answer if the argument contains only indexable words (no oops). See comment in formatOf:"
  
+ 	^(self formatOf: objOop) between: self firstLongFormat and: self firstShortFormat - 1!
- 	^(self formatOf: objOop) between: self firstLongFormat and: self firstLongFormat + 1!

Item was added:
+ ----- Method: SpurMemoryManager>>isLong64s: (in category 'object testing') -----
+ isLong64s: oop
+ 	"Answer if the argument contains only indexable 64-bit double words (no oops). See comment in formatOf:"
+ 
+ 	^(self isNonImmediate: oop)
+ 	  and: [self isLong64sNonImm: oop]!

Item was added:
+ ----- Method: SpurMemoryManager>>isLong64sNonImm: (in category 'object testing') -----
+ isLong64sNonImm: objOop
+ 	"Answer if the argument contains only indexable 64-bit double words (no oops). See comment in formatOf:"
+ 
+ 	^(self formatOf: objOop) = self sixtyFourBitIndexableFormat!

Item was added:
+ ----- Method: SpurMemoryManager>>isShorts: (in category 'object testing') -----
+ isShorts: oop
+ 	"Answer if the argument contains only indexable 16-bit half words (no oops). See comment in formatOf:"
+ 
+ 	^(self isNonImmediate: oop)
+ 	  and: [self isShortsNonImm: oop]!

Item was added:
+ ----- Method: SpurMemoryManager>>isShortsNonImm: (in category 'object testing') -----
+ isShortsNonImm: objOop
+ 	"Answer if the argument contains only indexable 16-bit half words (no oops). See comment in formatOf:"
+ 
+ 	^(self formatOf: objOop) between: self firstShortFormat and: self firstByteFormat - 1!



More information about the Vm-dev mailing list