Stack structure (sparc port) in Kaffe

Veeral Shah veerals at
Wed Dec 22 02:41:58 PST 1999

Hello ,
   I am carrying out certain runtime optimisations on the code generated
by the Kaffe JIT on SPARC port..The version which I am using is 1.0b4..
For certain reasons I need to store some (additional)temporaries onto
the stack ..
But I have failed to understand the relationship between the
frame-pointer(%fp),stack-pointer(%sp) and the basicslot structure ..
( basicslot is the base address of the memory area of size maxTemp +
maxStack + maxLocal)

  The only explanation which is given on the above is 
in jit.h file in a dgm  where %fp is pointing at the bottom of the stack
and sp at stack top..

--  But the SLOT2LOCALOFFSET is calculated as
   -((WINDOWEXTRA + SLOTSIZE * ((maxLocal+maxStack+maxTemp) - (_n)))) ..
#define WINDOWSIZE              (16*SLOTSIZE)
#define INARGSIZE               (6*SLOTSIZE)
#define WINDOWEXTRA             (5*SLOTSIZE)

  The above mathematics I am not able to pick up given the diagram....

-   Why WINDOWEXTRA is required ..?

  I want to know where exactly %fp would be pointing to when %sp is the
top of stack..
(I understand that using save instruction the callee stack would be
incremented by the amount framesize which is calculated in the same
jit.h file)But according to the sparc convention fp will become  the
previous sp ..then how this is reflected in the above calculations .

And secondly does Kaffe use sparc register window facility here..

In my case I want 128 additional slots after maxTemp boundry is crossed
how do I access that using %fp.

Can anyone throw light on the above ...Any feedback would be a great

Thanks a lot in advance
Veeral Shah

More information about the kaffe mailing list