BTW, about optimization

Maxim Kizub max at
Sun Jan 24 14:58:23 PST 1999


I have some thought about kaffe generated

Needed to implement some new bytecodes I
was forced to make a look at kaffe code
generator... Alas, now I see one more reason, why
kaffe show bad results to compare with
other jit's...

Kaffe generator is totally unoptimized :-(

Someone intrested in it's speed?
I have some hints for you ;-) :

- create call frame for jitted java
methods to use pascal call convention.
It's used by java itself, and, putting
arguments in reverse mode slows down
JVM. I can understand problems with
native method invokation, but...

- make some kind of _simple_ optimizer.

At least, track values in registers,
do not copy values into plases if this
value will not be used any more, and
do not copy slots that has the same value.
I saw a lot code like
movl %eax, %esi ; value in %esi is never used later
movl %esi, %edi ; value in %edi is never used later
movl %edi, %esi
movl %esi, %ebx

Then, try to push method's arguments when they ready,
not put registers into tmp slot, calculate something,
then load value from tmp slot and push it.

I think these simple optimization methods do
not require much of CPU time and may speedup
generated code alot. Also, they are simple
enough to be implemented very fast.

  Maxim Kizub

More information about the kaffe mailing list