RFR: 8243205: Modularize JVM flags declaration

Ioi Lam iklam at openjdk.java.net
Fri Dec 4 00:12:57 UTC 2020


On Thu, 3 Dec 2020 23:15:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This is the first step for modularizing the xxx_globals.hpp. The goals are
>> 
>> - Improve modularization of HotSpot source
>> - Reduce JVM build time
>> 
>> To prove that this works,  I have moved compiler_globals.hpp outside of the monolithic globals.hpp. Before this fix, compiler_globals.hpp was included by 922 HotSpot .o files. After this fix, it's included by 283 .o files.
>> 
>> I plan to do more refactoring later, such as:
>> 
>> - move gc_globals.hpp out of globals.hpp
>> - move the flags related to tiered compilation (about 40 flags) out of globals.hpp
>> - move the platform-specific flags outside of globals.hpp
>>   - these flags should be used only by platform-specific files. They shouldn't be used by shared files.
>> 
>> Note: this is target for JDK 17.
>
> What is the include architecture of this?  compiler_globals.hpp includes c1_globals.hpp includes c1_globals_pd.hpp ?

(Sorry my previous comment was sent prematurely when I clicked the wrong button in GitHub).

> What is the include architecture of this? compiler_globals.hpp includes c1_globals.hpp includes c1_globals_pd.hpp ?

c1_globals.hpp declares the flags for C1, and c1_globals_pd.hpp defines the (platform-specific) default values of the flags. 

For example, c1_globals.hpp includes c1_globals_x86.hpp, which has
define_pd_global(bool, CSEArrayLength,                 false);
which gets preprocessed to:
const bool pd_CSEArrayLength = false;
in c1_globals.hpp, we have 
  develop_pd(bool, CSEArrayLength,                                          \
          "Create separate nodes for length in array accesses")             \
which, in product build, gets preprocessed to:
const bool CSEArrayLength = pd_CSEArrayLength;
So this is the reason that c1_globals.hpp needs to include c1_globals_pd.hpp.

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

PR: https://git.openjdk.java.net/jdk/pull/1608


More information about the hotspot-dev mailing list