[Vm-dev] VM Maker: VMMaker.oscog-eem.1818.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 19 06:02:23 UTC 2016
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.1818.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.1818
Author: eem
Time: 18 April 2016, 11:00:43.154499 pm
UUID: 247e87e6-3e55-41b3-9801-7366a5913066
Ancestors: VMMaker.oscog-cb.1817
Abstract out the asnnotate Label or Nop riutine and use it to fix doubleExtendedDoAnythingBytecode
=============== Diff against VMMaker.oscog-cb.1817 ===============
Item was added:
+ ----- Method: StackToRegisterMappingCogit>>annotateInstructionForBytecode (in category 'bytecode generator support') -----
+ annotateInstructionForBytecode
+ "Annotate the current instruction as having a bytecode pc. If the current instruction
+ is already annotated, insert a nop and annotate that. We cannot have the same instruction
+ address carry multiple annotations."
+ <inline: true>
+ self annotateBytecode: (self prevInstIsPCAnnotated
+ ifTrue: [self Nop]
+ ifFalse: [self Label]).!
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."
opType caseOf: {
[2] -> [(coInterpreter isReadMediatedContextInstVarIndex: byte2)
ifTrue: [self genPushMaybeContextReceiverVariable: byte2]
ifFalse: [self genPushReceiverVariable: byte2.
+ self annotateInstructionForBytecode.
- self annotateBytecode: self Label.
^0]].
[3] -> [self genPushLiteralIndex: byte2.
+ self annotateInstructionForBytecode.
- self annotateBytecode: self Label.
^0].
[4] -> [self genPushLiteralVariable: byte2.].
[7] -> [self genStorePop: false LiteralVariable: byte2.
self cppIf: IMMUTABILITY ifTrue: [ "genStorePop:LiteralVariable: annotates; don't annotate twice" ^0 ] ] }
otherwise: "5 & 6"
[(coInterpreter isWriteMediatedContextInstVarIndex: byte2)
ifTrue: [self genStorePop: opType = 6 MaybeContextReceiverVariable: byte2]
ifFalse: [self genStorePop: opType = 6 ReceiverVariable: byte2].
self cppIf: IMMUTABILITY ifTrue: [ "genStorePop:LiteralVariable: annotates; don't annotate twice" ^0 ]].
"We need a map entry for this bytecode for correct parsing (if the method builds a frame)."
self assert: needsFrame.
"genPushMaybeContextInstVar, pushListVar, store & storePop all generate code"
self assert: self prevInstIsPCAnnotated not.
self annotateBytecode: self Label.
^0!
Item was changed:
----- Method: StackToRegisterMappingCogit>>ssPushAnnotatedConstant: (in category 'simulation stack') -----
ssPushAnnotatedConstant: literal
self ssPush: 1.
self updateSimSpillBase.
self ssTop
type: SSConstant;
spilled: false;
constant: literal;
bcptr: bytecodePC.
+ self annotateInstructionForBytecode.
- self annotateBytecode: self Label.
^0!
More information about the Vm-dev
mailing list