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

commits at source.squeak.org commits at source.squeak.org
Thu Dec 10 03:46:37 UTC 2015


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

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

Name: VMMaker.oscog-eem.1571
Author: eem
Time: 9 December 2015, 7:44:54.732 pm
UUID: 013290aa-4ee7-4fcb-be23-a09b041437ee
Ancestors: VMMaker.oscog-eem.1570

x64 Cogit/Interpreter

Fix assert in x64's relocateMethodReferenceBeforeAddress:by: for push method ref case.

Fix simulation of primitiveBitShift.  left shifts must be clipped to machine integer range.

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

Item was changed:
  ----- Method: CogX64Compiler>>relocateMethodReferenceBeforeAddress:by: (in category 'inline cacheing') -----
  relocateMethodReferenceBeforeAddress: pc by: delta
  	"We generate the method address using pc-relative addressing.
  	 Simply check that rip-relative addressing is being used. c.f.
  	 concretizeMoveCwR"
  	<inline: true>
+ 	self assert: (((objectMemory byteAt: pc - 6) = 16r8D "move"
+ 				and: [((objectMemory byteAt: pc - 5) bitOr: (self mod: 0 RM: 0 RO: 7)) = (self mod: ModRegInd RM: 5 RO: 7)])
+ 				or: [(objectMemory byteAt: pc - 8) = 16r8D "push"
+ 				and: [((objectMemory byteAt: pc - 7) bitOr: (self mod: 0 RM: 0 RO: 7)) = (self mod: ModRegInd RM: 5 RO: 7)]])!
- 	self assert: ((objectMemory byteAt: pc - 6) = 16r8D
- 				and: [((objectMemory byteAt: pc - 5) bitOr: (self mod: 0 RM: 0 RO: 7)) = (self mod: ModRegInd RM: 5 RO: 7)])!

Item was changed:
  ----- Method: InterpreterPrimitives>>primitiveBitShift (in category 'arithmetic integer primitives') -----
  primitiveBitShift
  	"Perform a bitShift.  In 32-bits deal only with non-negative 32-bit integers.
  	  In 64-bits deal with signed 64-bit quantities (max (2^63)-1)."
  	| integerReceiver integerArgument shifted |
  	<var: #integerReceiver type: #sqInt>
  	integerArgument := self stackTop.
  	(objectMemory isIntegerObject: integerArgument) ifFalse:
  		[^self primitiveFail].
  	integerReceiver := self stackValue: 1.
  	objectMemory wordSize = 4
  		ifTrue:
  			[integerReceiver := self positive32BitValueOf: integerReceiver]
  		ifFalse:
  			[integerReceiver := self signed64BitValueOf: integerReceiver].
  	self successful ifTrue:
  		[(integerArgument := objectMemory integerValueOf: integerArgument) >= 0
  			ifTrue: "Left shift -- must fail bits would be lost"
  				[integerArgument <= objectMemory numSmallIntegerBits ifFalse:
  					[^self primitiveFail].
  				shifted := integerReceiver << integerArgument.
+ 				self cCode: '' inSmalltalk: [shifted := objectMemory wordSize = 4
+ 									ifTrue: [shifted signedIntFromLong]
+ 									ifFalse: [shifted signedIntFromLong64]].
  				integerReceiver = (objectMemory wordSize = 4
  									ifTrue: [shifted >> integerArgument]
  									ifFalse: [shifted >>> integerArgument]) ifFalse:
  					[^self primitiveFail]]
  			ifFalse: "Right shift -- OK to lose bits"
  				[integerArgument >= objectMemory numSmallIntegerBits negated ifFalse:
  					[^self primitiveFail].
  				 shifted := objectMemory wordSize = 4
  								ifTrue: [integerReceiver >> (0 - integerArgument)]
  								ifFalse: [integerReceiver >>> (0 - integerArgument)]].
  		shifted := objectMemory wordSize = 4
  					ifTrue: [self positive32BitIntegerFor: shifted]
  					ifFalse:
  						[(objectMemory isIntegerValue: shifted)
  							ifTrue: [objectMemory integerObjectOf: shifted]
  							ifFalse: [self signed64BitIntegerFor: shifted]].
  		self pop: 2 thenPush: shifted]!



More information about the Vm-dev mailing list