[Pkg] The Trunk: Kernel-ar.465.mcz
commits at source.squeak.org
commits at source.squeak.org
Sun Jun 20 21:29:49 UTC 2010
Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-ar.465.mcz
==================== Summary ====================
Name: Kernel-ar.465
Author: ar
Time: 20 June 2010, 2:29:04.886 pm
UUID: 9a7edf96-1125-3646-b383-d2cbac094279
Ancestors: Kernel-ar.464
Cogification part 2: Float access primitives.
=============== Diff against Kernel-ar.464 ===============
Item was added:
+ ----- Method: Float>>at: (in category 'accessing') -----
+ at: index
+ "Avoid primitive in Object>>at:"
+
+ ^self basicAt: index!
Item was added:
+ ----- Method: Float>>basicAt:put: (in category 'accessing') -----
+ basicAt: index put: value
+ "Primitive. Assumes receiver is indexable. Store the second argument
+ value in the indexable element of the receiver indicated by index. Fail
+ if the index is not an Integer or is out of bounds. Or fail if the value is
+ not of the right type for this kind of collection. Answer the value that
+ was stored. Essential. Do not override in a subclass. See Object
+ documentation whatIsAPrimitive.
+
+ This version of basicAt: is specifically for floats, answering the most significant
+ word for index 1 and the least significant word for index 2. This alows the VM
+ to store floats in whatever order it chooses while it appears to the image that
+ they are always in big-endian/PowerPC order."
+
+ <primitive: 39 error: ec>
+ ec == nil ifTrue: "primitive not implemented; floats are in big-endian/PowerPC order."
+ [^super basicAt: index put: value].
+ index isInteger
+ ifTrue: [(index >= 1 and: [index <= self size])
+ ifTrue: [self errorImproperStore]
+ ifFalse: [self errorSubscriptBounds: index]].
+ index isNumber
+ ifTrue: [^self basicAt: index asInteger put: value]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: Float>>basicAt: (in category 'accessing') -----
+ basicAt: index
+ "Primitive. Assumes receiver is indexable. Answer the value of an
+ indexable element in the receiver. Fail if the argument index is not an
+ Integer or is out of bounds. Essential. Do not override in a subclass. See
+ Object documentation whatIsAPrimitive.
+
+ This version of basicAt: is specifically for floats, answering the most significant
+ word for index 1 and the least significant word for index 2. This alows the VM
+ to store floats in whatever order it chooses while it appears to the image that
+ they are always in big-endian/PowerPC order."
+
+ <primitive: 38 error: ec>
+ ec == nil ifTrue: "primitive not implemented; floats are in big-endian/PowerPC order."
+ [^super basicAt: index].
+ index isInteger ifTrue: [self errorSubscriptBounds: index].
+ index isNumber
+ ifTrue: [^self basicAt: index asInteger]
+ ifFalse: [self errorNonIntegerIndex]!
Item was added:
+ ----- Method: Float>>at:put: (in category 'accessing') -----
+ at: index put: value
+ "Avoid primitive in Object>>at:put:"
+
+ ^self basicAt: index put: value!
More information about the Packages
mailing list