RFR: Save both IU and FPU state in WB stub around runtime call

Roman Kennke rkennke at redhat.com
Tue Nov 20 13:19:19 UTC 2018


Turns out we do actually need to save FPU state (just not all of SSE
regs) around runtime calls: interpreter might have xmm0 in use, C1 I am
not sure. There's a nice MacroAssembler::push_CPU_state() that we can
use and which produces nice compact code (using pusha/popa and similar
FPU instructions).

The only gotcha is that rsp must point to 16bytes aligned address.
However, the call requires that anyway. That's why I pulled out the rsp
alignment out of call_VM_leaf() and put it around the whole sequence
push_CPU_state();call();pop_CPU_state(); And because that restores %rax
too, I do get the result by consulting the fwd pointer of the input arg.

The %rsp alignment is different than before: call_VM_leaf() generates a
check+branch and 2 calls, while I do instead push %rbp; mov %rbp, %rsp;
and %rsp, -16; The idea being that I don't want to generate the whole
inner sequence 2x. I'm open to change that though.

Testing: tier3_gc_shenandoah, previously failing test
(specjvm/scimarklu_large with aggressive)

http://cr.openjdk.java.net/~rkennke/fixwbstub/webrev.00/

Ok?

Roman



More information about the shenandoah-dev mailing list