RFR: Improve/trim register saving/restoring around WB slowpath call in stub

Roman Kennke rkennke at redhat.com
Tue Nov 20 20:23:58 UTC 2018


This builds on top of:

http://mail.openjdk.java.net/pipermail/shenandoah-dev/2018-November/008331.html

The above opens some opportunities to further improve+trim register
savings around slowpath call:
- r8 and rdi are already saved, no need to save them again
- r12..r15 and rbx and rbp are callee-saved in all calling conventions,
no need to save them
- rax is used for return anyway, no need to save that
- instead of moving the arg to rdi, and from there to c_rarg0 in the
call, we can move it directly to c_rarg0. Notice that rdi and c_rarg0
the same on Linux, but not on windows.
- instead of using pushs+pops, and thus doing both stack access and
register math, do all the accesses in one sequence and then add/sub rsp
in one instruction (that's how bulk saves/restores are done everywhere else)

I don't think it's doing much performance wise because it's the
slow-path anyway, and vector saving/restoring (32*8 words) would drown
it anway, but it's slightly nicer too I think. I'll not push for it, if
not considered useful.

Testing: tier3_gc_shenandoah, specjvm+aggressive

http://cr.openjdk.java.net/~rkennke/improve-wb-stub/webrev.00/

Roman



More information about the shenandoah-dev mailing list