David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.836.mcz
==================== Summary ====================
Name: Kernel-dtl.836
Author: dtl
Time: 16 February 2014, 2:19:44.092 pm
UUID: 410e695f-7f23-43e4-9dc2-d292b9954f0d
Ancestors: Kernel-cmm.835
Do not allow either basicNew: or basicNew for CompiledMethods because CompiledMethods may only be created with newMethod:header: (otherwise a VM crash may result).
=============== Diff against Kernel-cmm.835 ===============
Item was added:
+ ----- Method: CompiledMethod class>>basicNew (in category 'instance creation') -----
+ basicNew
+
+ self error: 'CompiledMethods may only be created with newMethod:header:' !
David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.836.mcz
==================== Summary ====================
Name: Kernel-dtl.836
Author: dtl
Time: 16 February 2014, 2:19:44.092 pm
UUID: 410e695f-7f23-43e4-9dc2-d292b9954f0d
Ancestors: Kernel-cmm.835
Do not allow either basicNew: or basicNew for CompiledMethods because CompiledMethods may only be created with newMethod:header: (otherwise a VM crash may result).
=============== Diff against Kernel-cmm.835 ===============
Item was added:
+ ----- Method: CompiledMethod class>>basicNew (in category 'instance creation') -----
+ basicNew
+
+ self error: 'CompiledMethods may only be created with newMethod:header:' !
David T. Lewis uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-dtl.836.mcz
==================== Summary ====================
Name: Kernel-dtl.836
Author: dtl
Time: 16 February 2014, 2:19:44.092 pm
UUID: 410e695f-7f23-43e4-9dc2-d292b9954f0d
Ancestors: Kernel-cmm.835
Do not allow either basicNew: or basicNew for CompiledMethods because CompiledMethods may only be created with newMethod:header: (otherwise a VM crash may result).
=============== Diff against Kernel-cmm.835 ===============
Item was added:
+ ----- Method: CompiledMethod class>>basicNew (in category 'instance creation') -----
+ basicNew
+
+ self error: 'CompiledMethods may only be created with newMethod:header:' !
David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.666.mcz
==================== Summary ====================
Name: System-dtl.666
Author: dtl
Time: 15 February 2014, 9:53:14.979 pm
UUID: 098b856a-ecc5-498a-bceb-ef3457d3511e
Ancestors: System-dtl.665
Sending basicNew to CompiledMethod may crash the VM, so don't do that.
=============== Diff against System-dtl.665 ===============
Item was changed:
----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') -----
spaceForInstancesOf: aClass
"Answer the number of bytes consumed by all instances of the given class, including their object headers and the number of instances."
| smallHeaderSize instVarBytes isVariable bytesPerElement total lastInstance instance instanceCount |
instance := aClass someInstance ifNil: [ ^#(0 0) ].
smallHeaderSize := aClass isCompact ifTrue: [ 4 ] ifFalse: [ 8 ].
instVarBytes := aClass instSize * 4.
isVariable := aClass isVariable.
bytesPerElement := isVariable
ifFalse: [ 0 ]
ifTrue: [ aClass isBytes ifTrue: [ 1 ] ifFalse: [ 4 ] ].
total := 0.
instanceCount := 0.
"A modified version of #allInstancesDo: is inlined here. It avoids an infinite loop when another process is creating new instances of aClass."
self flag: #allInstancesDo:.
+ lastInstance :=
+ aClass == CompiledMethod "CompiledMethod has special format, see its class comment"
+ ifTrue: [aClass new]
+ ifFalse: [aClass basicNew].
- lastInstance := aClass basicNew.
[ instance == lastInstance ] whileFalse: [
| contentBytes headerBytes |
contentBytes := instVarBytes + (isVariable
ifFalse: [ 0 ]
ifTrue: [ instance basicSize * bytesPerElement ]).
headerBytes := contentBytes > 255
ifTrue: [ 12 ]
ifFalse: [ smallHeaderSize ].
total := total + headerBytes + (contentBytes roundUpTo: 4).
instanceCount := instanceCount + 1.
instance := instance nextInstance ].
^{ total. instanceCount }!
David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.666.mcz
==================== Summary ====================
Name: System-dtl.666
Author: dtl
Time: 15 February 2014, 9:53:14.979 pm
UUID: 098b856a-ecc5-498a-bceb-ef3457d3511e
Ancestors: System-dtl.665
Sending basicNew to CompiledMethod may crash the VM, so don't do that.
=============== Diff against System-dtl.665 ===============
Item was changed:
----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') -----
spaceForInstancesOf: aClass
"Answer the number of bytes consumed by all instances of the given class, including their object headers and the number of instances."
| smallHeaderSize instVarBytes isVariable bytesPerElement total lastInstance instance instanceCount |
instance := aClass someInstance ifNil: [ ^#(0 0) ].
smallHeaderSize := aClass isCompact ifTrue: [ 4 ] ifFalse: [ 8 ].
instVarBytes := aClass instSize * 4.
isVariable := aClass isVariable.
bytesPerElement := isVariable
ifFalse: [ 0 ]
ifTrue: [ aClass isBytes ifTrue: [ 1 ] ifFalse: [ 4 ] ].
total := 0.
instanceCount := 0.
"A modified version of #allInstancesDo: is inlined here. It avoids an infinite loop when another process is creating new instances of aClass."
self flag: #allInstancesDo:.
+ lastInstance :=
+ aClass == CompiledMethod "CompiledMethod has special format, see its class comment"
+ ifTrue: [aClass new]
+ ifFalse: [aClass basicNew].
- lastInstance := aClass basicNew.
[ instance == lastInstance ] whileFalse: [
| contentBytes headerBytes |
contentBytes := instVarBytes + (isVariable
ifFalse: [ 0 ]
ifTrue: [ instance basicSize * bytesPerElement ]).
headerBytes := contentBytes > 255
ifTrue: [ 12 ]
ifFalse: [ smallHeaderSize ].
total := total + headerBytes + (contentBytes roundUpTo: 4).
instanceCount := instanceCount + 1.
instance := instance nextInstance ].
^{ total. instanceCount }!
David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.666.mcz
==================== Summary ====================
Name: System-dtl.666
Author: dtl
Time: 15 February 2014, 9:53:14.979 pm
UUID: 098b856a-ecc5-498a-bceb-ef3457d3511e
Ancestors: System-dtl.665
Sending basicNew to CompiledMethod may crash the VM, so don't do that.
=============== Diff against System-dtl.665 ===============
Item was changed:
----- Method: SpaceTally>>spaceForInstancesOf: (in category 'instance size') -----
spaceForInstancesOf: aClass
"Answer the number of bytes consumed by all instances of the given class, including their object headers and the number of instances."
| smallHeaderSize instVarBytes isVariable bytesPerElement total lastInstance instance instanceCount |
instance := aClass someInstance ifNil: [ ^#(0 0) ].
smallHeaderSize := aClass isCompact ifTrue: [ 4 ] ifFalse: [ 8 ].
instVarBytes := aClass instSize * 4.
isVariable := aClass isVariable.
bytesPerElement := isVariable
ifFalse: [ 0 ]
ifTrue: [ aClass isBytes ifTrue: [ 1 ] ifFalse: [ 4 ] ].
total := 0.
instanceCount := 0.
"A modified version of #allInstancesDo: is inlined here. It avoids an infinite loop when another process is creating new instances of aClass."
self flag: #allInstancesDo:.
+ lastInstance :=
+ aClass == CompiledMethod "CompiledMethod has special format, see its class comment"
+ ifTrue: [aClass new]
+ ifFalse: [aClass basicNew].
- lastInstance := aClass basicNew.
[ instance == lastInstance ] whileFalse: [
| contentBytes headerBytes |
contentBytes := instVarBytes + (isVariable
ifFalse: [ 0 ]
ifTrue: [ instance basicSize * bytesPerElement ]).
headerBytes := contentBytes > 255
ifTrue: [ 12 ]
ifFalse: [ smallHeaderSize ].
total := total + headerBytes + (contentBytes roundUpTo: 4).
instanceCount := instanceCount + 1.
instance := instance nextInstance ].
^{ total. instanceCount }!