[Vm-dev] VM Maker: VMMaker.oscog-eem.1054.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Feb 11 21:21:23 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1054.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1054
Author: eem
Time: 11 February 2015, 1:20:01.475 pm
UUID: 3d511797-53fc-4848-b1ec-4b8a1eb0c0ff
Ancestors: VMMaker.oscog-eem.1053
Broaden primitiveBitAnd and primitiveBitOr for Spur
64-bits. Make the bytecodes handle the common
SmallInteger op SmallInteger case.
Fix C code for and endianness under simulation of
Spur64BitMemoryManager>>fetchLong32:ofFloatObject:
=============== Diff against VMMaker.oscog-eem.1053 ===============
Item was changed:
----- Method: InterpreterPrimitives>>primitiveBitAnd (in category 'arithmetic integer primitives') -----
primitiveBitAnd
+ <inline: false>
| integerReceiver integerArgument |
+ integerArgument := self stackTop.
+ integerReceiver := self stackValue: 1.
+ "Comment out the short-cut. Either the inline interpreter bytecode or the JIT primitive will handle this case.
+ ((objectMemory isIntegerObject: integerArgument)
+ and: [objectMemory isIntegerObject: integerReceiver])
+ ifTrue: [self pop: 2 thenPush: (integerArgument bitAnd: integerReceiver)]
+ ifFalse:
+ ["objectMemory wordSize = 8
+ ifTrue:
+ [integerArgument := self positive64BitValueOf: integerArgument.
+ integerReceiver := self positive64BitValueOf: integerReceiver.
+ self successful ifTrue:
+ [self pop: 2 thenPush: (self positive64BitIntegerFor: (integerArgument bitAnd: integerReceiver))]]
+ ifFalse:
+ [integerArgument := self positive32BitValueOf: integerArgument.
+ integerReceiver := self positive32BitValueOf: integerReceiver.
+ self successful ifTrue:
+ [self pop: 2 thenPush: (self positive32BitIntegerFor: (integerArgument bitAnd: integerReceiver))]]"]"!
- integerArgument := self popPos32BitInteger.
- integerReceiver := self popPos32BitInteger.
- self successful
- ifTrue: [self push: (self positive32BitIntegerFor:
- (integerReceiver bitAnd: integerArgument))]
- ifFalse: [self unPop: 2]!
Item was changed:
----- Method: InterpreterPrimitives>>primitiveBitOr (in category 'arithmetic integer primitives') -----
primitiveBitOr
+ <inline: false>
| integerReceiver integerArgument |
+ integerArgument := self stackTop.
+ integerReceiver := self stackValue: 1.
+ "Comment out the short-cut. Either the inline interpreter bytecode or the JIT primitive will handle this case.
+ ((objectMemory isIntegerObject: integerArgument)
+ and: [objectMemory isIntegerObject: integerReceiver])
+ ifTrue: [self pop: 2 thenPush: (integerArgument bitOr: integerReceiver)]
+ ifFalse:
+ ["objectMemory wordSize = 8
+ ifTrue:
+ [integerArgument := self positive64BitValueOf: integerArgument.
+ integerReceiver := self positive64BitValueOf: integerReceiver.
+ self successful ifTrue:
+ [self pop: 2 thenPush: (self positive64BitIntegerFor: (integerArgument bitOr: integerReceiver))]]
+ ifFalse:
+ [integerArgument := self positive32BitValueOf: integerArgument.
+ integerReceiver := self positive32BitValueOf: integerReceiver.
+ self successful ifTrue:
+ [self pop: 2 thenPush: (self positive32BitIntegerFor: (integerArgument bitOr: integerReceiver))]]"]"!
- integerArgument := self popPos32BitInteger.
- integerReceiver := self popPos32BitInteger.
- self successful
- ifTrue: [self push: (self positive32BitIntegerFor:
- (integerReceiver bitOr: integerArgument))]
- ifFalse: [self unPop: 2]!
Item was changed:
----- Method: Spur64BitMemoryManager>>fetchLong32:ofFloatObject: (in category 'object access') -----
fetchLong32: fieldIndex ofFloatObject: oop
"index by word size, and return a pointer as long as the word size"
| bits |
(self isImmediateFloat: oop) ifFalse:
[^self fetchLong32: fieldIndex ofObject: oop].
bits := self smallFloatBitsOf: oop.
^self
+ cCode: [(self cCoerceSimple: (self addressOf: bits) to: #'int *') at: fieldIndex]
+ inSmalltalk:
+ [self flag: #endian.
+ fieldIndex = 0
+ ifTrue: [bits bitAnd: 16rFFFFFFFF]
+ ifFalse: [bits >> 32]]!
- cCode: [self longAt: (self cCoerceSimple: (self addressOf: bits) to: #'char *')
- + (fieldIndex << self shiftForWord)]
- inSmalltalk: [self flag: #endian.
- fieldIndex = 0
- ifTrue: [bits >> 32]
- ifFalse: [bits bitAnd: 16rFFFFFFFF]]!
Item was changed:
----- Method: StackInterpreter>>bytecodePrimBitAnd (in category 'common selector sends') -----
bytecodePrimBitAnd
+ | rcvr arg |
+ arg := self internalStackTop.
+ rcvr := self internalStackValue: 1.
+ ((objectMemory isIntegerObject: arg)
+ and: [objectMemory isIntegerObject: rcvr]) ifTrue:
+ [self internalPop: 2 thenPush: (arg bitAnd: rcvr).
+ ^self fetchNextBytecode "success"].
self initPrimCall.
self externalizeIPandSP.
self primitiveBitAnd.
self internalizeIPandSP.
+ self successful ifTrue:
+ [^self fetchNextBytecode "success"].
- self successful ifTrue: [^ self fetchNextBytecode "success"].
messageSelector := self specialSelector: 14.
argumentCount := 1.
self normalSend!
Item was changed:
----- Method: StackInterpreter>>bytecodePrimBitOr (in category 'common selector sends') -----
bytecodePrimBitOr
+ | rcvr arg |
+ arg := self internalStackTop.
+ rcvr := self internalStackValue: 1.
+ ((objectMemory isIntegerObject: arg)
+ and: [objectMemory isIntegerObject: rcvr]) ifTrue:
+ [self internalPop: 2 thenPush: (arg bitOr: rcvr).
+ ^self fetchNextBytecode "success"].
self initPrimCall.
self externalizeIPandSP.
self primitiveBitOr.
self internalizeIPandSP.
+ self successful ifTrue:
+ [^self fetchNextBytecode "success"].
- self successful ifTrue: [^ self fetchNextBytecode "success"].
messageSelector := self specialSelector: 15.
argumentCount := 1.
self normalSend!
More information about the Vm-dev
mailing list