RFR: Fix Minimal VM build failures

Chris Plummer cjplummer at openjdk.java.net
Mon Sep 27 22:15:13 UTC 2021


On Mon, 27 Sep 2021 21:52:35 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> Minimal VM configs have no C2 and no JVMTI. New Loom code fails the Minimal VM builds because of this. See for example GHA runs: https://github.com/shipilev/loom/runs/3717293969?check_suite_focus=true
>> 
>> C2 needs just a little bit of protection when reaching to `DerivedPointersTable`.
>> 
>> JVMTI needs a bit more work. `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`. Plus, some of the paths that call the actual methods declared but not implemented without JVMTI should be protected with `INCLUDE_JVMTI`.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 server, `tier1_loom` still passes (includes JVMTI tests)
>>  - [x] Linux x86_64 minimal now builds, runs `tier1_loom` (cannot pass JVMTI tests without JVMTI)
>
> src/hotspot/share/runtime/thread.cpp line 1790:
> 
>> 1788: #if INCLUDE_JVMTI
>> 1789:   assert(JvmtiVTMTDisabler::VTMT_count() == 0, "must be 0");
>> 1790: #endif
> 
> All body needs to be under `#if INCLUDE_JVMTI ... #endif` for functions:
>   `set_is_in_VTMT` and `set_is_VTMT_disabler` .
> Is there any specific reason not to do that?
> Also, it makes sense to add this fragment as well:
> 
> #else
>   ShouldNotReachHere();
>   return NULL;
> #endif

I think these APIs should be completely #ifdef'd out, and you also need to wrap the declarations with JVMTI_ONLY macros or append NOT_JVMTI_RETURN to the declarations.

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

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


More information about the loom-dev mailing list