[squeak-dev] [5.1] DataStream bug (MessageNotUnderstood: UndefinedObject>>instSize)

Bert Freudenberg bert at freudenbergs.de
Thu Aug 25 12:18:57 UTC 2016


On Thu, Aug 25, 2016 at 12:25 PM, Bert Freudenberg <bert at freudenbergs.de>
wrote:

> No, it's a only problem in the specific image I was using, not in the
> actual release image:
>
> 0 class
> ==> SmallInteger
>
> 1 class
> ==> nil
>
> All odd SmallInts answer nil when asked for their class ... I'll show this
> to Eliot later (we're all in Prague for ESUG right now).
>

Yep, Eliot recognized the issue immediately. In Spur, all classes are held
in a table indexed by the class's identity hash. SqueakJS doesn't need that
table (it uses direct class pointers) so it generates it when storing the
image. This worked fine, except that the SmallInteger class needs to be put
in two slots of the class table: 1 (which is its hash) and 3. I fixed this
in SqueakJS now so all is good.

This has to do with the special class lookup for immediate objects. For
them, Spur simply masks the tag bits, and uses the value as index into the
class table. In 32 bits we have two tag bits, but both 2r01 and 2r11 are
used for SmallIntegers. Character uses 2r10, which is why Character's hash
has to be 2. All regular objects use tag bits 2r00.

- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160825/bb24f180/attachment.htm


More information about the Squeak-dev mailing list