[kaffe] register spills

Gerlando Falauto iurly at writeme.com
Wed Sep 10 16:42:02 PDT 2003

Hi folks,

I got some questions about how jit3 allocates registers.
On a register-rich machine like the one I'm working on, one would
expect simple code like (also known as Fibonacci):

	int a1=1, a2=0, an=0;
	for (int i = 1; i < 50; i++) {
		an = a1 + a2;
		a2 = a1;
		a1 = an;

to be translated into a loop working on registers only, without the
overhead of recurrent spills and reloads.
Well that's not the case for me, as I still have variables reloaded
and spilled at the beginning and end of the basic block.

Is that too much to ask? Does that have anything to do with
registers being marked as global or not? Is there anything I could have
done wrong?

Unfortunately I haven't figured out how register allocation works in
kaffe... any suggestions?

Thanks in advance,

More information about the kaffe mailing list