[Vm-dev] VM Maker: VMMaker.oscog-cb.1290.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed May 6 09:06:58 UTC 2015
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1290.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1290
Author: cb
Time: 6 May 2015, 11:05:39.237 am
UUID: bfb69f82-a7f2-42e8-b375-32586dc89270
Ancestors: VMMaker.oscog-cb.1289
Removed the storeCheck in inlined pointer at:put: if the value stored is an unannotatable constant. I believe this is important in some cases I found where an array was initialized with 0 or false in all its slots.
=============== Diff against VMMaker.oscog-cb.1289 ===============
Item was changed:
----- Method: StackToRegisterMappingCogit>>genTrinaryInlinePrimitive: (in category 'inline primitive generators') -----
genTrinaryInlinePrimitive: prim
"Unary inline primitives."
"SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.
See EncoderForSistaV1's class comment and StackInterpreter>>#trinaryInlinePrimitive:"
+ | ra1 ra2 rr adjust needsStoreCheck |
- | ra1 ra2 rr adjust |
"The store check requires rr to be ReceiverResultReg"
self
allocateRegForStackTopThreeEntriesInto: [:rTop :rNext :rThird | ra2 := rTop. ra1 := rNext. rr := rThird ]
thirdIsReceiver: prim = 0.
self assert: (rr ~= ra1 and: [rr ~= ra2 and: [ra1 ~= ra2]]).
+ needsStoreCheck := (objectRepresentation isUnannotatableConstant: self ssTop) not.
self ssTop popToReg: ra2.
self ssPop: 1.
self ssTop popToReg: ra1.
self ssPop: 1.
self ssTop popToReg: rr.
self ssPop: 1.
objectRepresentation genConvertSmallIntegerToIntegerInReg: ra1.
"Now: ra is the variable object, rr is long, TempReg holds the value to store."
prim caseOf: {
"0 - 1 pointerAt:put: and byteAt:Put:"
[0] -> [ adjust := (objectMemory baseHeaderSize >> objectMemory shiftForWord) - 1. "shift by baseHeaderSize and then move from 1 relative to zero relative"
adjust ~= 0 ifTrue: [ self AddCq: adjust R: ra1. ].
self MoveR: ra2 Xwr: ra1 R: rr.
+ "I added needsStoreCheck so if you initialize an array with a Smi such as 0 or a boolean you don't need the store check"
+ needsStoreCheck ifTrue:
+ [ self assert: needsFrame.
+ objectRepresentation genStoreCheckReceiverReg: rr valueReg: ra2 scratchReg: TempReg inFrame: true] ].
- objectRepresentation genStoreCheckReceiverReg: rr valueReg: ra2 scratchReg: TempReg inFrame: true].
[1] -> [ objectRepresentation genConvertSmallIntegerToIntegerInReg: ra2.
adjust := objectMemory baseHeaderSize - 1. "shift by baseHeaderSize and then move from 1 relative to zero relative"
self AddCq: adjust R: ra1.
self MoveR: ra2 Xbr: ra1 R: rr.
objectRepresentation genConvertIntegerToSmallIntegerInReg: ra2. ]
}
otherwise: [^EncounteredUnknownBytecode].
self ssPushRegister: ra2.
^0!
More information about the Vm-dev
mailing list