<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-09-20 23:42 GMT+02:00 Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cool.  So we already have variableWord subclasses which provide a<br>
32-bit integral per slot.  This adds variableHalfWord and<br>
variableDoubleWord for 16 and 64-bit slots sizes, respectively.  May I<br>
assume these new class formats will work fine in both 32 and 64-bit<br>
spur images?<br>
<br></blockquote><div>yes, but there&#39;s currently problems with JIT at least for x64...<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Applications should be careful about assuming (#isWords =false) =<br>
(#isBytes = true) in this broader context.<br>
<div><div><br></div></div></blockquote><div>yes<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
On Tue, Sep 20, 2016 at 4:00 PM,  &lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt; wrote:<br>
&gt; Nicolas Cellier uploaded a new version of Kernel to project The Inbox:<br>
&gt; <a href="http://source.squeak.org/inbox/Kernel-nice.1039.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox<wbr>/Kernel-nice.1039.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: Kernel-nice.1039<br>
&gt; Author: nice<br>
&gt; Time: 20 September 2016, 11:00:27.302558 pm<br>
&gt; UUID: b0aeabf6-f73d-44c4-be8b-d2c66a<wbr>73486f<br>
&gt; Ancestors: Kernel-bf.1038<br>
&gt;<br>
&gt; Introduce HalfWord (16 bits) and DoubleWord (64 bits) subclasses which are possible in Spur format, but yet not exploited.<br>
&gt;<br>
&gt; =============== Diff against Kernel-bf.1038 ===============<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Behavior&gt;&gt;isDoubleWords (in category &#39;testing&#39;) -----<br>
&gt; + isDoubleWords<br>
&gt; +       &quot;Answer true if the receiver is made of 64-bit instance variables.&quot;<br>
&gt; +<br>
&gt; +       ^self instSpec = 2r1001!<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Behavior&gt;&gt;isHalfWords (in category &#39;testing&#39;) -----<br>
&gt; + isHalfWords<br>
&gt; +       &quot;Answer true if the receiver is made of 16-bit instance variables.&quot;<br>
&gt; +<br>
&gt; +       ^(self instSpec bitAnd: 2r11100) = 2r1100!<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   ----- Method: Behavior&gt;&gt;isWords (in category &#39;testing&#39;) -----<br>
&gt;   isWords<br>
&gt;         &quot;Answer true if the receiver is made of 32-bit instance variables.&quot;<br>
&gt;<br>
&gt; +       ^(self instSpec bitAnd: 2r11110) = 2r1010!<br>
&gt; -       ^self isBytes not!<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Class&gt;&gt;variableDoubleWordSubcl<wbr>ass:instanceVariableNames:clas<wbr>sVariableNames:poolDictionarie<wbr>s:category: (in category &#39;subclass creation&#39;) -----<br>
&gt; + variableDoubleWordSubclass: t instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class (the receiver) in which the subclass is to<br>
&gt; +       have indexable double-word-sized nonpointer variables.&quot;<br>
&gt; +       ^(ClassBuilder new)<br>
&gt; +               superclass: self<br>
&gt; +               variableDoubleWordSubclass: t<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat<br>
&gt; + !<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Class&gt;&gt;variableDoubleWordSubcl<wbr>ass:uses:<wbr>instanceVariableNames:classVar<wbr>iableNames:poolDictionaries:<wbr>category: (in category &#39;subclass creation&#39;) -----<br>
&gt; + variableDoubleWordSubclass: t uses: aTraitCompositionOrArray instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class (the receiver) in which the subclass is to<br>
&gt; +       have indexable double-word-sized nonpointer variables.&quot;<br>
&gt; +<br>
&gt; +       | newClass copyOfOldClass |<br>
&gt; +       copyOfOldClass := self copy.<br>
&gt; +       newClass := self<br>
&gt; +               variableDoubleWordSubclass: t<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat.<br>
&gt; +<br>
&gt; +       newClass setTraitComposition: aTraitCompositionOrArray asTraitComposition.<br>
&gt; +       SystemChangeNotifier uniqueInstance<br>
&gt; +               classDefinitionChangedFrom: copyOfOldClass to: newClass.<br>
&gt; +       ^newClass<br>
&gt; + !<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Class&gt;&gt;variableHalfWordSubclas<wbr>s:instanceVariableNames:classV<wbr>ariableNames:poolDictionaries:<wbr>category: (in category &#39;subclass creation&#39;) -----<br>
&gt; + variableHalfWordSubclass: t instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class (the receiver) in which the subclass is to<br>
&gt; +       have indexable half-word-sized nonpointer variables.&quot;<br>
&gt; +       ^(ClassBuilder new)<br>
&gt; +               superclass: self<br>
&gt; +               variableHalfWordSubclass: t<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat<br>
&gt; + !<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: Class&gt;&gt;variableHalfWordSubclas<wbr>s:uses:instanceVariableNames:c<wbr>lassVariableNames:poolDictiona<wbr>ries:category: (in category &#39;subclass creation&#39;) -----<br>
&gt; + variableHalfWordSubclass: t uses: aTraitCompositionOrArray instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class (the receiver) in which the subclass is to<br>
&gt; +       have indexable half-word-sized nonpointer variables.&quot;<br>
&gt; +<br>
&gt; +       | newClass copyOfOldClass |<br>
&gt; +       copyOfOldClass := self copy.<br>
&gt; +       newClass := self<br>
&gt; +               variableHalfWordSubclass: t<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat.<br>
&gt; +<br>
&gt; +       newClass setTraitComposition: aTraitCompositionOrArray asTraitComposition.<br>
&gt; +       SystemChangeNotifier uniqueInstance<br>
&gt; +               classDefinitionChangedFrom: copyOfOldClass to: newClass.<br>
&gt; +       ^newClass!<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   ----- Method: ClassBuilder&gt;&gt;superclass:varia<wbr>bleByteSubclass:instanceVariab<wbr>leNames:classVariableNames:poo<wbr>lDictionaries:category: (in category &#39;public&#39;) -----<br>
&gt;   superclass: aClass<br>
&gt;         variableByteSubclass: t instanceVariableNames: f<br>
&gt;         classVariableNames: d poolDictionaries: s category: cat<br>
&gt;         &quot;This is the standard initialization message for creating a new class as a<br>
&gt;         subclass of an existing class in which the subclass is to<br>
&gt;         have indexable byte-sized nonpointer variables.&quot;<br>
&gt;         | oldClassOrNil actualType env |<br>
&gt;         (aClass instSize &gt; 0)<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a byte subclass of a class with named fields&#39;].<br>
&gt;         (aClass isVariable and: [aClass isWords])<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a byte subclass of a class with word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isHalfWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a byte subclass of a class with half word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isDoubleWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a byte subclass of a class with double word fields&#39;].<br>
&gt;         (aClass isVariable and: [aClass isPointers])<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a byte subclass of a class with pointer fields&#39;].<br>
&gt;         oldClassOrNil := aClass environment at: t ifAbsent:[nil].<br>
&gt;         actualType := (oldClassOrNil notNil<br>
&gt;                                    and: [oldClassOrNil typeOfClass == #compiledMethod])<br>
&gt;                                         ifTrue: [#compiledMethod]<br>
&gt;                                         ifFalse: [#bytes].<br>
&gt;         env := CurrentEnvironment signal ifNil: [aClass environment].<br>
&gt;         ^self<br>
&gt;                 name: t<br>
&gt;                 inEnvironment: env<br>
&gt;                 subclassOf: aClass<br>
&gt;                 type: actualType<br>
&gt;                 instanceVariableNames: f<br>
&gt;                 classVariableNames: d<br>
&gt;                 poolDictionaries: s<br>
&gt;                 category: cat!<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: ClassBuilder&gt;&gt;superclass:varia<wbr>bleDoubleWordSubclass:instance<wbr>VariableNames:classVariableNam<wbr>es:poolDictionaries:category: (in category &#39;public&#39;) -----<br>
&gt; + superclass: aClass<br>
&gt; +       variableDoubleWordSubclass: t instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class in which the subclass is to<br>
&gt; +       have indexable double-word-sized nonpointer variables.&quot;<br>
&gt; +       | env |<br>
&gt; +       (aClass instSize &gt; 0)<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a double word subclass of a class with named fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isBytes])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a double word subclass of a class with byte fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isHalfWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a double word subclass of a class with half word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a double word subclass of a class with word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isPointers])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a double word subclass of a class with pointer fields&#39;].<br>
&gt; +       env := CurrentEnvironment signal ifNil: [aClass environment].<br>
&gt; +       ^self<br>
&gt; +               name: t<br>
&gt; +               inEnvironment: env<br>
&gt; +               subclassOf: aClass<br>
&gt; +               type: #longs<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat!<br>
&gt;<br>
&gt; Item was added:<br>
&gt; + ----- Method: ClassBuilder&gt;&gt;superclass:varia<wbr>bleHalfWordSubclass:instanceVa<wbr>riableNames:classVariableNames<wbr>:poolDictionaries:category: (in category &#39;public&#39;) -----<br>
&gt; + superclass: aClass<br>
&gt; +       variableHalfWordSubclass: t instanceVariableNames: f<br>
&gt; +       classVariableNames: d poolDictionaries: s category: cat<br>
&gt; +       &quot;This is the standard initialization message for creating a new class as a<br>
&gt; +       subclass of an existing class in which the subclass is to<br>
&gt; +       have indexable half-word-sized nonpointer variables.&quot;<br>
&gt; +       | env |<br>
&gt; +       (aClass instSize &gt; 0)<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a half word subclass of a class with named fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isBytes])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a half word subclass of a class with byte fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a half word subclass of a class with word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isDoubleWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a half word subclass of a class with double word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isPointers])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a half word subclass of a class with pointer fields&#39;].<br>
&gt; +       env := CurrentEnvironment signal ifNil: [aClass environment].<br>
&gt; +       ^self<br>
&gt; +               name: t<br>
&gt; +               inEnvironment: env<br>
&gt; +               subclassOf: aClass<br>
&gt; +               type: #shorts<br>
&gt; +               instanceVariableNames: f<br>
&gt; +               classVariableNames: d<br>
&gt; +               poolDictionaries: s<br>
&gt; +               category: cat!<br>
&gt;<br>
&gt; Item was changed:<br>
&gt;   ----- Method: ClassBuilder&gt;&gt;superclass:varia<wbr>bleWordSubclass:instanceVariab<wbr>leNames:classVariableNames:poo<wbr>lDictionaries:category: (in category &#39;public&#39;) -----<br>
&gt;   superclass: aClass<br>
&gt;         variableWordSubclass: t instanceVariableNames: f<br>
&gt;         classVariableNames: d poolDictionaries: s category: cat<br>
&gt;         &quot;This is the standard initialization message for creating a new class as a<br>
&gt;         subclass of an existing class in which the subclass is to<br>
&gt;         have indexable word-sized nonpointer variables.&quot;<br>
&gt;         | env |<br>
&gt;         (aClass instSize &gt; 0)<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a word subclass of a class with named fields&#39;].<br>
&gt;         (aClass isVariable and: [aClass isBytes])<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a word subclass of a class with byte fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isHalfWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a word subclass of a class with half word fields&#39;].<br>
&gt; +       (aClass isVariable and: [aClass isDoubleWords])<br>
&gt; +               ifTrue: [^self error: &#39;cannot make a word subclass of a class with double word fields&#39;].<br>
&gt;         (aClass isVariable and: [aClass isPointers])<br>
&gt;                 ifTrue: [^self error: &#39;cannot make a word subclass of a class with pointer fields&#39;].<br>
&gt;         env := CurrentEnvironment signal ifNil: [aClass environment].<br>
&gt;         ^self<br>
&gt;                 name: t<br>
&gt;                 inEnvironment: env<br>
&gt;                 subclassOf: aClass<br>
&gt;                 type: #words<br>
&gt;                 instanceVariableNames: f<br>
&gt;                 classVariableNames: d<br>
&gt;                 poolDictionaries: s<br>
&gt;                 category: cat!<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div></div>