Report from a novice VM h4x0r.

Alan Grimes alangrimes at starpower.net
Fri Apr 2 21:01:10 UTC 2004


Andreas Raab wrote:

> You have? If I'd known it, I would have stood on my head to prevent 
> it. The
>
>trouble with those optimizations is that while they *may* be optimal for a
>specific compiler/platform they *never* scale across platforms (and often
>not even within a single processor family). So what happens is that you
>unfairly optimize the VM for a platform which (in the case of 68k) noone
>even uses any longer! And are you sure that the generated code is still
>optimal on G4/G5?
>
>Really, those kinds of optimizations MUST be put into platform specific
>macros. It gives other people a way of understanding that these are areas
>that may matter for them as well (see Alan's notice about "rep movsb" which
>is fairly fast on some x86 versions although it's not the fastest way across
>x86 - that's still using the FPU ;-) and at least it avoids needless
>discussions about whether it is "better" to write the code this or that way
>because on "my platform using my compiler" it results in better assembly
>code.
>  
>

You'll love this:
 >>>>>>>>>>>
patchInterpGCCPPC: fileName
    "Interpreter patchInterpGCCPPC: 'Squeak copy 1'"
    "This will patch out the unneccesary range check (a compare
     and branch) in the inner interpreter dispatch loop. for the PPC 
version of the GCC compiled
    version of Squeak under MPW"
<<<<<<<<<

I found this while hunting for a problem with my changes where what is 
apparently a free block was set to a totally wild value...
gdb output:
------------------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 25198)]
0x0806f4dd in sweepPhase () at gnu-interp.c:20321
20321                   oop = (oop + oopSize) + 
(headerTypeBytes[(longAt(oop + oopSize)) & 3]);
(gdb) break setSizeOfFreeto
Function "setSizeOfFreeto" not defined.
(gdb)
------------------------------------------------------------



More information about the Squeak-dev mailing list