RFR: 8297431: [JVMCI] HotSpotJVMCIRuntime.encodeThrowable should not throw an exception [v2]

Doug Simon dnsimon at openjdk.org
Wed Nov 23 17:11:23 UTC 2022


On Wed, 23 Nov 2022 16:57:29 GMT, Tom Rodriguez <never at openjdk.org> wrote:

>> I think the case we care about most is an `OutOfMemoryError` occurring in the HotSpot heap so I've pushed a change that calls this out. I've also distinguished the case where the native buffer for the encoding cannot be allocated (although if that happens, the VM is in real trouble).
>
> I was thinking we could get the jthrowable and somehow find the name of the exception from the jclass but I guess JNI doesn't let you do that.  Should we use `_from_env->describe_pending_exception()`?

Good idea but unfortunately the [JNI `ExceptionDescribe` function](https://docs.oracle.com/en/java/javase/19/docs/specs/jni/functions.html#exceptiondescribe) writes to the console which is something we don't want in this context.

-------------

PR: https://git.openjdk.org/jdk/pull/11286


More information about the hotspot-compiler-dev mailing list