RFR: 8327138: Clean up status management in cdsConfig.hpp and CDS.java [v3]

David Holmes dholmes at openjdk.org
Thu Mar 7 06:57:56 UTC 2024


On Wed, 6 Mar 2024 23:36:09 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> A few clean ups:
>> 
>> 1. Rename functions like "`s_loading_full_module_graph()` to `is_using_full_module_graph()`. The meaning of "loading" is not clear: it might be interpreted as to cover only the period where the artifact is being loaded, but not the period after the artifact is completely loaded. However, the function is meant to cover both periods, so "using" is a more precise term.
>> 
>> 2. The cumbersome sounding `disable_loading_full_module_graph()` is changed to `stop_using_full_module_graph()`, etc.
>> 
>> 3. The status of `is_using_optimized_module_handling()` is moved from metaspaceShared.hpp to cdsConfig.hpp, to be consolidated with other types of CDS status.
>> 
>> 4. The status of CDS was communicated to the Java class `jdk.internal.misc.CDS` by ad-hoc native methods. This is now changed to a single method, `CDS.getCDSConfigStatus()` that returns a bit field. That way we don't need to add a new native method for each type of status.
>> 
>> 5. `CDS.isDumpingClassList()` was a misnomer. It's changed to `CDS.isLoggingLambdaFormInvokers()`.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   more alignment

Some drive-by nits. (But copyright needs fixing.)

src/hotspot/share/cds/cdsConfig.cpp line 2:

> 1: /*
> 2:  * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.

Incorrect copyright update - should be "2023, 2024,"

src/hotspot/share/cds/cdsConfig.cpp line 54:

> 52:          (is_dumping_static_archive()        ? IS_DUMPING_STATIC_ARCHIVE : 0) |
> 53:          (is_logging_lambda_form_invokers()  ? IS_LOGGING_LAMBDA_FORM_INVOKERS : 0) |
> 54:          (is_using_archive()                 ? IS_USING_ARCHIVE : 0);

You can remove one space before the ? in each line

src/hotspot/share/cds/cdsConfig.hpp line 56:

> 54:   static const int IS_DUMPING_STATIC_ARCHIVE              = 1 << 1;
> 55:   static const int IS_LOGGING_LAMBDA_FORM_INVOKERS        = 1 << 2;
> 56:   static const int IS_USING_ARCHIVE                       = 1 << 3;

why is the = sign so far away?

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

PR Review: https://git.openjdk.org/jdk/pull/18095#pullrequestreview-1921571088
PR Review Comment: https://git.openjdk.org/jdk/pull/18095#discussion_r1515626568
PR Review Comment: https://git.openjdk.org/jdk/pull/18095#discussion_r1515628561
PR Review Comment: https://git.openjdk.org/jdk/pull/18095#discussion_r1515629728


More information about the core-libs-dev mailing list