JPEGReadWriter, Differences between Squeak and VisualWorks

Dan Ingalls Dan.Ingalls at disney.com
Sat May 1 23:11:35 UTC 1999


Andres -

>> <<, >> et al. are done with #bitShift: and a positive or negative value,
>> depending on the direction
>
>These selectors, #>> and #<<, should be deleted from Squeak... or left but the
>compiler instructed to use a proper #bitShift: instead...
>
>Profiler measure: [4 bitShift: 2] 1mus 739ns 
>Profiler measure: [4 << 2] 3mus 17ns 

I put these methods into Squeak to assist code generation for the VM and associated primitives.  The C translator has to compile a run-time test for the sign of the shift count in the case of bitShift:, so we use >> and << for speed where this is known (nearly everywhere).  Clearly, this information should be documented in those methods, along with the fact that the primitive bitShift: is faster in Squeak.

	- Dan





More information about the Squeak-dev mailing list