RFR: Fix Minimal VM build failures

Serguei Spitsyn sspitsyn at openjdk.java.net
Mon Sep 27 21:52:06 UTC 2021


On Mon, 27 Sep 2021 20:11:04 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> src/hotspot/share/prims/jvm.cpp line 3919:
>> 
>>> 3917:     JvmtiExport::post_vthread_mount(vthread);
>>> 3918:   }
>>> 3919: #endif
>> 
>> It would be bug if these functions were called when JVMTI isn't compiled in so maybe we should put an #else ShouldNotReachHere() to catch it.
>
> I think that makes sense. At first I was thinking why not just #ifdef out the whole API, but these APIs are mapped natives for `VirtualThread.notifyJvmtiMountBegin()` and `VirtualThread.notifyJvmtiMountEnd()`. Calls to them come from java, but should only happen if jvmti is enabled.

I agree, it is a good idea. Of course, it makes sense to add for all 4 native functions:
 JVM_VirtualThreadMountBegin, JVM_VirtualThreadMountEnd,
 JVM_VirtualThreadUnmountBegin, JVM_VirtualThreadUnmountEnd

Additionally, asserts should be also under #if INCLUDE_JVMTI.

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

PR: https://git.openjdk.java.net/loom/pull/67


More information about the loom-dev mailing list