Report from a novice VM h4x0r.

John M McIntosh johnmci at mac.com
Thu Apr 1 00:19:03 UTC 2004


On Mar 31, 2004, at 2:47 PM, Alan Grimes wrote:

>
> There are actually a number of DIFFERENT implementations of block  
> memory copy in the VM source. One example in the Interpreter is called  
> by a function which takes a word count then divides it by 4 to make a  
> word coust for the method call, When it is processed by the method it  
> is multiplied again to make the byte count used to determine the stop  
> pointer for the For loop!

This one I looked at a few years ago. You need to see what the  
assembler your compile is producing, (intel,powerpc,68K) to
understand the implications. I had altered the more important ones to  
be optimal for powerpc and 68K.

In many places the bytes being moved is small, the compiler therefore  
creates code which works very nicely to move 4/8/16/32? bytes. By  
handing off to memcpy it runs slower because memcpy usually checks for  
special cases to decide how to do the copy, use FP registers, vectors  
etc etc. All that overhead takes time... An example here is compaction  
where you shuffle oh say 1 or two words 1 or 2 words & repeat...



--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===




More information about the Squeak-dev mailing list