RFR: Fix Minimal VM build failures [v2]

Chris Plummer cjplummer at openjdk.java.net
Tue Sep 28 07:26:58 UTC 2021


On Tue, 28 Sep 2021 05:40:55 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/prims/jvmtiThreadState.hpp line 99:
>> 
>>> 97:   static void finish_VTMT(jthread vthread, int callsite_tag);
>>> 98:   static int  VTMT_disable_count();
>>> 99:   static int  VTMT_count();
>> 
>> I'm not sure what is being fixed here.
>
> As stated in PR: "jvmtiExport and jvmtiThreadState headers are usually included even with JVMTI turned off, but .cpp would not be compiled without JVMTI. Therefore, non-trivial implementations should go into .cpp." You cannot put the accessor bodies here, because the `_VTMT_count` and `_VTMT_disable_count` symbols would be inaccessible without `.cpp` compiled, and you'll get linker errors.

There are a couple of other choices here. One is like the following example:

  inline static bool should_post_class_file_load_hook()           {
    JVMTI_ONLY(return _should_post_class_file_load_hook);
    NOT_JVMTI(return false;)
  }

However I don't think anyone should actually be calling any VTMT code when JVMTI is disabled. So you could instead put the entire thing (including declaration) in a `#ifdef INCLUDE_JVMTI`. You would then need to also #ifdef around the callers, or use JVMTI_ONLY. If there are many, then go with my first suggestion.

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

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


More information about the loom-dev mailing list