[squeak-dev] The Trunk: Kernel-eem.1005.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 8 21:17:33 UTC 2016
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1005.mcz
==================== Summary ====================
Name: Kernel-eem.1005
Author: eem
Time: 8 March 2016, 1:16:26.313983 pm
UUID: e11ad532-fefb-4f2e-836a-dc40b7d93447
Ancestors: Kernel-bf.1004
Add a script to make sure that
a) SmallFloat64 has identityHash 3 and occupies the 4th (3rd, zero-relative) slot of the first class table page, and
b) that the first class table page is hidden by ensuring its class index is 16, the Array class index pun.
=============== Diff against Kernel-bf.1004 ===============
Item was removed:
- (PackageInfo named: 'Kernel') preamble: '((Mutex allInstances allSatisfy: [:m| (m instVarNamed: ''owner'') isNil])
- and: [Monitor allInstances allSatisfy: [:m| (m instVarNamed: ''ownerProcess'') isNil]]) ifFalse:
- [self error: ''Some Mutexes and/or Monitors are owned. Cannot safely mutate. ABort load and resolve this before loading for safety.'']'!
Item was changed:
+ (PackageInfo named: 'Kernel') postscript: '"below, add code to be run after the loading of this package"
+
+ "Make sure that
+ a) SmallFloat64 has identityHash 3 and occupies the 4th (3rd, zero-relative) slot of the first class table page, and
+ b) that the first class table page is hidden by ensuring its class index is 16, the Array class index pun."
+ (Array someInstance size = 1024
+ and: [(Array someInstance allSatisfy: [:e| e == nil or: [e isBehavior]])
+ and: [(Array someInstance first: 17) asSet = {nil. SmallInteger. Character. Array} asSet]]) ifTrue:
+ [| firstClassTablePage clone |
+ firstClassTablePage := Array someInstance.
+ self assert: (firstClassTablePage allSatisfy: [:e| e == nil or: [e isBehavior]]).
+ self assert: (firstClassTablePage first: 17) asSet = {nil. SmallInteger. Character. Array} asSet.
+ firstClassTablePage at: 4 put: SmallFloat64.
+ SmallFloat64 tryPrimitive: 161 withArgs: #(3).
+ clone := Array shallowCopy.
+ Array adoptInstance: clone.
+ clone tryPrimitive: 161 withArgs: #(16).
+ clone tryPrimitive: 160 withArgs: {firstClassTablePage}.
+ self assert: SmallFloat64 identityHash = 3.
+ self assert: (firstClassTablePage first: 4) = {nil. SmallInteger. Character. SmallFloat64}]'!
- (PackageInfo named: 'Kernel') postscript: 'Smalltalk removeFromStartUpList: DateAndTime.'!
More information about the Squeak-dev
mailing list
|