[9, 8u40] RFR (XXS): 8066746: MHs.explicitCastArguments does incorrect type checks for VarargsCollector

Paul Sandoz paul.sandoz at oracle.com
Tue Dec 9 12:12:45 UTC 2014

On Dec 9, 2014, at 12:47 AM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:

> http://cr.openjdk.java.net/~vlivanov/8066746/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8066746

Looks ok.

Curiously, is there a reason why you chose to use MH.invokeWithArguments rather than MH.invoke/invokeExact?


> Recent changes (8057656 [1]) broke MHs.explicitCastArguments for VarargsCollector case. It introduced an equivalence check between MHs.explicitCastArguments and MethodHandle.asType() which doesn't work for VarargsCollector case as expected.
> VarargsCollector has special asType() implementation, which supports collecting any number of trailing positional arguments into an array argument. It doesn't play well with MHs.explicitCastArguments, because the latter is meant to be a pairwise argument and return type conversion.
> The fix is to ensure that adapted method handle has fixed arity.
> Testing: regression test, jck (api/java_lang/invoke), jdk/java/lang/invoke
> Thanks!
> Best regards,
> Vladimir Ivanov
> [1] https://bugs.openjdk.java.net/browse/JDK-8057656
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

More information about the core-libs-dev mailing list