RFR: 8292891: ifdef-out some CDS-only functions [v2]

David Holmes dholmes at openjdk.org
Thu Aug 25 23:29:00 UTC 2022


On Thu, 25 Aug 2022 06:18:36 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Some CDS functions are always compiled, even when CDS is not enabled (e.g., for the minimal VM).
>> 
>> This RFE puts some of the obvious ones inside `#if INCLUDE_CDS` blocks. 
>> 
>> Note: my goal is not to make the minimal VM as small as possible. But rather, I don't want to put `#if INCLUDE_CDS` inside each of those functions that access a CDS-only feature. (E.g., `ConstantPoolCache::save_for_archive`, which accesses `_initial_entries`, which is declared only when CDS is enabled).
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   @calvinccheung comments

This is a bit of a slippery slope. We have things like NOT_CDS_RETURN to avoid the need to use `ifdef INCLUDE_CDS` at the callsites. If you now ifdef the call sites you don't need NOT_CDS_RETURN. Conversely if you are still using NOT_CDS_RETURN then why didn't you ifdef the callsites?

src/hotspot/share/oops/method.hpp line 138:

> 136: 
> 137:   void remove_unshareable_info()        NOT_CDS_RETURN;
> 138:   void restore_unshareable_info(TRAPS)  NOT_CDS_RETURN;

Surely these should ifdef'd out not stubbed out? The callers of these should also be in INCLUDE_CDS blocks.

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

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


More information about the hotspot-dev mailing list