RFR(S): 8209989: [lworld] C2 compilation fails with "unexpected user of value type"

Tobias Hartmann tobias.hartmann at oracle.com
Mon Sep 3 16:09:35 UTC 2018


Hi,

please review the following patch:
http://cr.openjdk.java.net/~thartmann/8209989/webrev.00/

This issue was found by Mandy's VarHandles tests. The problem is in the handling of value type
return values in doCall.cpp. Code that is inlined through a linkTo adapter with an Object signature
may still return a ValueTypeNode. We then try to cast the ValueTypeNode (line 688) which causes
failures in later stages. I've fixed and refactored the code and verified that all tests pass.

While trying to come up with a regression test, I've noticed that TestMethodHandles was broken
because some test methods were declared package-private. After fixing, I was able to reproduce the
original issue but also hit the "what else?" assert in callGenerator.cpp. This code tries to replace
a call after incremental inlining, so we need to replace a value type return value by the
corresponding oop. The problem is that the return value might already be a value type pointer but we
only expect that with 'returned_as_fields'. I've refactored the code such that we decide what do to
based on the type of the actual return value.

I've also refactored the ValueTypePtrNode constructors. The VarHandles tests added by Mandy's patch
for 8207259 all pass now.

Thanks,
Tobias


More information about the valhalla-dev mailing list