Re: Groovy issue with GraalVM native-image for a large number of consecutive method calls

Jochen Theodorou <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <[email protected]>
On 24.12.23 18:36, Damir Murat wrote:
[...]
> So, back to the problem. In the native image built with GraalVM, when
> executing some
> methods repeatedly for a huge number of times (more than 10000 to be
> exact), Groovy
> can cause the following exception:
>
>    com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported method
> java.lang.invoke.MethodHandleNatives.setCallSiteTargetNormal(CallSite,
> MethodHandle) is reachable
[...]
> org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:113)
>   at jdk.proxy1/jdk.proxy1.$Proxy50.test(Unknown Source)
[...]
> org.klokwrk.tool.gradle.source.repack.repackager.GradleSourceRepackager$_calculateCountOfTargetZipEntries_closure1.doCall(GradleSourceRepackager.groovy:61)

It would be interesting what is in this line 61, but especially why
ConversionHandler gets involved

It should be either some SAM call involvement here or a map that got
converted using "as".

If we can identify the case specifically, maybe we can prevent that case
in static compilation mode.

bye Jochen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.