[squeak-dev] The Inbox: Kernel-nice.1039.mcz

Bert Freudenberg bert at freudenbergs.de
Wed Sep 21 07:36:31 UTC 2016


On Tue, Sep 20, 2016 at 11:00 PM, <commits at source.squeak.org> wrote:

> Item was added:
> + ----- Method: Behavior>>isDoubleWords (in category 'testing') -----
> + isDoubleWords
> +       "Answer true if the receiver is made of 64-bit instance variables."
> +
> +       ^self instSpec = 2r1001!
>
> Item was added:
> + ----- Method: Behavior>>isHalfWords (in category 'testing') -----
> + isHalfWords
> +       "Answer true if the receiver is made of 16-bit instance variables."
> +
> +       ^(self instSpec bitAnd: 2r11100) = 2r1100!
>
> Item was changed:
>   ----- Method: Behavior>>isWords (in category 'testing') -----
>   isWords
>         "Answer true if the receiver is made of 32-bit instance variables."
>
> +       ^(self instSpec bitAnd: 2r11110) = 2r1010!
> -       ^self isBytes not!
>
>
In an instSpec, the lower bits are always 0, so no need to bitAnd:.
Equality test would be fine:

"Formats 11, 13-15, 17-23 & 25-31 are unused in classes but used in
instances to define the number of elements missing up to the slot size."

The test in isBytes needs to cover both ByteArrays and CompiledMethods,
that's why it does not use equality.

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


More information about the Squeak-dev mailing list