[squeak-dev] The Trunk: Kernel-eem.1496.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Jan 9 18:14:58 UTC 2023
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1496.mcz
==================== Summary ====================
Name: Kernel-eem.1496
Author: eem
Time: 9 January 2023, 10:14:53.48949 am
UUID: 34ebd1bb-6af6-43f7-b335-abf5dc61d555
Ancestors: Kernel-eem.1495
Fix interpretJump (Decompiler) for SistaV1 short jumps. (how on earth has this gone undetected for 8+ years??)
=============== Diff against Kernel-eem.1495 ===============
Item was changed:
----- Method: InstructionStream>>interpretSistaV1Jump (in category 'decoding - private - sista v1') -----
interpretSistaV1Jump
"If the instruction at pc is an unconditional jump, interpret it, advancing the pc,
and answering the jump distance. Otherwise answer nil."
" 176-183 10110 iii Jump iii + 1 (i.e., 1 through 8)
* 225/16rE1 11100001 sbbbbbbb Extend B (Ext B = Ext B prev * 256 + Ext B)
* 237 11101101 iiiiiiii Jump #iiiiiiii (+ Extend B * 256, where bbbbbbbb = sddddddd, e.g. -32768 = i=0, a=0, s=1)"
| method byte nextpc extB |
method := self method.
"consume and compute any extension first."
extB := 0.
nextpc := pc. "must not advance pc unless this is a jump."
[byte := self method at: nextpc.
nextpc := nextpc + 1.
byte = 16rE1] whileTrue:
[| extByte |
extByte := self method at: nextpc.
nextpc := nextpc + 1.
extB := (extB = 0 and: [extByte > 127])
ifTrue: [extByte - 256]
ifFalse: [(extB bitShift: 8) + extByte]].
(byte between: 176 and: 183) ifTrue:
[pc := nextpc.
+ ^byte - 175].
- ^byte - 191].
byte = 237 ifTrue:
[byte := method at: nextpc.
pc := nextpc + 1.
^(extB bitShift: 8) + byte].
^nil!
More information about the Squeak-dev
mailing list
|