[Vm-dev] VM Maker: VMMaker.oscog-cb.1654.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Jan 19 13:31:46 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1654.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1654
Author: cb
Time: 19 January 2016, 2:28:37.278 pm
UUID: 35bdf68b-ea60-4f01-8799-14baa71ab416
Ancestors: VMMaker.oscog-cb.1653
In the SqueakV3Bytecode set, extendedStore and extStoreAndPop are now mapped as instVar and LiteralVar stores need to be mapped for immutability. We need to generate a fake mapping to make the mcpc to bcpc mapping happy.
Starting from this version, the mcpc to bcpc is happy *except* for primitive error code. In this case, an extStore bytecode is used for the error code but is still not mapped.
=============== Diff against VMMaker.oscog-cb.1653 ===============
Item was changed:
----- Method: SimpleStackBasedCogit>>extendedStoreAndPopBytecode (in category 'bytecode generators') -----
extendedStoreAndPopBytecode
| variableType variableIndex |
variableType := byte1 >> 6 bitAnd: 3.
variableIndex := byte1 bitAnd: 63.
variableType = 0 ifTrue:
[^self genStorePop: true ReceiverVariable: variableIndex].
variableType = 1 ifTrue:
+ [self genStorePop: true TemporaryVariable: variableIndex.
+ "needs a fake map entry is Immutability is ON..."
+ self cppIf: IMMUTABILITY ifTrue: [ self annotateBytecode: self Label. ].
+ ^ 0].
- [^self genStorePop: true TemporaryVariable: variableIndex].
variableType = 3 ifTrue:
[^self genStorePop: true LiteralVariable: variableIndex].
^EncounteredUnknownBytecode!
Item was changed:
----- Method: SimpleStackBasedCogit>>extendedStoreBytecode (in category 'bytecode generators') -----
extendedStoreBytecode
| variableType variableIndex |
variableType := byte1 >> 6 bitAnd: 3.
variableIndex := byte1 bitAnd: 63.
variableType = 0 ifTrue:
[^self genStorePop: false ReceiverVariable: variableIndex].
variableType = 1 ifTrue:
+ [self genStorePop: false TemporaryVariable: variableIndex.
+ "needs a fake map entry is Immutability is ON..."
+ self cppIf: IMMUTABILITY ifTrue: [ self annotateBytecode: self Label. ].
+ ^ 0].
- [^self genStorePop: false TemporaryVariable: variableIndex].
variableType = 3 ifTrue:
[^self genStorePop: false LiteralVariable: variableIndex].
^EncounteredUnknownBytecode!
Item was changed:
----- Method: StackToRegisterMappingCogit>>doubleExtendedDoAnythingBytecode (in category 'bytecode generators') -----
doubleExtendedDoAnythingBytecode
"Replaces the Blue Book double-extended send [132], in which the first byte was wasted on 8 bits of argument count.
Here we use 3 bits for the operation sub-type (opType), and the remaining 5 bits for argument count where needed.
The last byte give access to 256 instVars or literals.
See also secondExtendedSendBytecode"
| opType |
opType := byte1 >> 5.
opType = 0 ifTrue:
[^self genSend: byte2 numArgs: (byte1 bitAnd: 31)].
opType = 1 ifTrue:
[^self genSendSuper: byte2 numArgs: (byte1 bitAnd: 31)].
"We need a map entry for this bytecode for correct parsing.
The sends will get an IsSend entry anyway. The other cases need a
fake one. We could of course special case the scanning but that's silly."
opType caseOf: {
[2] -> [(coInterpreter isReadMediatedContextInstVarIndex: byte2)
ifTrue: [self genPushMaybeContextReceiverVariable: byte2]
ifFalse: [self genPushReceiverVariable: byte2.
self ssTop annotateUse: true.
^0]].
[3] -> [self genPushLiteralIndex: byte2.
self ssTop annotateUse: true.
^0].
[4] -> [self genPushLiteralVariable: byte2.].
+ [7] -> [self genStorePop: false LiteralVariable: byte2.
+ self cppIf: IMMUTABILITY ifTrue: [ "instruction is mapped" ^0 ] ] }
- [7] -> [self genStorePop: false LiteralVariable: byte2] }
otherwise: "5 & 6"
[(coInterpreter isWriteMediatedContextInstVarIndex: byte2)
ifTrue: [self genStorePop: opType = 6 MaybeContextReceiverVariable: byte2]
+ ifFalse: [self genStorePop: opType = 6 ReceiverVariable: byte2].
+ self cppIf: IMMUTABILITY ifTrue: [ "instruction is mapped" ^0 ]].
- ifFalse: [self genStorePop: opType = 6 ReceiverVariable: byte2]].
"We need a map entry for this bytecode for correct parsing (if the method builds a frame).
We could of course special case the scanning but that's silly (or is it?)."
self assert: needsFrame.
"genPushMaybeContextInstVar, pushListVar, store & storePop all generate code"
self assert: self prevInstIsPCAnnotated not.
self annotateBytecode: self Label.
^0!
More information about the Vm-dev
mailing list