[Vm-dev] VM Maker: BytecodeSets.spur-eem.68.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Jan 19 18:27:59 UTC 2017
Eliot Miranda uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-eem.68.mcz
==================== Summary ====================
Name: BytecodeSets.spur-eem.68
Author: eem
Time: 19 January 2017, 10:27:52.847893 am
UUID: 9e0cc882-b0bb-468f-b9a6-325c805d5897
Ancestors: BytecodeSets.spur-cb.66
Fix a slip in branchIfNotInstanceOf:distance: decoding.
(Ignore the fix in BytecodeSets.spur-eem.67; it is wrong)
=============== Diff against BytecodeSets.spur-cb.66 ===============
Item was changed:
----- Method: InstructionStream>>interpretNext3ByteSistaV1Instruction:for:extA:extB:startPC: (in category '*BytecodeSets-SistaV1-decoding') -----
interpretNext3ByteSistaV1Instruction: bytecode for: client extA: extA extB: extB startPC: startPC
"Send to the argument, client, a message that specifies the next instruction.
This method handles the three-byte codes.
For a table of the bytecode set, see EncoderForSistaV1's class comment."
| method byte2 byte3 literal |
method := self method.
byte2 := method at: pc.
byte3 := method at: pc + 1.
pc := pc + 2.
"we search the bytecodes by what we expect to be the static frequency."
bytecode = 248 ifTrue:
[byte3 >= 128 ifTrue:
[^client callInlinePrimitive: byte2 + (byte3 - 128 bitShift: 8)].
^client callPrimitive: byte2 + (byte3 bitShift: 8)].
"* 249 11111001 xxxxxxxx siyyyyyy push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1"
bytecode = 249 ifTrue:
[literal := method literalAt: (extA bitShift: 8) + byte2 + 1.
^client pushFullClosure: literal numCopied: (byte3 bitAnd: 16r3F)].
bytecode = 250 ifTrue:
["** 250 11111010 eeiiikkk jjjjjjjj Push Closure Num Copied iii (+ExtA//16*8) Num Args kkk (+ ExtA\\16*8) BlockSize jjjjjjjj (+ExtB*256). ee = num extensions"
^client
pushClosureCopyNumCopiedValues: ((byte2 bitShift: -3) bitAnd: 7) + (extA // 16 bitShift: 3)
numArgs: (byte2 bitAnd: 7) + (extA \\ 16 bitShift: 3)
blockSize: byte3 + (extB bitShift: 8)].
bytecode = 251 ifTrue:
[^client pushRemoteTemp: byte2 inVectorAt: byte3].
bytecode = 252 ifTrue:
[^client storeIntoRemoteTemp: byte2 inVectorAt: byte3].
bytecode = 253 ifTrue:
[^client popIntoRemoteTemp: byte2 inVectorAt: byte3].
"** 254 11111110 kkkkkkkk jjjjjjjj branch If Not Instance Of Behavior/Array Of Behavior kkkkkkkk (+ Extend A * 256, where Extend A >= 0) distance jjjjjjjj (+ Extend B * 256, where Extend B >= 0)"
+ bytecode = 254 ifTrue: "The sign bit of extB inverts the operation. Would like to have extB < -128, but this is good enough for now."
+ [extB < 0 ifTrue: [^client branchIfInstanceOf: literal distance: (extB + 128 bitShift: 8) + byte3].
+ ^client branchIfNotInstanceOf: literal distance: (extB bitShift: 8) + byte3].
- bytecode = 254 ifTrue:
- [extB < 0 ifTrue: [client branchIfInstanceOf: literal distance: (extB + 128 bitShift: 8) + byte3].
- ^ client branchIfNotInstanceOf: literal distance: (extB bitShift: 8) + byte3 ].
^self unusedBytecode: client at: startPC!
More information about the Vm-dev
mailing list