RFR(M): 8204615: [lworld] C2 support for java.lang.Object methods on value types

Tobias Hartmann tobias.hartmann at oracle.com
Wed Jul 4 15:09:31 UTC 2018


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8204615
http://cr.openjdk.java.net/~thartmann/8204615/webrev.00/

Based on [1], I've implemented C2 support for java.lang.Object methods on value types. Most of the
changes are required to deoptimize in the slow path for monitorenter on a value type. The problem is
that C2 compiled code for monitorenter cannot handle an exception installed by the runtime, so we
need to deoptimize the compiled caller if there's a pending exception (see
SharedRuntime::complete_monitor_locking_C()).

During deoptimization, we need to update the bci in vframeArray.cpp to make sure that we continue
execution in the range of the exception handler (see comments around line 210). I'm not sure if all
the changes to the deoptimization/locking code are correct but I've added lots of tests and could
not find any problems.

The changes in graphKit.cpp:1775 are required to handle the case where we optimize a virtual call to
a java.lang.Object method on a value type receiver. In this case, we might see a ValueTypePtrNode as
receiver argument.

Thanks,
Tobias

[1] http://mail.openjdk.java.net/pipermail/valhalla-dev/2018-May/004275.html



More information about the valhalla-dev mailing list