<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"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></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'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, <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br>
> Nicolas Cellier uploaded a new version of Kernel to project The Inbox:<br>
> <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>
><br>
> ==================== Summary ====================<br>
><br>
> Name: Kernel-nice.1039<br>
> Author: nice<br>
> Time: 20 September 2016, 11:00:27.302558 pm<br>
> UUID: b0aeabf6-f73d-44c4-be8b-d2c66a<wbr>73486f<br>
> Ancestors: Kernel-bf.1038<br>
><br>
> Introduce HalfWord (16 bits) and DoubleWord (64 bits) subclasses which are possible in Spur format, but yet not exploited.<br>
><br>
> =============== Diff against Kernel-bf.1038 ===============<br>
><br>
> 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>
> Item was added:<br>
> + ----- Method: Class>>variableDoubleWordSubcl<wbr>ass:instanceVariableNames:clas<wbr>sVariableNames:poolDictionarie<wbr>s:category: (in category 'subclass creation') -----<br>
> + variableDoubleWordSubclass: t instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class (the receiver) in which the subclass is to<br>
> + have indexable double-word-sized nonpointer variables."<br>
> + ^(ClassBuilder new)<br>
> + superclass: self<br>
> + variableDoubleWordSubclass: t<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat<br>
> + !<br>
><br>
> Item was added:<br>
> + ----- Method: Class>>variableDoubleWordSubcl<wbr>ass:uses:<wbr>instanceVariableNames:classVar<wbr>iableNames:poolDictionaries:<wbr>category: (in category 'subclass creation') -----<br>
> + variableDoubleWordSubclass: t uses: aTraitCompositionOrArray instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class (the receiver) in which the subclass is to<br>
> + have indexable double-word-sized nonpointer variables."<br>
> +<br>
> + | newClass copyOfOldClass |<br>
> + copyOfOldClass := self copy.<br>
> + newClass := self<br>
> + variableDoubleWordSubclass: t<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat.<br>
> +<br>
> + newClass setTraitComposition: aTraitCompositionOrArray asTraitComposition.<br>
> + SystemChangeNotifier uniqueInstance<br>
> + classDefinitionChangedFrom: copyOfOldClass to: newClass.<br>
> + ^newClass<br>
> + !<br>
><br>
> Item was added:<br>
> + ----- Method: Class>>variableHalfWordSubclas<wbr>s:instanceVariableNames:classV<wbr>ariableNames:poolDictionaries:<wbr>category: (in category 'subclass creation') -----<br>
> + variableHalfWordSubclass: t instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class (the receiver) in which the subclass is to<br>
> + have indexable half-word-sized nonpointer variables."<br>
> + ^(ClassBuilder new)<br>
> + superclass: self<br>
> + variableHalfWordSubclass: t<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat<br>
> + !<br>
><br>
> Item was added:<br>
> + ----- Method: Class>>variableHalfWordSubclas<wbr>s:uses:instanceVariableNames:c<wbr>lassVariableNames:poolDictiona<wbr>ries:category: (in category 'subclass creation') -----<br>
> + variableHalfWordSubclass: t uses: aTraitCompositionOrArray instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class (the receiver) in which the subclass is to<br>
> + have indexable half-word-sized nonpointer variables."<br>
> +<br>
> + | newClass copyOfOldClass |<br>
> + copyOfOldClass := self copy.<br>
> + newClass := self<br>
> + variableHalfWordSubclass: t<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat.<br>
> +<br>
> + newClass setTraitComposition: aTraitCompositionOrArray asTraitComposition.<br>
> + SystemChangeNotifier uniqueInstance<br>
> + classDefinitionChangedFrom: copyOfOldClass to: newClass.<br>
> + ^newClass!<br>
><br>
> Item was changed:<br>
> ----- Method: ClassBuilder>>superclass:varia<wbr>bleByteSubclass:instanceVariab<wbr>leNames:classVariableNames:poo<wbr>lDictionaries:category: (in category 'public') -----<br>
> superclass: aClass<br>
> variableByteSubclass: t instanceVariableNames: f<br>
> classVariableNames: d poolDictionaries: s category: cat<br>
> "This is the standard initialization message for creating a new class as a<br>
> subclass of an existing class in which the subclass is to<br>
> have indexable byte-sized nonpointer variables."<br>
> | oldClassOrNil actualType env |<br>
> (aClass instSize > 0)<br>
> ifTrue: [^self error: 'cannot make a byte subclass of a class with named fields'].<br>
> (aClass isVariable and: [aClass isWords])<br>
> ifTrue: [^self error: 'cannot make a byte subclass of a class with word fields'].<br>
> + (aClass isVariable and: [aClass isHalfWords])<br>
> + ifTrue: [^self error: 'cannot make a byte subclass of a class with half word fields'].<br>
> + (aClass isVariable and: [aClass isDoubleWords])<br>
> + ifTrue: [^self error: 'cannot make a byte subclass of a class with double word fields'].<br>
> (aClass isVariable and: [aClass isPointers])<br>
> ifTrue: [^self error: 'cannot make a byte subclass of a class with pointer fields'].<br>
> oldClassOrNil := aClass environment at: t ifAbsent:[nil].<br>
> actualType := (oldClassOrNil notNil<br>
> and: [oldClassOrNil typeOfClass == #compiledMethod])<br>
> ifTrue: [#compiledMethod]<br>
> ifFalse: [#bytes].<br>
> env := CurrentEnvironment signal ifNil: [aClass environment].<br>
> ^self<br>
> name: t<br>
> inEnvironment: env<br>
> subclassOf: aClass<br>
> type: actualType<br>
> instanceVariableNames: f<br>
> classVariableNames: d<br>
> poolDictionaries: s<br>
> category: cat!<br>
><br>
> Item was added:<br>
> + ----- Method: ClassBuilder>>superclass:varia<wbr>bleDoubleWordSubclass:instance<wbr>VariableNames:classVariableNam<wbr>es:poolDictionaries:category: (in category 'public') -----<br>
> + superclass: aClass<br>
> + variableDoubleWordSubclass: t instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class in which the subclass is to<br>
> + have indexable double-word-sized nonpointer variables."<br>
> + | env |<br>
> + (aClass instSize > 0)<br>
> + ifTrue: [^self error: 'cannot make a double word subclass of a class with named fields'].<br>
> + (aClass isVariable and: [aClass isBytes])<br>
> + ifTrue: [^self error: 'cannot make a double word subclass of a class with byte fields'].<br>
> + (aClass isVariable and: [aClass isHalfWords])<br>
> + ifTrue: [^self error: 'cannot make a double word subclass of a class with half word fields'].<br>
> + (aClass isVariable and: [aClass isWords])<br>
> + ifTrue: [^self error: 'cannot make a double word subclass of a class with word fields'].<br>
> + (aClass isVariable and: [aClass isPointers])<br>
> + ifTrue: [^self error: 'cannot make a double word subclass of a class with pointer fields'].<br>
> + env := CurrentEnvironment signal ifNil: [aClass environment].<br>
> + ^self<br>
> + name: t<br>
> + inEnvironment: env<br>
> + subclassOf: aClass<br>
> + type: #longs<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat!<br>
><br>
> Item was added:<br>
> + ----- Method: ClassBuilder>>superclass:varia<wbr>bleHalfWordSubclass:instanceVa<wbr>riableNames:classVariableNames<wbr>:poolDictionaries:category: (in category 'public') -----<br>
> + superclass: aClass<br>
> + variableHalfWordSubclass: t instanceVariableNames: f<br>
> + classVariableNames: d poolDictionaries: s category: cat<br>
> + "This is the standard initialization message for creating a new class as a<br>
> + subclass of an existing class in which the subclass is to<br>
> + have indexable half-word-sized nonpointer variables."<br>
> + | env |<br>
> + (aClass instSize > 0)<br>
> + ifTrue: [^self error: 'cannot make a half word subclass of a class with named fields'].<br>
> + (aClass isVariable and: [aClass isBytes])<br>
> + ifTrue: [^self error: 'cannot make a half word subclass of a class with byte fields'].<br>
> + (aClass isVariable and: [aClass isWords])<br>
> + ifTrue: [^self error: 'cannot make a half word subclass of a class with word fields'].<br>
> + (aClass isVariable and: [aClass isDoubleWords])<br>
> + ifTrue: [^self error: 'cannot make a half word subclass of a class with double word fields'].<br>
> + (aClass isVariable and: [aClass isPointers])<br>
> + ifTrue: [^self error: 'cannot make a half word subclass of a class with pointer fields'].<br>
> + env := CurrentEnvironment signal ifNil: [aClass environment].<br>
> + ^self<br>
> + name: t<br>
> + inEnvironment: env<br>
> + subclassOf: aClass<br>
> + type: #shorts<br>
> + instanceVariableNames: f<br>
> + classVariableNames: d<br>
> + poolDictionaries: s<br>
> + category: cat!<br>
><br>
> Item was changed:<br>
> ----- Method: ClassBuilder>>superclass:varia<wbr>bleWordSubclass:instanceVariab<wbr>leNames:classVariableNames:poo<wbr>lDictionaries:category: (in category 'public') -----<br>
> superclass: aClass<br>
> variableWordSubclass: t instanceVariableNames: f<br>
> classVariableNames: d poolDictionaries: s category: cat<br>
> "This is the standard initialization message for creating a new class as a<br>
> subclass of an existing class in which the subclass is to<br>
> have indexable word-sized nonpointer variables."<br>
> | env |<br>
> (aClass instSize > 0)<br>
> ifTrue: [^self error: 'cannot make a word subclass of a class with named fields'].<br>
> (aClass isVariable and: [aClass isBytes])<br>
> ifTrue: [^self error: 'cannot make a word subclass of a class with byte fields'].<br>
> + (aClass isVariable and: [aClass isHalfWords])<br>
> + ifTrue: [^self error: 'cannot make a word subclass of a class with half word fields'].<br>
> + (aClass isVariable and: [aClass isDoubleWords])<br>
> + ifTrue: [^self error: 'cannot make a word subclass of a class with double word fields'].<br>
> (aClass isVariable and: [aClass isPointers])<br>
> ifTrue: [^self error: 'cannot make a word subclass of a class with pointer fields'].<br>
> env := CurrentEnvironment signal ifNil: [aClass environment].<br>
> ^self<br>
> name: t<br>
> inEnvironment: env<br>
> subclassOf: aClass<br>
> type: #words<br>
> instanceVariableNames: f<br>
> classVariableNames: d<br>
> poolDictionaries: s<br>
> category: cat!<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>