Callee-saved registers
D.Sturm
D.Sturm42 at gmail.com
Wed Sep 18 13:35:45 PDT 2013
> The ABI that HotSpot uses internally has nothing to do with the
"official" ABI for an architecture or platform. So you have to check what
HotSpot expects you to do - since you certainly do not want to make changes
to the HotSpot runtime.
Ok, I'll have to check what the people working on the HotSpot ARMv8 port
are doing then, I assumed they'd follow the documented ABI but clearly
since we control the whole platform that's not necessary (apart from JNI
calls?).
> No, there is currently no support in the register allocator for things
like that. Basically, you need to find out if a register is used at all,
and only spill it then in the prologue/epilogue. It shouldn't be difficult
to find out if a register was ever used, but it is not implemented yet.
Still not the most efficient solution because we'd have to always consider
the worst case (i.e. if there's one path that uses 30 callee saved
registers we have to spill all of them even if other paths only need 5).
Wouldn't it be possible to tell the allocator that there are values in
callee-saved registers that are alive across the whole method? Apart from a
bit of bookkeeping to know the original position of each variable to
restore it correctly, that seems relatively easy, or am I missing
something?
-Daniel
More information about the graal-dev
mailing list