You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.MethodHandleImpl.buildVarargsArray(MethodHandle, MethodHandle, int)
#1376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call:
java.lang.invoke.MethodHandleImpl.buildVarargsArray(MethodHandle, MethodHandle, int)
Trace:
at parsing java.lang.invoke.MethodHandleImpl.varargsArray(MethodHandleImpl.java:1634)
Call path from entry point to java.lang.invoke.MethodHandleImpl.varargsArray(Class, int):
at java.lang.invoke.MethodHandleImpl.varargsArray(MethodHandleImpl.java:1611)
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:999)
at java.lang.invoke.MethodHandleImpl$AsVarargsCollector.(MethodHandleImpl.java:460)
at java.lang.invoke.MethodHandleImpl$AsVarargsCollector.(MethodHandleImpl.java:454)
at java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:445)
at java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1325)
at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1670)
at java.lang.invoke.MethodHandles$Lookup.getDirectMethod(MethodHandles.java:1605)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:781)
at java.lang.invoke.BoundMethodHandle$Factory.makeCbmhCtor(BoundMethodHandle.java:818)
at java.lang.invoke.BoundMethodHandle$Factory.makeCtors(BoundMethodHandle.java:763)
at java.lang.invoke.BoundMethodHandle$SpeciesData.(BoundMethodHandle.java:349)
at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:389)
at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:383)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.WeakHashMap$KeySpliterator.forEachRemaining(WeakHashMap.java:1137)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.apache.meecrowave.Meecrowave.close(Meecrowave.java:995)
at org.apache.meecrowave.runner.Cli.run(Cli.java:98)
at org.apache.meecrowave.runner.Cli.main(Cli.java:120)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:153)
I understand the source but it hits almost any java 8 lib. CXF also has this issue even if code is still mainly using java 6 style and just starts using j8 for instance.
About reporting the error at runtime: not sure it is an issue, all the cases I hit - for now indeed - were statically identifiable from sources.
In other words I suspect that if javac looses some meta, graal javac should be able to add it in a methodhandle.json or so or worse case let the user/agent define it maybe.
Also note that using the previous bytecode graal is able to determine what to call since it makes the methodhandle contextual and fully determined - at least in several cases.
So long story short, graal can still do better IMHO ;).
Trying to compile natively Apache Meecrowave (https://openwebbeans.apache.org/meecrowave/) I get this weird error:
Call path from entry point to java.lang.invoke.MethodHandleImpl.varargsArray(Class, int):
at java.lang.invoke.MethodHandleImpl.varargsArray(MethodHandleImpl.java:1611)
at java.lang.invoke.MethodHandle.asCollector(MethodHandle.java:999)
at java.lang.invoke.MethodHandleImpl$AsVarargsCollector.(MethodHandleImpl.java:460)
at java.lang.invoke.MethodHandleImpl$AsVarargsCollector.(MethodHandleImpl.java:454)
at java.lang.invoke.MethodHandleImpl.makeVarargsCollector(MethodHandleImpl.java:445)
at java.lang.invoke.MethodHandle.setVarargs(MethodHandle.java:1325)
at java.lang.invoke.MethodHandles$Lookup.getDirectMethodCommon(MethodHandles.java:1670)
at java.lang.invoke.MethodHandles$Lookup.getDirectMethod(MethodHandles.java:1605)
at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:781)
at java.lang.invoke.BoundMethodHandle$Factory.makeCbmhCtor(BoundMethodHandle.java:818)
at java.lang.invoke.BoundMethodHandle$Factory.makeCtors(BoundMethodHandle.java:763)
at java.lang.invoke.BoundMethodHandle$SpeciesData.(BoundMethodHandle.java:349)
at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:389)
at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:383)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.WeakHashMap$KeySpliterator.forEachRemaining(WeakHashMap.java:1137)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at org.apache.meecrowave.Meecrowave.close(Meecrowave.java:995)
at org.apache.meecrowave.runner.Cli.run(Cli.java:98)
at org.apache.meecrowave.runner.Cli.main(Cli.java:120)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:153)
I'm using this command:
And classpath contains:
The line 995 is:
Indeed it can be rewritten but I think it should be supported since it is quite simple and more and more commong to see that kind of pattern in apps.
The text was updated successfully, but these errors were encountered: