[11] RFR(S): 8202565: C1 compilation crashes with "assert(is_double_stack() && !is_virtual()) failed: type check"
Tobias Hartmann
tobias.hartmann at oracle.com
Fri May 4 07:16:09 UTC 2018
Hi,
please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8202565
http://cr.openjdk.java.net/~thartmann/8202565/webrev.00/
C1 crashes because the LIR contains an instruction moving a T_OBJECT from the stack to a T_LONG
double-register ("move [stack:19|L] [rsirsi|J]"). This code is part of a G1 post barrier for an
object field store (stack:19 is the base oop).
This problem was introduced by the modularization of the C1 GC barriers [1].
ModRefBarrierSetC1::resolve_address() may eagerly resolve the store address into a register,
assuming that the post write barrier needs the address in a register anyway. However, in the failing
case of a field store, the post barrier does not use precise marking and therefore only uses the
base address. The unnecessary leal increases register pressure around the barrier code and causes a
spill of the base address which then needs to be (re-)loaded from the stack.
The patch restores pre-JDK-8201543 behavior by only eagerly resolving the address into a register if
the store is precise. More details (including relevant parts of the LIR) are in the bug comments.
Thanks,
Tobias
[1] https://bugs.openjdk.java.net/browse/JDK-8201543
http://cr.openjdk.java.net/~eosterlund/8201543/webrev.02/
More information about the hotspot-dev
mailing list