[Vm-dev] VM Maker: BytecodeSets.spur-cb.26.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 1 22:15:23 UTC 2015
ClementBera uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-cb.26.mcz
==================== Summary ====================
Name: BytecodeSets.spur-cb.26
Author: cb
Time: 1 April 2015, 3:15:17.26 pm
UUID: e8021f4f-83d5-43b0-bb3d-4fc31d02c74f
Ancestors: BytecodeSets.spur-cb.25
fixed instructionStream so Decompiler can work fine with SistaV1 methods.
Seemingly the decompiler finds out that both V3PlusClosure and SistaV1 have the same bytecodes now. Therefore I think the image does not run because of VM-side bug.
=============== Diff against BytecodeSets.spur-cb.25 ===============
Item was changed:
----- Method: InstructionStream>>interpretNext2ByteSistaV1Instruction:for:extA:extB:startPC: (in category '*BytecodeSets-SistaV1-decoding') -----
interpretNext2ByteSistaV1Instruction: 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 two-byte codes.
For a table of the bytecode set, see EncoderForV1's class comment."
| byte method |
method := self method.
byte := self method at: pc.
pc := pc + 1.
"We do an inline quasi-binary search on bytecode"
bytecode < 234 ifTrue: "pushes"
[bytecode < 231 ifTrue:
[bytecode < 229 ifTrue:
[| literal |
bytecode = 226 ifTrue:
[^client pushReceiverVariable: (extA bitShift: 8) + byte].
literal := method literalAt: (extA bitShift: 8) + byte + 1.
bytecode = 227 ifTrue:
[^client pushLiteralVariable: literal].
^client pushConstant: literal].
bytecode = 229 ifTrue:
+ [^client pushTemporaryVariable: byte].
+ ^client pushClosureTemps: byte].
- [^client pushClosureTemps: byte].
- ^client pushTemporaryVariable: byte].
bytecode = 231 ifTrue:
[^byte < 128
ifTrue: [client pushNewArrayOfSize: byte]
ifFalse: [client pushConsArrayWithElements: byte - 128]].
bytecode = 232 ifTrue:
[^client pushConstant: (extB bitShift: 8) + byte].
^client pushConstant: (Character value: (extB bitShift: 8) + byte)].
bytecode < 240 ifTrue: "sends, trap and jump"
[bytecode < 236 ifTrue: "sends"
[^client
send: (method literalAt: (extA bitShift: 5) + (byte // 8) + 1)
super: bytecode = 235
numArgs: (extB bitShift: 3) + (byte \\ 8)].
bytecode = 236 ifTrue:
[^client trapIfNotInstanceOf: (method literalAt: (extA bitShift: 8) + byte + 1)].
bytecode = 237 ifTrue:
[^client jump: (extB bitShift: 8) + byte].
^client jump: (extB bitShift: 8) + byte if: bytecode = 238].
bytecode < 243 ifTrue:
[bytecode = 240 ifTrue:
[^client popIntoReceiverVariable: (extA bitShift: 8) + byte].
bytecode = 241 ifTrue:
[^client popIntoLiteralVariable: (method literalAt: (extA bitShift: 8) + byte + 1)].
^client popIntoTemporaryVariable: byte].
bytecode = 243 ifTrue:
[^client storeIntoReceiverVariable: (extA bitShift: 8) + byte].
bytecode = 244 ifTrue:
[^client storeIntoLiteralVariable: (method literalAt: (extA bitShift: 8) + byte + 1)].
bytecode = 245 ifTrue:
[^client storeIntoTemporaryVariable: byte].
"246-247 1111011 i xxxxxxxx UNASSIGNED"
^self unusedBytecode: client at: startPC!
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 |
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:
[^client callPrimitive: byte2 + (byte3 bitShift: 8)].
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 popIntoRemoteTemp: byte2 inVectorAt: byte3].
- bytecode = 253 ifTrue:
[^client storeIntoRemoteTemp: byte2 inVectorAt: byte3].
+ bytecode = 253 ifTrue:
+ [^client popIntoRemoteTemp: byte2 inVectorAt: byte3].
"249 11111001 xxxxxxxx syyyyyyy Reserved for Push Float"
"254-255 1111111 i xxxxxxxx yyyyyyyy UNASSIGNED"
^self unusedBytecode: client at: startPC!
More information about the Vm-dev
mailing list