Added missing cast_not_null() in intrinsics + support for Unsafe.copyMemory() in AddPNode::Ideal()

Roland Westrelin rwestrel at redhat.com
Fri Jul 8 08:42:23 UTC 2016


http://cr.openjdk.java.net/~roland/shenandoah-intrinsic-cast-nonnull/webrev.00/

A number of intrinsics know their inputs are non null but the compiler
is not aware of it. I added some cast_not_null() to these. The benefits
 are that:
1) the check for null in the barriers is not needed.
2) the compiler doesn't expect memory accesses with a NULL+offset but
the compiler can see one if the memory access is pushed in the null
branch of the barrier. This change removes the null branches.
3) AddPNode::Ideal() has logic to handle 2) in the case of unsafe
accesses but is confused if it sees anything it doesn't expect

AddPNode::Ideal() is extended to support the Unsafe.copyMemory()
intrinsic that can take null+offset inputs.

vectorizedMismatch() is another intrinsic that can be passed null+offset
inputs but LibraryCallKit::inline_vectorizedMismatch() checks that
inputs are arrays and for arrays  LibraryCallKit::make_unsafe_address()
generates a null check so that intrinsic shouldn't cause a problem.
Actually, in the library code I found no use of vectorizedMismatch()
with null inputs.

Roland.


More information about the shenandoah-dev mailing list