Skip to content
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.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid NullPointerException in --dumpGraphs & test & docs #6304

Merged
merged 3 commits into from
Apr 18, 2023

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Apr 17, 2023

Pull Request Description

Additional bugfix for #5709 with an improved documentation and test for @BuiltinMethod and its processor.

Checklist

  • All code follows the
    Java,
  • All code has been tested:
    • Manually via IGV
    • Unit tests written

@JaroslavTulach
Copy link
Member Author

After integration of #6255 the following command no longer works:

sbt:runtime> withDebug --dumpGraphs benchOnly -- ArrayProxyBenchmarks.sumOverDelegatingProxy

it yields org.graalvm.jniutils.JNIExceptionWrapper: java.lang.NullPointerException and the code doesn't get properly compiled.

 Warmup Iteration   1: java.util.concurrent.ExecutionException: java.lang.NullPointerException
        at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
        at truffle.runtime.CompilationTask.awaitCompletion(CompilationTask.java:108)
        at truffle.runtime.GraalTruffleRuntime.uninterruptibleWaitForCompilation(GraalTruffleRuntime.java:863)
        at truffle.runtime.GraalTruffleRuntime.finishCompilation(GraalTruffleRuntime.java:839)
        at truffle.runtime.OptimizedCallTarget.maybeWaitForTask(OptimizedCallTarget.java:841)
        at truffle.runtime.OptimizedCallTarget.compile(OptimizedCallTarget.java:833)
        at truffle.runtime.OptimizedCallTarget.interpreterCall(OptimizedCallTarget.java:583)
        at truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:562)
        at truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:549)
        at truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:495)
        at truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
        at org.enso.interpreter.node.callable.ExecuteCallNode.callDirect(ExecuteCallNode.java:57)
        at org.enso.interpreter.node.callable.ExecuteCallNodeGen.executeCall(ExecuteCallNodeGen.java:42)
        at org.enso.interpreter.node.callable.dispatch.SimpleCallOptimiserNode.executeDispatch(:49)

This is caused by our adventurous subclassing of DirectCallNode and returning null from its getClonnedTarget() method. This PR fixes the problem by returning non-null call target.

@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 17, 2023
@JaroslavTulach JaroslavTulach requested a review from hubertp April 17, 2023 11:39
@JaroslavTulach JaroslavTulach linked an issue Apr 17, 2023 that may be closed by this pull request
@JaroslavTulach JaroslavTulach force-pushed the wip/jtulach/NPE_DumpGraphs branch from 1206905 to 9246ce1 Compare April 17, 2023 11:46
@JaroslavTulach JaroslavTulach changed the title Avoid NullPointerException in --dumpGraphs Avoid NullPointerException in --dumpGraphs & test & docs Apr 17, 2023
build.sbt Outdated Show resolved Hide resolved
@JaroslavTulach JaroslavTulach merged commit e5a96b9 into develop Apr 18, 2023
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/NPE_DumpGraphs branch April 18, 2023 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug --low-performance CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add forceInline parameter to @Builtin.Method annotation
5 participants