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


please review the following patch:

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

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.


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

More information about the valhalla-dev mailing list