RFR(S): 8183129: [MVT] Type::get_typeflow_type() doesn't distinguish between TypeValueTypePtr & TypeValueType

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Thu Jun 29 11:46:59 UTC 2017

Looks good.

Best regards,
Vladimir Ivanov

On 6/29/17 12:55 PM, Tobias Hartmann wrote:
> Hi,
> please review the following patch:
> https://bugs.openjdk.java.net/browse/JDK-8183129
> http://cr.openjdk.java.net/~thartmann/valhalla/vt_prototype/webrev.26/
> We crash during parsing due to mixing TypeValueType and TypeValueTypePtr. The problem is that typeflow analysis incorrectly sets the type of a PhiNode to TypeValueType instead of TypeValueTypePtr for a __Value argument used in a lambda form. When inlining a method handle intrinsic in CallGenerator::for_method_handle_inline() we should cast all arguments to their actual types but we miss the PhiNode because it's already of TypeValueType. We then fail in Parse::do_vunbox() because the input node is a Phi (and not a ValueTypeNode). We may also fail with a typesystem assert.
> I fixed typeflow analysis and added a regression test that triggers these problems by using MethodHandles.guardWithTest to merge __Value from two branches. I also added an assert to catch these problems earlier. This depends on the SELECT_ALTERNATIVE intrinsic (GWT) being implemented in the value type LambdaFormBuilder [1].
> Thanks to Vladimir Ivanov for reporting this bug and finding the root cause!
> Best regards,
> Tobias
> [1] http://cr.openjdk.java.net/~vlivanov/valhalla/vectors.mvt/webrev.00/jdk/webrev/

More information about the valhalla-dev mailing list