[squeak-dev] The Inbox: Kernel-nice.1039.mcz
Nicolas Cellier
nicolas.cellier.aka.nice at gmail.com
Wed Sep 21 06:47:11 UTC 2016
2016-09-20 23:42 GMT+02:00 Chris Muller <asqueaker at gmail.com>:
> Cool. So we already have variableWord subclasses which provide a
> 32-bit integral per slot. This adds variableHalfWord and
> variableDoubleWord for 16 and 64-bit slots sizes, respectively. May I
> assume these new class formats will work fine in both 32 and 64-bit
> spur images?
>
> yes, but there's currently problems with JIT at least for x64...
> Applications should be careful about assuming (#isWords =false) =
> (#isBytes = true) in this broader context.
>
> yes
> On Tue, Sep 20, 2016 at 4:00 PM, <commits at source.squeak.org> wrote:
> > Nicolas Cellier uploaded a new version of Kernel to project The Inbox:
> > http://source.squeak.org/inbox/Kernel-nice.1039.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-nice.1039
> > Author: nice
> > Time: 20 September 2016, 11:00:27.302558 pm
> > UUID: b0aeabf6-f73d-44c4-be8b-d2c66a73486f
> > Ancestors: Kernel-bf.1038
> >
> > Introduce HalfWord (16 bits) and DoubleWord (64 bits) subclasses which
> are possible in Spur format, but yet not exploited.
> >
> > =============== Diff against Kernel-bf.1038 ===============
> >
> > 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!
> >
> > Item was added:
> > + ----- Method: Class>>variableDoubleWordSubcl
> ass:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'subclass creation') -----
> > + variableDoubleWordSubclass: t instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class (the receiver) in which the
> subclass is to
> > + have indexable double-word-sized nonpointer variables."
> > + ^(ClassBuilder new)
> > + superclass: self
> > + variableDoubleWordSubclass: t
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat
> > + !
> >
> > Item was added:
> > + ----- Method: Class>>variableDoubleWordSubclass:uses:
> instanceVariableNames:classVariableNames:poolDictionaries:category: (in
> category 'subclass creation') -----
> > + variableDoubleWordSubclass: t uses: aTraitCompositionOrArray
> instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class (the receiver) in which the
> subclass is to
> > + have indexable double-word-sized nonpointer variables."
> > +
> > + | newClass copyOfOldClass |
> > + copyOfOldClass := self copy.
> > + newClass := self
> > + variableDoubleWordSubclass: t
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat.
> > +
> > + newClass setTraitComposition: aTraitCompositionOrArray
> asTraitComposition.
> > + SystemChangeNotifier uniqueInstance
> > + classDefinitionChangedFrom: copyOfOldClass to: newClass.
> > + ^newClass
> > + !
> >
> > Item was added:
> > + ----- Method: Class>>variableHalfWordSubclas
> s:instanceVariableNames:classVariableNames:poolDictionaries:category: (in
> category 'subclass creation') -----
> > + variableHalfWordSubclass: t instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class (the receiver) in which the
> subclass is to
> > + have indexable half-word-sized nonpointer variables."
> > + ^(ClassBuilder new)
> > + superclass: self
> > + variableHalfWordSubclass: t
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat
> > + !
> >
> > Item was added:
> > + ----- Method: Class>>variableHalfWordSubclas
> s:uses:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'subclass creation') -----
> > + variableHalfWordSubclass: t uses: aTraitCompositionOrArray
> instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class (the receiver) in which the
> subclass is to
> > + have indexable half-word-sized nonpointer variables."
> > +
> > + | newClass copyOfOldClass |
> > + copyOfOldClass := self copy.
> > + newClass := self
> > + variableHalfWordSubclass: t
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat.
> > +
> > + newClass setTraitComposition: aTraitCompositionOrArray
> asTraitComposition.
> > + SystemChangeNotifier uniqueInstance
> > + classDefinitionChangedFrom: copyOfOldClass to: newClass.
> > + ^newClass!
> >
> > Item was changed:
> > ----- Method: ClassBuilder>>superclass:varia
> bleByteSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'public') -----
> > superclass: aClass
> > variableByteSubclass: t instanceVariableNames: f
> > classVariableNames: d poolDictionaries: s category: cat
> > "This is the standard initialization message for creating a new
> class as a
> > subclass of an existing class in which the subclass is to
> > have indexable byte-sized nonpointer variables."
> > | oldClassOrNil actualType env |
> > (aClass instSize > 0)
> > ifTrue: [^self error: 'cannot make a byte subclass of a
> class with named fields'].
> > (aClass isVariable and: [aClass isWords])
> > ifTrue: [^self error: 'cannot make a byte subclass of a
> class with word fields'].
> > + (aClass isVariable and: [aClass isHalfWords])
> > + ifTrue: [^self error: 'cannot make a byte subclass of a
> class with half word fields'].
> > + (aClass isVariable and: [aClass isDoubleWords])
> > + ifTrue: [^self error: 'cannot make a byte subclass of a
> class with double word fields'].
> > (aClass isVariable and: [aClass isPointers])
> > ifTrue: [^self error: 'cannot make a byte subclass of a
> class with pointer fields'].
> > oldClassOrNil := aClass environment at: t ifAbsent:[nil].
> > actualType := (oldClassOrNil notNil
> > and: [oldClassOrNil typeOfClass ==
> #compiledMethod])
> > ifTrue: [#compiledMethod]
> > ifFalse: [#bytes].
> > env := CurrentEnvironment signal ifNil: [aClass environment].
> > ^self
> > name: t
> > inEnvironment: env
> > subclassOf: aClass
> > type: actualType
> > instanceVariableNames: f
> > classVariableNames: d
> > poolDictionaries: s
> > category: cat!
> >
> > Item was added:
> > + ----- Method: ClassBuilder>>superclass:varia
> bleDoubleWordSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'public') -----
> > + superclass: aClass
> > + variableDoubleWordSubclass: t instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class in which the subclass is to
> > + have indexable double-word-sized nonpointer variables."
> > + | env |
> > + (aClass instSize > 0)
> > + ifTrue: [^self error: 'cannot make a double word
> subclass of a class with named fields'].
> > + (aClass isVariable and: [aClass isBytes])
> > + ifTrue: [^self error: 'cannot make a double word
> subclass of a class with byte fields'].
> > + (aClass isVariable and: [aClass isHalfWords])
> > + ifTrue: [^self error: 'cannot make a double word
> subclass of a class with half word fields'].
> > + (aClass isVariable and: [aClass isWords])
> > + ifTrue: [^self error: 'cannot make a double word
> subclass of a class with word fields'].
> > + (aClass isVariable and: [aClass isPointers])
> > + ifTrue: [^self error: 'cannot make a double word
> subclass of a class with pointer fields'].
> > + env := CurrentEnvironment signal ifNil: [aClass environment].
> > + ^self
> > + name: t
> > + inEnvironment: env
> > + subclassOf: aClass
> > + type: #longs
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat!
> >
> > Item was added:
> > + ----- Method: ClassBuilder>>superclass:varia
> bleHalfWordSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'public') -----
> > + superclass: aClass
> > + variableHalfWordSubclass: t instanceVariableNames: f
> > + classVariableNames: d poolDictionaries: s category: cat
> > + "This is the standard initialization message for creating a new
> class as a
> > + subclass of an existing class in which the subclass is to
> > + have indexable half-word-sized nonpointer variables."
> > + | env |
> > + (aClass instSize > 0)
> > + ifTrue: [^self error: 'cannot make a half word subclass
> of a class with named fields'].
> > + (aClass isVariable and: [aClass isBytes])
> > + ifTrue: [^self error: 'cannot make a half word subclass
> of a class with byte fields'].
> > + (aClass isVariable and: [aClass isWords])
> > + ifTrue: [^self error: 'cannot make a half word subclass
> of a class with word fields'].
> > + (aClass isVariable and: [aClass isDoubleWords])
> > + ifTrue: [^self error: 'cannot make a half word subclass
> of a class with double word fields'].
> > + (aClass isVariable and: [aClass isPointers])
> > + ifTrue: [^self error: 'cannot make a half word subclass
> of a class with pointer fields'].
> > + env := CurrentEnvironment signal ifNil: [aClass environment].
> > + ^self
> > + name: t
> > + inEnvironment: env
> > + subclassOf: aClass
> > + type: #shorts
> > + instanceVariableNames: f
> > + classVariableNames: d
> > + poolDictionaries: s
> > + category: cat!
> >
> > Item was changed:
> > ----- Method: ClassBuilder>>superclass:varia
> bleWordSubclass:instanceVariableNames:classVariableNames:poolDictionaries:category:
> (in category 'public') -----
> > superclass: aClass
> > variableWordSubclass: t instanceVariableNames: f
> > classVariableNames: d poolDictionaries: s category: cat
> > "This is the standard initialization message for creating a new
> class as a
> > subclass of an existing class in which the subclass is to
> > have indexable word-sized nonpointer variables."
> > | env |
> > (aClass instSize > 0)
> > ifTrue: [^self error: 'cannot make a word subclass of a
> class with named fields'].
> > (aClass isVariable and: [aClass isBytes])
> > ifTrue: [^self error: 'cannot make a word subclass of a
> class with byte fields'].
> > + (aClass isVariable and: [aClass isHalfWords])
> > + ifTrue: [^self error: 'cannot make a word subclass of a
> class with half word fields'].
> > + (aClass isVariable and: [aClass isDoubleWords])
> > + ifTrue: [^self error: 'cannot make a word subclass of a
> class with double word fields'].
> > (aClass isVariable and: [aClass isPointers])
> > ifTrue: [^self error: 'cannot make a word subclass of a
> class with pointer fields'].
> > env := CurrentEnvironment signal ifNil: [aClass environment].
> > ^self
> > name: t
> > inEnvironment: env
> > subclassOf: aClass
> > type: #words
> > instanceVariableNames: f
> > classVariableNames: d
> > poolDictionaries: s
> > category: cat!
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20160921/efe2fa11/attachment-0001.htm
More information about the Squeak-dev
mailing list
|