Reserving an extra slot on the stack
Andrew Haley
aph at redhat.com
Thu Jan 25 15:13:46 UTC 2018
On 25/01/18 14:59, David Lloyd wrote:
> For an experiment I'm working on, I'd like to modify the JVM to
> reserve one reference-sized slot (which eventually should be visible
> to GC) on every stack frame at a fixed well-known offset (such that I
> can reach it via Unsafe from Java-space). But it appears that the
> stack layout code is pretty deep in per-CPU areas. Is there a generic
> mechanism that I've missed? Like some way to make the compiler act as
> if there were one extra local variable or something like that?
Each compiler does its own stack layout. The only thing that's fixed
is the calling convention. To make this work you'd need to change C1,
C2, and the template interpreter. As it happens, the interpreter has
an unused slot on most architectures, so you can have that for free.
Do you actually need to test your experiment with C1 and C2?
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the hotspot-dev
mailing list