[squeak-dev] Bug in EncoderForSistaV1

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jul 3 10:34:47 UTC 2019


Hi, there.

The encoder for Sista cannot tell about references to instance variables that are behind compiled blocks.

Object subclass: #MyExampleClass
instanceVariableNames: 'field'
...
MyExampleClass >> #foobar
   ^ [field] value

This is the problem:

(MyExampleClass >> #foobar) readsField: 1.  "false"

Works fine if:

MyExampleClass >> #foobar
   ^ field

I don't feel able to fix that bug here:

EncoderForSistaV1 >> instVarReadScanBlockFor: varIndexCode using: scanner
"Answer a block argument for InstructionStream>>scanFor: that answers true
for reads of the inst var with zero-relative index varIndexCode.
N.B. Don't assume the compiler uses the most compact encoding available."

" 0-15 0000 i i i i Push Receiver Variable #iiii
* 224 11100000 aaaaaaaa Extend A (Ext A = Ext A prev * 256 + Ext A)
* 226 11100010 i i i i i i i i Push Receiver Variable #iiiiiiii (+ Extend A * 256)"
| extension |
extension := 0.
^[:b| | prevext |
  prevext := extension.
  extension := b = 224 ifTrue: [scanner followingByte bitShift: 8] ifFalse: [0].
  (b < 16 and: [b = varIndexCode])
   or: [b = 226
and: [scanner followingByte + prevext = varIndexCode]]]

Volunteers? :-)

Best,
Marcel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190703/3765c306/attachment.html>


More information about the Squeak-dev mailing list