Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.228.mcz
==================== Summary ====================
Name: Collections-ul.228
Author: ul
Time: 1 December 2009, 4:28:09 am
UUID: f703f0eb-7da9-a44e-b2c4-ec682d060db8
Ancestors: Collections-ul.217
Part 1 of IdentityDictionary hash change.
Also removed previous postscript.
=============== Diff against Collections-ul.217 ===============
Item was changed:
----- Method: IdentityDictionary>>scanFor: (in category 'private') -----
scanFor: anObject
"Scan the key array for the first slot containing either a nil (indicating an empty slot) or an element that matches anObject. Answer the index of that slot or raise an error if no slot is found. This method will be overridden in various subclasses that have different interpretations for matching elements."
+ | index start |
+ CollectionRehashingUtility quickRehashBecause: #identityDictionaryScanForChanged.
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
[
| element |
((element := array at: index) == nil or: [ element key == anObject ])
ifTrue: [ ^index ].
(index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!
Item was changed:
----- Method: IdentityDictionary>>scanForEmptySlotFor: (in category 'private') -----
scanForEmptySlotFor: anObject
"Scan the key array for the first slot containing an empty slot (indicated by a nil). Answer the index of that slot. This method will be overridden in various subclasses that have different interpretations for matching elements."
+ | index start |
+ index := start := anObject scaledIdentityHash \\ array size + 1.
- | index start hash |
- array size >= 8192
- ifTrue: [ hash := anObject identityHash * (array size // 4096) ]
- ifFalse: [ hash := anObject identityHash ].
- index := start := hash \\ array size + 1.
[
(array at: index) ifNil: [ ^index ].
(index := index \\ array size + 1) = start ] whileFalse.
self errorNoFreeSpace!
Item was changed:
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.314.mcz
==================== Summary ====================
Name: Kernel-ul.314
Author: ul
Time: 1 December 2009, 4:23:11 am
UUID: e293d76b-d182-a44c-b21f-1819da8fa9ec
Ancestors: Kernel-ul.313
Removed preamble.
=============== Diff against Kernel-ul.313 ===============
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.314.mcz
==================== Summary ====================
Name: Kernel-ul.314
Author: ul
Time: 1 December 2009, 4:23:11 am
UUID: e293d76b-d182-a44c-b21f-1819da8fa9ec
Ancestors: Kernel-ul.313
Removed preamble.
=============== Diff against Kernel-ul.313 ===============
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.314.mcz
==================== Summary ====================
Name: Kernel-ul.314
Author: ul
Time: 1 December 2009, 4:23:11 am
UUID: e293d76b-d182-a44c-b21f-1819da8fa9ec
Ancestors: Kernel-ul.313
Removed preamble.
=============== Diff against Kernel-ul.313 ===============
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.313.mcz
==================== Summary ====================
Name: Kernel-ul.313
Author: ul
Time: 1 December 2009, 4:22:35 am
UUID: 46ec2793-b46f-fa4c-9149-63e980f5625f
Ancestors: Kernel-ul.312
Part 2 of updating Object >> #hash.
=============== Diff against Kernel-ul.312 ===============
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
- CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
^self scaledIdentityHash!
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.313.mcz
==================== Summary ====================
Name: Kernel-ul.313
Author: ul
Time: 1 December 2009, 4:22:35 am
UUID: 46ec2793-b46f-fa4c-9149-63e980f5625f
Ancestors: Kernel-ul.312
Part 2 of updating Object >> #hash.
=============== Diff against Kernel-ul.312 ===============
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
- CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
^self scaledIdentityHash!
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.313.mcz
==================== Summary ====================
Name: Kernel-ul.313
Author: ul
Time: 1 December 2009, 4:22:35 am
UUID: 46ec2793-b46f-fa4c-9149-63e980f5625f
Ancestors: Kernel-ul.312
Part 2 of updating Object >> #hash.
=============== Diff against Kernel-ul.312 ===============
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
- CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
^self scaledIdentityHash!
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.312.mcz
==================== Summary ====================
Name: Kernel-ul.312
Author: ul
Time: 1 December 2009, 4:19:45 am
UUID: 5b9007f4-b0f3-1e42-bf32-5a0efbeaae0f
Ancestors: Kernel-nice.307
Added #scaledIdentityHash.
Part 1 of updating Object >> hash.
=============== Diff against Kernel-nice.307 ===============
Item was added:
+ ----- Method: SmallInteger>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self!
Item was added:
+ ----- Method: ProtoObject>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self identityHash * 262144 "bitShift: 18"!
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
+ CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
+ ^self scaledIdentityHash!
- ^ self identityHash!
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.312.mcz
==================== Summary ====================
Name: Kernel-ul.312
Author: ul
Time: 1 December 2009, 4:19:45 am
UUID: 5b9007f4-b0f3-1e42-bf32-5a0efbeaae0f
Ancestors: Kernel-nice.307
Added #scaledIdentityHash.
Part 1 of updating Object >> hash.
=============== Diff against Kernel-nice.307 ===============
Item was added:
+ ----- Method: SmallInteger>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self!
Item was added:
+ ----- Method: ProtoObject>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self identityHash * 262144 "bitShift: 18"!
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
+ CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
+ ^self scaledIdentityHash!
- ^ self identityHash!
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ul.312.mcz
==================== Summary ====================
Name: Kernel-ul.312
Author: ul
Time: 1 December 2009, 4:19:45 am
UUID: 5b9007f4-b0f3-1e42-bf32-5a0efbeaae0f
Ancestors: Kernel-nice.307
Added #scaledIdentityHash.
Part 1 of updating Object >> hash.
=============== Diff against Kernel-nice.307 ===============
Item was added:
+ ----- Method: SmallInteger>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self!
Item was added:
+ ----- Method: ProtoObject>>scaledIdentityHash (in category 'comparing') -----
+ scaledIdentityHash
+ "For identityHash values returned by primitive 75, answer
+ such values times 2^18. Otherwise, match the existing
+ identityHash implementation"
+
+ ^self identityHash * 262144 "bitShift: 18"!
Item was changed:
----- Method: Object>>hash (in category 'comparing') -----
hash
"Answer a SmallInteger whose value is related to the receiver's identity.
May be overridden, and should be overridden in any classes that define = "
+ CollectionRehashingUtility quickRehashBecause: #objectHashChanged.
+ ^self scaledIdentityHash!
- ^ self identityHash!