[Vm-dev] VM Maker: BytecodeSets.spur-rmacnak.40.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat May 2 05:37:06 UTC 2015
Ryan Macnak uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-rmacnak.40.mcz
==================== Summary ====================
Name: BytecodeSets.spur-rmacnak.40
Author: rmacnak
Time: 1 May 2015, 10:37:01.431 pm
UUID: a1732ef4-313b-4f26-a393-03dd1675bd3a
Ancestors: BytecodeSets.spur-cb.39
More decoding for absent self and outer sends.
=============== Diff against BytecodeSets.spur-cb.39 ===============
Item was changed:
----- Method: EncoderForNewsqueakV4 class>>isSendAt:in: (in category 'instruction stream support') -----
isSendAt: pc in: method
"Answer whether the bytecode at pc is a message-send."
" 80-95 0101 i i i i Send Arithmetic Message #iiii
96-111 0110 i i i i Send Special Message #iiii
112-127 0111 i i i i Send Literal Selector #iiii With 0 Arguments
128-143 1000 i i i i Send Literal Selector #iiii With 1 Argument
144-159 1001 i i i i Send Literal Selector #iiii With 2 Arguments
160-175 1010 i i i i Send To Absent Implicit Receiver Literal Selector #iiii With 0 Arguments
* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A)
* 225 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B)
** 238 11101110 i i i i i j j j Send Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
** 239 11101111 i i i i i j j j Send To Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
** 240 11110000 i i i i i j j j Send To Absent Implicit Receiver Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ ** 241 11110001 i i i i i j j j Send To Absent Dynamic Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ ** 245 11110101 i i i i i j j j Send To Absent Self Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ ** 254 11111110 i i i i i j j j kkkkkkkk Send To Absent Outer Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments Depth kkkkkkkk"
- ** 241 11110001 i i i i i j j j Send To Absent Dynamic Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments"
-
| byte |
byte := self nonExtensionBytecodeAt: pc in: method.
+ ^(((byte >= 80 and: [byte <= 175])
+ or: [byte <= 241 and: [byte >= 238]])
+ or: [byte == 245] or: [byte == 254])!
- ^byte >= 80
- and: [byte <= 175
- or: [byte <= 241 and: [byte >= 238]]]!
Item was changed:
----- Method: EncoderForNewsqueakV4 class>>selectorToSendOrItselfFor:in:at: (in category 'instruction stream support') -----
selectorToSendOrItselfFor: anInstructionStream in: method at: pc
"If anInstructionStream is at a send bytecode then answer the send's selector,
otherwise answer anInstructionStream itself. The rationale for answering
anInstructionStream instead of, say, nil, is that potentially any existing object
can be used as a selector, but since anInstructionStream postdates the method,
it can't be one of them.
The compilcation is that for convenience we assume the pc could be
pointing to the raw send bytecode after its extensions, or at the extension
preceeding the raw send bytecode.
80-95 0101 i i i i Send Arithmetic Message #iiii
96-111 0110 i i i i Send Special Message #iiii
112-127 0111 i i i i Send Literal Selector #iiii With 0 Arguments
128-143 1000 i i i i Send Literal Selector #iiii With 1 Argument
144-159 1001 i i i i Send Literal Selector #iiii With 2 Arguments
160-175 1010 i i i i Send To Absent Implicit Receiver Literal Selector #iiii With 0 Arguments
224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A)
225 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B)
238 11101110 i i i i i j j j Send Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
239 11101111 i i i i i j j j Send To Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
240 11110000 i i i i i j j j Send To Absent Implicit Receiver Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ 241 11110001 i i i i i j j j Send To Absent Dynamic Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ 245 11110101 i i i i i j j j Send To Absent Self Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ 254 11111110 i i i i i j j j kkkkkkkk Send To Absent Outer Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments Depth kkkkkkkk"
- 241 11110001 i i i i i j j j Send To Absent Dynamic Superclass Literal Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments"
| byte |
byte := method at: pc.
byte < 80 ifTrue:
[^anInstructionStream].
byte <= 175 ifTrue:
["special byte or short send"
^byte >= 112
ifTrue: [method literalAt: (byte bitAnd: 15) + 1]
ifFalse: [Smalltalk specialSelectorAt: byte - 79]].
byte < 238 ifTrue:
[(byte >= 224 and: [byte <= 225]) ifTrue:
[^self extensionsAt: pc in: method into:
[:extA :extB :nExtBytes| | byteAfter index |
byteAfter := method at: pc + nExtBytes.
(byteAfter >= 238 and: [byteAfter <= 241])
ifTrue:
[index := ((method at: pc + nExtBytes + 1) bitShift: -3) + (extA bitShift: 5).
method literalAt: index + 1]
ifFalse: [anInstructionStream]]].
^anInstructionStream].
+ (byte <= 241 or: [byte == 245 or: [byte == 254]])
+ ifFalse: [^anInstructionStream].
- byte > 241 ifTrue:
- [^anInstructionStream].
"they could be extended..."
^self extensionsFor: pc in: method into:
[:extA :extB :nExtBytes| | index |
index := ((method at: pc + 1) bitShift: -3) + (extA bitShift: 5).
method literalAt: index + 1]!
More information about the Vm-dev
mailing list