Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.540.mcz
==================== Summary ====================
Name: Kernel-ul.540
Author: ul
Time: 29 January 2011, 1:21:18.82 pm
UUID: a66e5204-4090-2149-8c6a-d65fa1cc4dd3
Ancestors: Kernel-cmm.539
- updated CompiledMethod's comment as suggested by http://bugs.squeak.org/view.php?id=7570
=============== Diff against Kernel-cmm.539 ===============
Item was changed:
ByteArray variableByteSubclass: #CompiledMethod
instanceVariableNames: ''
classVariableNames: 'LargeFrame SmallFrame'
poolDictionaries: ''
category: 'Kernel-Methods'!
+ !CompiledMethod commentStamp: 'ul 1/29/2011 13:18' prior: 0!
- !CompiledMethod commentStamp: 'ls 7/5/2003 13:48' prior: 0!
My instances are methods suitable for interpretation by the virtual machine. This is the only class in the system whose instances intermix both indexable pointer fields and indexable integer fields.
+ I'm a subclass of ByteArray to avoid duplicating some of ByteArray's methods, not because a CompiledMethod is-a ByteArray.
The current format of a CompiledMethod is as follows:
header (4 bytes)
literals (4 bytes each)
bytecodes (variable)
trailer (variable)
The header is a 30-bit integer with the following format:
(index 0) 9 bits: main part of primitive number (#primitive)
(index 9) 8 bits: number of literals (#numLiterals)
(index 17) 1 bit: whether a large frame size is needed (#frameSize)
(index 18) 6 bits: number of temporary variables (#numTemps)
(index 24) 4 bits: number of arguments to the method (#numArgs)
(index 28) 1 bit: high-bit of primitive number (#primitive)
(index 29) 1 bit: flag bit, ignored by the VM (#flag)
The trailer has two variant formats. In the first variant, the last byte is at least 252 and the last four bytes represent a source pointer into one of the sources files (see #sourcePointer). In the second variant, the last byte is less than 252, and the last several bytes are a compressed version of the names of the method's temporary variables. The number of bytes used for this purpose is the value of the last byte in the method.
!
Levente Uzonyi uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.540.mcz
==================== Summary ====================
Name: Kernel-ul.540
Author: ul
Time: 29 January 2011, 1:21:18.82 pm
UUID: a66e5204-4090-2149-8c6a-d65fa1cc4dd3
Ancestors: Kernel-cmm.539
- updated CompiledMethod's comment as suggested by http://bugs.squeak.org/view.php?id=7570
=============== Diff against Kernel-cmm.539 ===============
Item was changed:
ByteArray variableByteSubclass: #CompiledMethod
instanceVariableNames: ''
classVariableNames: 'LargeFrame SmallFrame'
poolDictionaries: ''
category: 'Kernel-Methods'!
+ !CompiledMethod commentStamp: 'ul 1/29/2011 13:18' prior: 0!
- !CompiledMethod commentStamp: 'ls 7/5/2003 13:48' prior: 0!
My instances are methods suitable for interpretation by the virtual machine. This is the only class in the system whose instances intermix both indexable pointer fields and indexable integer fields.
+ I'm a subclass of ByteArray to avoid duplicating some of ByteArray's methods, not because a CompiledMethod is-a ByteArray.
The current format of a CompiledMethod is as follows:
header (4 bytes)
literals (4 bytes each)
bytecodes (variable)
trailer (variable)
The header is a 30-bit integer with the following format:
(index 0) 9 bits: main part of primitive number (#primitive)
(index 9) 8 bits: number of literals (#numLiterals)
(index 17) 1 bit: whether a large frame size is needed (#frameSize)
(index 18) 6 bits: number of temporary variables (#numTemps)
(index 24) 4 bits: number of arguments to the method (#numArgs)
(index 28) 1 bit: high-bit of primitive number (#primitive)
(index 29) 1 bit: flag bit, ignored by the VM (#flag)
The trailer has two variant formats. In the first variant, the last byte is at least 252 and the last four bytes represent a source pointer into one of the sources files (see #sourcePointer). In the second variant, the last byte is less than 252, and the last several bytes are a compressed version of the names of the method's temporary variables. The number of bytes used for this purpose is the value of the last byte in the method.
!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.416.mcz
==================== Summary ====================
Name: System-ul.416
Author: ul
Time: 29 January 2011, 1:45:34.868 am
UUID: 4e4b642f-4878-024d-987b-a067da4382cb
Ancestors: System-cmm.415, System-fbs.410
- merged
=============== Diff against System-cmm.415 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.410.mcz
==================== Summary ====================
Name: System-fbs.410
Author: fbs
Time: 9 January 2011, 7:04:30.976 pm
UUID: 5c92be57-a803-8a41-89f4-c5655001ef11
Ancestors: System-ul.409
Ensure that classOrTraitNamed: doesn't return globals.
=============== Diff against System-ul.409 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.416.mcz
==================== Summary ====================
Name: System-ul.416
Author: ul
Time: 29 January 2011, 1:45:34.868 am
UUID: 4e4b642f-4878-024d-987b-a067da4382cb
Ancestors: System-cmm.415, System-fbs.410
- merged
=============== Diff against System-cmm.415 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.410.mcz
==================== Summary ====================
Name: System-fbs.410
Author: fbs
Time: 9 January 2011, 7:04:30.976 pm
UUID: 5c92be57-a803-8a41-89f4-c5655001ef11
Ancestors: System-ul.409
Ensure that classOrTraitNamed: doesn't return globals.
=============== Diff against System-ul.409 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-ul.416.mcz
==================== Summary ====================
Name: System-ul.416
Author: ul
Time: 29 January 2011, 1:45:34.868 am
UUID: 4e4b642f-4878-024d-987b-a067da4382cb
Ancestors: System-cmm.415, System-fbs.410
- merged
=============== Diff against System-cmm.415 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!
Levente Uzonyi uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.410.mcz
==================== Summary ====================
Name: System-fbs.410
Author: fbs
Time: 9 January 2011, 7:04:30.976 pm
UUID: 5c92be57-a803-8a41-89f4-c5655001ef11
Ancestors: System-ul.409
Ensure that classOrTraitNamed: doesn't return globals.
=============== Diff against System-ul.409 ===============
Item was changed:
----- Method: SystemDictionary>>classOrTraitNamed: (in category 'classes and traits') -----
classOrTraitNamed: aString
"aString is either a class or trait name or a class or trait name followed by ' class' or 'classTrait' respectively.
Answer the class or metaclass it names."
+ | meta baseName |
- | meta baseName baseClass |
(aString endsWith: ' class')
ifTrue: [meta := true.
baseName := aString copyFrom: 1 to: aString size - 6]
ifFalse: [
(aString endsWith: ' classTrait')
ifTrue: [
meta := true.
baseName := aString copyFrom: 1 to: aString size - 11]
ifFalse: [
meta := false.
baseName := aString]].
+
+ ^self at: baseName asSymbol ifPresent:
+ [ :global |
+ global isBehavior ifTrue:
+ [ meta
+ ifFalse: [ global ]
+ ifTrue: [ global classSide ]]]!
- baseClass := Smalltalk at: baseName asSymbol ifAbsent: [^ nil].
- meta
- ifTrue: [^ baseClass classSide]
- ifFalse: [^ baseClass]!