<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 20, 2016 at 11:00 PM, <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Item was added:<br>
+ ----- Method: Behavior>>isDoubleWords (in category 'testing') -----<br>
+ isDoubleWords<br>
+ "Answer true if the receiver is made of 64-bit instance variables."<br>
+<br>
+ ^self instSpec = 2r1001!<br>
<br>
Item was added:<br>
+ ----- Method: Behavior>>isHalfWords (in category 'testing') -----<br>
+ isHalfWords<br>
+ "Answer true if the receiver is made of 16-bit instance variables."<br>
+<br>
+ ^(self instSpec bitAnd: 2r11100) = 2r1100!<br>
<br>
Item was changed:<br>
----- Method: Behavior>>isWords (in category 'testing') -----<br>
isWords<br>
"Answer true if the receiver is made of 32-bit instance variables."<br>
<br>
+ ^(self instSpec bitAnd: 2r11110) = 2r1010!<br>
- ^self isBytes not!<br><br></blockquote><div><br></div><div>In an instSpec, the lower bits are always 0, so no need to bitAnd:. Equality test would be fine:</div><div><br></div><div>"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."</div><div><br></div><div>The test in isBytes needs to cover both ByteArrays and CompiledMethods, that's why it does not use equality.</div><div><br></div><div><div>- Bert -</div></div></div><br></div></div>