[squeak-dev] The Trunk: Collections-eem.885.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Apr 15 23:37:57 UTC 2020
Eliot Miranda uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.885.mcz
==================== Summary ====================
Name: Collections-eem.885
Author: eem
Time: 15 April 2020, 4:37:54.800631 pm
UUID: 45d219d3-6ed0-4401-a820-44eebe21d71a
Ancestors: Collections-eem.883, Collections-dtl.884
Switch elementsForwardIdentityTo: to not copy the hash, see http://forum.world.st/How-to-become-immediate-objects-td5114931.html.
Add elementsForwardIdentityAndHashTo: for the old behavior.
=============== Diff against Collections-dtl.884 ===============
Item was added:
+ ----- Method: Array>>elementsForwardIdentityAndHashTo: (in category 'converting') -----
+ elementsForwardIdentityAndHashTo: otherArray
+ "This primitive performs a bulk mutation, causing all pointers to the elements of the
+ receiver to be replaced by pointers to the corresponding elements of otherArray.
+ The identityHashes remain with the pointers rather than with the objects so that
+ the objects in this array should still be properly indexed in any existing hashed
+ structures after the mutation."
+ <primitive: 72 error: ec>
+ ec == #'no modification' ifTrue:
+ [^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityAndHashTo:].
+ ec == #'bad receiver' ifTrue:
+ [^self error: 'receiver must be of class Array'].
+ ec == #'bad argument' ifTrue:
+ [^self error: (otherArray class == Array
+ ifTrue: ['arg must be of class Array']
+ ifFalse: ['receiver and argument must have the same size'])].
+ ec == #'inappropriate operation' ifTrue:
+ [^self error: 'can''t become immediates such as SmallIntegers or Characters'].
+ ec == #'object is pinned' ifTrue:
+ [^self error: 'can''t become pinned objects'].
+ ec == #'insufficient object memory' ifTrue:
+ [self error: 'The virtual machine is out-of-date. Please upgrade.'].
+ self primitiveFailed!
Item was changed:
----- Method: Array>>elementsForwardIdentityTo: (in category 'converting') -----
elementsForwardIdentityTo: otherArray
"This primitive performs a bulk mutation, causing all pointers to the elements of the
receiver to be replaced by pointers to the corresponding elements of otherArray.
+ The identityHashes are not copied to the target objects so that the objects in otherArray
+ should still be properly indexed in any existing hashed structures after the mutation."
+ <primitive: 248 error: ec>
- The identityHashes remain with the pointers rather than with the objects so that
- the objects in this array should still be properly indexed in any existing hashed
- structures after the mutation."
- <primitive: 72 error: ec>
ec == #'no modification' ifTrue:
[^self modificationForbiddenFor: otherArray becomeSelector: #elementsForwardIdentityTo:].
ec == #'bad receiver' ifTrue:
[^self error: 'receiver must be of class Array'].
ec == #'bad argument' ifTrue:
[^self error: (otherArray class == Array
ifTrue: ['arg must be of class Array']
ifFalse: ['receiver and argument must have the same size'])].
ec == #'inappropriate operation' ifTrue:
[^self error: 'can''t become immediates such as SmallIntegers or Characters'].
ec == #'object is pinned' ifTrue:
[^self error: 'can''t become pinned objects'].
ec == #'insufficient object memory' ifTrue:
[self error: 'The virtual machine is out-of-date. Please upgrade.'].
self primitiveFailed!
More information about the Squeak-dev
mailing list
|