Skip to content

Commit 1d15ebe

Browse files
committedDec 11, 2020
8243205: Modularize JVM flags declaration
Reviewed-by: kvn, coleenp, stefank
1 parent 8befc32 commit 1d15ebe

27 files changed

+336
-191
lines changed
 

‎src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.inline.hpp"
28+
#include "compiler/compiler_globals.hpp"
2829
#include "gc/shared/barrierSet.hpp"
2930
#include "gc/shared/barrierSetAssembler.hpp"
3031
#include "interp_masm_aarch64.hpp"

‎src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.inline.hpp"
2828
#include "classfile/javaClasses.hpp"
29+
#include "compiler/compiler_globals.hpp"
2930
#include "gc/shared/barrierSetAssembler.hpp"
3031
#include "interpreter/bytecodeHistogram.hpp"
3132
#include "interpreter/interpreter.hpp"

‎src/hotspot/cpu/x86/interp_masm_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26+
#include "compiler/compiler_globals.hpp"
2627
#include "interp_masm_x86.hpp"
2728
#include "interpreter/interpreter.hpp"
2829
#include "interpreter/interpreterRuntime.hpp"

‎src/hotspot/cpu/x86/macroAssembler_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "jvm.h"
2727
#include "asm/assembler.hpp"
2828
#include "asm/assembler.inline.hpp"
29+
#include "compiler/compiler_globals.hpp"
2930
#include "compiler/disassembler.hpp"
3031
#include "gc/shared/barrierSet.hpp"
3132
#include "gc/shared/barrierSetAssembler.hpp"

‎src/hotspot/cpu/x86/macroAssembler_x86_arrayCopy_avx3.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "precompiled.hpp"
2727
#include "asm/macroAssembler.hpp"
2828
#include "asm/macroAssembler.inline.hpp"
29+
#include "compiler/compiler_globals.hpp"
2930

3031
#ifdef PRODUCT
3132
#define BLOCK_COMMENT(str) /* nothing */

‎src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "precompiled.hpp"
2626
#include "asm/macroAssembler.hpp"
2727
#include "classfile/javaClasses.hpp"
28+
#include "compiler/compiler_globals.hpp"
2829
#include "compiler/disassembler.hpp"
2930
#include "gc/shared/barrierSetAssembler.hpp"
3031
#include "interpreter/bytecodeHistogram.hpp"

‎src/hotspot/share/c1/c1_Compilation.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
2828
#include "ci/ciEnv.hpp"
2929
#include "ci/ciMethodData.hpp"
3030
#include "code/exceptionHandlerTable.hpp"
31+
#include "compiler/compiler_globals.hpp"
3132
#include "compiler/compilerDirectives.hpp"
3233
#include "memory/resourceArea.hpp"
3334
#include "runtime/deoptimization.hpp"

‎src/hotspot/share/c1/c1_globals.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@
2525
#ifndef SHARE_C1_C1_GLOBALS_HPP
2626
#define SHARE_C1_C1_GLOBALS_HPP
2727

28+
#include "c1/c1_globals_pd.hpp"
2829
#include "runtime/globals_shared.hpp"
2930
#include "utilities/macros.hpp"
30-
31-
#include CPU_HEADER(c1_globals)
32-
#include OS_HEADER(c1_globals)
33-
3431
//
3532
// Declare all global flags used by the client compiler.
3633
//
@@ -339,4 +336,6 @@
339336

340337
// end of C1_FLAGS
341338

339+
DECLARE_FLAGS(C1_FLAGS)
340+
342341
#endif // SHARE_C1_C1_GLOBALS_HPP
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
#ifndef SHARE_C1_C1_GLOBALS_PD_HPP
26+
#define SHARE_C1_C1_GLOBALS_PD_HPP
27+
28+
#include "runtime/globals_shared.hpp"
29+
#include "utilities/macros.hpp"
30+
31+
#include CPU_HEADER(c1_globals)
32+
#include OS_HEADER(c1_globals)
33+
34+
#endif // SHARE_C1_C1_GLOBALS_PD_HPP

‎src/hotspot/share/code/scopeDesc.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "code/debugInfoRec.hpp"
2828
#include "code/pcDesc.hpp"
2929
#include "code/scopeDesc.hpp"
30+
#include "compiler/compiler_globals.hpp"
3031
#include "memory/resourceArea.hpp"
3132
#include "oops/oop.inline.hpp"
3233
#include "runtime/handles.inline.hpp"

‎src/hotspot/share/compiler/compilerDirectives.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "classfile/vmIntrinsics.hpp"
2929
#include "ci/ciMetadata.hpp"
3030
#include "ci/ciMethod.hpp"
31+
#include "compiler/compiler_globals.hpp"
3132
#include "compiler/methodMatcher.hpp"
3233
#include "compiler/compilerOracle.hpp"
3334
#include "utilities/exceptions.hpp"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -36,44 +36,4 @@
3636
#include "jvmci/jvmci_globals.hpp"
3737
#endif
3838

39-
#if !defined(COMPILER1) && !defined(COMPILER2) && !INCLUDE_JVMCI
40-
define_pd_global(bool, BackgroundCompilation, false);
41-
define_pd_global(bool, CICompileOSR, false);
42-
define_pd_global(bool, UseTypeProfile, false);
43-
define_pd_global(bool, UseOnStackReplacement, false);
44-
define_pd_global(bool, InlineIntrinsics, false);
45-
define_pd_global(bool, PreferInterpreterNativeStubs, true);
46-
define_pd_global(bool, ProfileInterpreter, false);
47-
define_pd_global(bool, ProfileTraps, false);
48-
define_pd_global(bool, TieredCompilation, false);
49-
50-
define_pd_global(intx, CompileThreshold, 0);
51-
52-
define_pd_global(intx, OnStackReplacePercentage, 0);
53-
define_pd_global(size_t, NewSizeThreadIncrease, 4*K);
54-
define_pd_global(bool, InlineClassNatives, true);
55-
define_pd_global(bool, InlineUnsafeOps, true);
56-
define_pd_global(uintx, InitialCodeCacheSize, 160*K);
57-
define_pd_global(uintx, ReservedCodeCacheSize, 32*M);
58-
define_pd_global(uintx, NonProfiledCodeHeapSize, 0);
59-
define_pd_global(uintx, ProfiledCodeHeapSize, 0);
60-
define_pd_global(uintx, NonNMethodCodeHeapSize, 32*M);
61-
62-
define_pd_global(uintx, CodeCacheExpansionSize, 32*K);
63-
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
64-
define_pd_global(uintx, CodeCacheMinimumUseSpace, 200*K);
65-
define_pd_global(size_t, MetaspaceSize, ScaleForWordSize(4*M));
66-
define_pd_global(bool, NeverActAsServerClassMachine, true);
67-
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
68-
#define CI_COMPILER_COUNT 0
69-
#else
70-
71-
#if COMPILER2_OR_JVMCI
72-
#define CI_COMPILER_COUNT 2
73-
#else
74-
#define CI_COMPILER_COUNT 1
75-
#endif // COMPILER2_OR_JVMCI
76-
77-
#endif // no compilers
78-
7939
#endif // SHARE_COMPILER_COMPILER_GLOBALS_HPP
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
#ifndef SHARE_COMPILER_COMPILER_GLOBALS_PD_HPP
26+
#define SHARE_COMPILER_COMPILER_GLOBALS_PD_HPP
27+
28+
// Platform-specific Default values for VM flags used by the compiler.
29+
//
30+
// Note: for historical reasons, some of these flags are declared in globals.hpp.
31+
// E.g., BackgroundCompilation. Such declarations should be moved to this
32+
// file instead.
33+
34+
#include "runtime/globals_shared.hpp"
35+
#ifdef COMPILER1
36+
#include "c1/c1_globals_pd.hpp"
37+
#endif // COMPILER1
38+
#ifdef COMPILER2
39+
#include "opto/c2_globals_pd.hpp"
40+
#endif // COMPILER2
41+
42+
// JVMCI has no platform-specific global definitions
43+
//#if INCLUDE_JVMCI
44+
//#include "jvmci/jvmci_globals_pd.hpp"
45+
//#endif
46+
47+
#if !defined(COMPILER1) && !defined(COMPILER2) && !INCLUDE_JVMCI
48+
define_pd_global(bool, BackgroundCompilation, false);
49+
define_pd_global(bool, CICompileOSR, false);
50+
define_pd_global(bool, UseTypeProfile, false);
51+
define_pd_global(bool, UseOnStackReplacement, false);
52+
define_pd_global(bool, InlineIntrinsics, false);
53+
define_pd_global(bool, PreferInterpreterNativeStubs, true);
54+
define_pd_global(bool, ProfileInterpreter, false);
55+
define_pd_global(bool, ProfileTraps, false);
56+
define_pd_global(bool, TieredCompilation, false);
57+
58+
define_pd_global(intx, CompileThreshold, 0);
59+
60+
define_pd_global(intx, OnStackReplacePercentage, 0);
61+
define_pd_global(size_t, NewSizeThreadIncrease, 4*K);
62+
define_pd_global(bool, InlineClassNatives, true);
63+
define_pd_global(bool, InlineUnsafeOps, true);
64+
define_pd_global(uintx, InitialCodeCacheSize, 160*K);
65+
define_pd_global(uintx, ReservedCodeCacheSize, 32*M);
66+
define_pd_global(uintx, NonProfiledCodeHeapSize, 0);
67+
define_pd_global(uintx, ProfiledCodeHeapSize, 0);
68+
define_pd_global(uintx, NonNMethodCodeHeapSize, 32*M);
69+
70+
define_pd_global(uintx, CodeCacheExpansionSize, 32*K);
71+
define_pd_global(uintx, CodeCacheMinBlockLength, 1);
72+
define_pd_global(uintx, CodeCacheMinimumUseSpace, 200*K);
73+
define_pd_global(size_t, MetaspaceSize, ScaleForWordSize(4*M));
74+
define_pd_global(bool, NeverActAsServerClassMachine, true);
75+
define_pd_global(uint64_t,MaxRAM, 1ULL*G);
76+
#define CI_COMPILER_COUNT 0
77+
#else
78+
79+
#if COMPILER2_OR_JVMCI
80+
#define CI_COMPILER_COUNT 2
81+
#else
82+
#define CI_COMPILER_COUNT 1
83+
#endif // COMPILER2_OR_JVMCI
84+
85+
#endif // no compilers
86+
87+
#endif // SHARE_COMPILER_COMPILER_GLOBALS_PD_HPP

‎src/hotspot/share/gc/shared/gc_globals.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -739,4 +739,6 @@
739739

740740
// end of GC_FLAGS
741741

742+
DECLARE_FLAGS(GC_FLAGS)
743+
742744
#endif // SHARE_GC_SHARED_GC_GLOBALS_HPP

‎src/hotspot/share/jvmci/jvmci.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
#ifndef SHARE_JVMCI_JVMCI_HPP
2525
#define SHARE_JVMCI_JVMCI_HPP
2626

27+
#include "compiler/compiler_globals.hpp"
2728
#include "compiler/compilerDefinitions.hpp"
2829
#include "utilities/events.hpp"
2930
#include "utilities/exceptions.hpp"

‎src/hotspot/share/jvmci/jvmciCompiler.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,6 +25,7 @@
2525
#define SHARE_JVMCI_JVMCICOMPILER_HPP
2626

2727
#include "compiler/abstractCompiler.hpp"
28+
#include "compiler/compiler_globals.hpp"
2829
#include "runtime/atomic.hpp"
2930

3031
class JVMCICompiler : public AbstractCompiler {

‎src/hotspot/share/jvmci/jvmci_globals.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#ifndef SHARE_JVMCI_JVMCI_GLOBALS_HPP
2626
#define SHARE_JVMCI_JVMCI_GLOBALS_HPP
2727

28+
#include "runtime/globals_shared.hpp"
2829
#include "utilities/vmEnums.hpp"
2930

3031
class fileStream;
@@ -139,6 +140,8 @@ class fileStream;
139140

140141
// end of JVMCI_FLAGS
141142

143+
DECLARE_FLAGS(JVMCI_FLAGS)
144+
142145
// The base name for the shared library containing the JVMCI based compiler
143146
#define JVMCI_SHARED_LIBRARY_NAME "jvmcicompiler"
144147

‎src/hotspot/share/opto/c2_globals.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525
#ifndef SHARE_OPTO_C2_GLOBALS_HPP
2626
#define SHARE_OPTO_C2_GLOBALS_HPP
2727

28+
#include "opto/c2_globals_pd.hpp"
2829
#include "runtime/globals_shared.hpp"
2930
#include "utilities/macros.hpp"
3031

31-
#include CPU_HEADER(c2_globals)
32-
#include OS_HEADER(c2_globals)
33-
3432
//
3533
// Defines all globals flags used by the server compiler.
3634
//
@@ -807,4 +805,6 @@
807805

808806
// end of C2_FLAGS
809807

808+
DECLARE_FLAGS(C2_FLAGS)
809+
810810
#endif // SHARE_OPTO_C2_GLOBALS_HPP
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
#ifndef SHARE_OPTO_C2_GLOBALS_PD_HPP
26+
#define SHARE_OPTO_C2_GLOBALS_PD_HPP
27+
28+
#include "runtime/globals_shared.hpp"
29+
#include "utilities/macros.hpp"
30+
31+
#include CPU_HEADER(c2_globals)
32+
#include OS_HEADER(c2_globals)
33+
34+
#endif // SHARE_OPTO_C2_GLOBALS_PD_HPP

‎src/hotspot/share/opto/compile.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "asm/codeBuffer.hpp"
2929
#include "ci/compilerInterface.hpp"
3030
#include "code/debugInfoRec.hpp"
31+
#include "compiler/compiler_globals.hpp"
3132
#include "compiler/compilerOracle.hpp"
3233
#include "compiler/compileBroker.hpp"
3334
#include "compiler/compilerEvent.hpp"

‎src/hotspot/share/runtime/escapeBarrier.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#ifndef SHARE_RUNTIME_ESCAPEBARRIER_HPP
2727
#define SHARE_RUNTIME_ESCAPEBARRIER_HPP
2828

29+
#include "compiler/compiler_globals.hpp"
2930
#include "memory/allocation.hpp"
30-
#include "runtime/globals.hpp"
3131
#include "utilities/macros.hpp"
3232

3333
class JavaThread;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
#ifndef SHARE_RUNTIME_FLAGS_ALLFLAGS_HPP
26+
#define SHARE_RUNTIME_FLAGS_ALLFLAGS_HPP
27+
28+
#include "compiler/compiler_globals.hpp"
29+
#include "runtime/globals.hpp"
30+
31+
// Put the LP64/JVMCI/COMPILER1/COMPILER1/ARCH at
32+
// the top, as they are processed by jvmFlags.cpp in that
33+
// order.
34+
35+
#define ALL_FLAGS( \
36+
develop, \
37+
develop_pd, \
38+
product, \
39+
product_pd, \
40+
notproduct, \
41+
range, \
42+
constraint) \
43+
\
44+
LP64_RUNTIME_FLAGS( \
45+
develop, \
46+
develop_pd, \
47+
product, \
48+
product_pd, \
49+
notproduct, \
50+
range, \
51+
constraint) \
52+
\
53+
JVMCI_ONLY(JVMCI_FLAGS( \
54+
develop, \
55+
develop_pd, \
56+
product, \
57+
product_pd, \
58+
notproduct, \
59+
range, \
60+
constraint)) \
61+
\
62+
COMPILER1_PRESENT(C1_FLAGS( \
63+
develop, \
64+
develop_pd, \
65+
product, \
66+
product_pd, \
67+
notproduct, \
68+
range, \
69+
constraint)) \
70+
\
71+
COMPILER2_PRESENT(C2_FLAGS( \
72+
develop, \
73+
develop_pd, \
74+
product, \
75+
product_pd, \
76+
notproduct, \
77+
range, \
78+
constraint)) \
79+
\
80+
ARCH_FLAGS( \
81+
develop, \
82+
product, \
83+
notproduct, \
84+
range, \
85+
constraint) \
86+
\
87+
RUNTIME_FLAGS( \
88+
develop, \
89+
develop_pd, \
90+
product, \
91+
product_pd, \
92+
notproduct, \
93+
range, \
94+
constraint) \
95+
\
96+
RUNTIME_OS_FLAGS( \
97+
develop, \
98+
develop_pd, \
99+
product, \
100+
product_pd, \
101+
notproduct, \
102+
range, \
103+
constraint) \
104+
\
105+
GC_FLAGS( \
106+
develop, \
107+
develop_pd, \
108+
product, \
109+
product_pd, \
110+
notproduct, \
111+
range, \
112+
constraint)
113+
114+
#define ALL_CONSTRAINTS(f) \
115+
COMPILER_CONSTRAINTS(f) \
116+
RUNTIME_CONSTRAINTS(f) \
117+
GC_CONSTRAINTS(f)
118+
119+
120+
#endif // SHARE_RUNTIME_FLAGS_ALLFLAGS_HPP

‎src/hotspot/share/runtime/globals.cpp

+1-14
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,7 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26-
#include "jfr/jfrEvents.hpp"
27-
#include "jvm.h"
28-
#include "memory/allocation.inline.hpp"
29-
#include "oops/oop.inline.hpp"
30-
#include "runtime/arguments.hpp"
31-
#include "runtime/globals.hpp"
32-
#include "runtime/globals_extension.hpp"
33-
#include "runtime/globals_shared.hpp"
34-
#include "runtime/os.hpp"
35-
#include "runtime/sharedRuntime.hpp"
36-
#include "utilities/defaultStream.hpp"
37-
#include "utilities/macros.hpp"
38-
#include "utilities/ostream.hpp"
39-
#include "utilities/stringUtils.hpp"
26+
#include "runtime/flags/allFlags.hpp"
4027

4128
// Implementation macros
4229
#define MATERIALIZE_PRODUCT_FLAG(type, name, value, ...) type name = value;

‎src/hotspot/share/runtime/globals.hpp

+5-21
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef SHARE_RUNTIME_GLOBALS_HPP
2626
#define SHARE_RUNTIME_GLOBALS_HPP
2727

28-
#include "compiler/compiler_globals.hpp"
28+
#include "compiler/compiler_globals_pd.hpp"
2929
#include "gc/shared/gc_globals.hpp"
3030
#include "runtime/globals_shared.hpp"
3131
#include "utilities/align.hpp"
@@ -2496,25 +2496,9 @@ const intx ObjectAlignmentInBytes = 8;
24962496

24972497
// end of RUNTIME_FLAGS
24982498

2499-
// Interface macros
2500-
#define DECLARE_PRODUCT_FLAG(type, name, value, ...) extern "C" type name;
2501-
#define DECLARE_PD_PRODUCT_FLAG(type, name, ...) extern "C" type name;
2502-
#ifdef PRODUCT
2503-
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) const type name = value;
2504-
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) const type name = pd_##name;
2505-
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) const type name = value;
2506-
#else
2507-
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) extern "C" type name;
2508-
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) extern "C" type name;
2509-
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) extern "C" type name;
2510-
#endif // PRODUCT
2511-
2512-
ALL_FLAGS(DECLARE_DEVELOPER_FLAG,
2513-
DECLARE_PD_DEVELOPER_FLAG,
2514-
DECLARE_PRODUCT_FLAG,
2515-
DECLARE_PD_PRODUCT_FLAG,
2516-
DECLARE_NOTPRODUCT_FLAG,
2517-
IGNORE_RANGE,
2518-
IGNORE_CONSTRAINT)
2499+
DECLARE_FLAGS(LP64_RUNTIME_FLAGS)
2500+
DECLARE_ARCH_FLAGS(ARCH_FLAGS)
2501+
DECLARE_FLAGS(RUNTIME_FLAGS)
2502+
DECLARE_FLAGS(RUNTIME_OS_FLAGS)
25192503

25202504
#endif // SHARE_RUNTIME_GLOBALS_HPP

‎src/hotspot/share/runtime/globals_extension.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
#ifndef SHARE_RUNTIME_GLOBALS_EXTENSION_HPP
2626
#define SHARE_RUNTIME_GLOBALS_EXTENSION_HPP
2727

28+
#include "runtime/flags/allFlags.hpp"
2829
#include "runtime/flags/jvmFlag.hpp"
2930
#include "runtime/flags/jvmFlagAccess.hpp"
30-
#include "runtime/globals.hpp"
3131
#include "utilities/macros.hpp"
3232

3333
// Construct enum of Flag_<cmdline-arg> constants.

‎src/hotspot/share/runtime/globals_shared.hpp

+25-103
Original file line numberDiff line numberDiff line change
@@ -79,110 +79,32 @@
7979

8080
#define IGNORE_FLAG(...)
8181

82-
#define VM_FLAGS( \
83-
develop, \
84-
develop_pd, \
85-
product, \
86-
product_pd, \
87-
notproduct, \
88-
range, \
89-
constraint) \
90-
\
91-
RUNTIME_FLAGS( \
92-
develop, \
93-
develop_pd, \
94-
product, \
95-
product_pd, \
96-
notproduct, \
97-
range, \
98-
constraint) \
99-
\
100-
GC_FLAGS( \
101-
develop, \
102-
develop_pd, \
103-
product, \
104-
product_pd, \
105-
notproduct, \
106-
range, \
107-
constraint) \
108-
109-
// Put the LP64/JVMCI/COMPILER1/COMPILER1/ARCH at
110-
// the top, as they are processed by jvmFlags.cpp in that
111-
// order.
82+
#define DECLARE_PRODUCT_FLAG(type, name, value, ...) extern "C" type name;
83+
#define DECLARE_PD_PRODUCT_FLAG(type, name, ...) extern "C" type name;
84+
#ifdef PRODUCT
85+
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) const type name = value;
86+
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) const type name = pd_##name;
87+
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) const type name = value;
88+
#else
89+
#define DECLARE_DEVELOPER_FLAG(type, name, value, ...) extern "C" type name;
90+
#define DECLARE_PD_DEVELOPER_FLAG(type, name, ...) extern "C" type name;
91+
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, ...) extern "C" type name;
92+
#endif // PRODUCT
11293

113-
#define ALL_FLAGS( \
114-
develop, \
115-
develop_pd, \
116-
product, \
117-
product_pd, \
118-
notproduct, \
119-
range, \
120-
constraint) \
121-
\
122-
LP64_RUNTIME_FLAGS( \
123-
develop, \
124-
develop_pd, \
125-
product, \
126-
product_pd, \
127-
notproduct, \
128-
range, \
129-
constraint) \
130-
\
131-
JVMCI_ONLY(JVMCI_FLAGS( \
132-
develop, \
133-
develop_pd, \
134-
product, \
135-
product_pd, \
136-
notproduct, \
137-
range, \
138-
constraint)) \
139-
\
140-
COMPILER1_PRESENT(C1_FLAGS( \
141-
develop, \
142-
develop_pd, \
143-
product, \
144-
product_pd, \
145-
notproduct, \
146-
range, \
147-
constraint)) \
148-
\
149-
COMPILER2_PRESENT(C2_FLAGS( \
150-
develop, \
151-
develop_pd, \
152-
product, \
153-
product_pd, \
154-
notproduct, \
155-
range, \
156-
constraint)) \
157-
\
158-
ARCH_FLAGS( \
159-
develop, \
160-
product, \
161-
notproduct, \
162-
range, \
163-
constraint) \
164-
\
165-
VM_FLAGS( \
166-
develop, \
167-
develop_pd, \
168-
product, \
169-
product_pd, \
170-
notproduct, \
171-
range, \
172-
constraint) \
173-
\
174-
RUNTIME_OS_FLAGS( \
175-
develop, \
176-
develop_pd, \
177-
product, \
178-
product_pd, \
179-
notproduct, \
180-
range, \
181-
constraint)
94+
#define DECLARE_FLAGS(flag_group) \
95+
flag_group(DECLARE_DEVELOPER_FLAG, \
96+
DECLARE_PD_DEVELOPER_FLAG, \
97+
DECLARE_PRODUCT_FLAG, \
98+
DECLARE_PD_PRODUCT_FLAG, \
99+
DECLARE_NOTPRODUCT_FLAG, \
100+
IGNORE_RANGE, \
101+
IGNORE_CONSTRAINT)
182102

183-
#define ALL_CONSTRAINTS(f) \
184-
COMPILER_CONSTRAINTS(f) \
185-
RUNTIME_CONSTRAINTS(f) \
186-
GC_CONSTRAINTS(f)
103+
#define DECLARE_ARCH_FLAGS(flag_group) \
104+
flag_group(DECLARE_DEVELOPER_FLAG, \
105+
DECLARE_PRODUCT_FLAG, \
106+
DECLARE_NOTPRODUCT_FLAG, \
107+
IGNORE_RANGE, \
108+
IGNORE_CONSTRAINT)
187109

188110
#endif // SHARE_RUNTIME_GLOBALS_SHARED_HPP

‎src/hotspot/share/runtime/init.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "classfile/stringTable.hpp"
2727
#include "classfile/symbolTable.hpp"
2828
#include "code/icBuffer.hpp"
29+
#include "compiler/compiler_globals.hpp"
2930
#include "gc/shared/collectedHeap.hpp"
3031
#if INCLUDE_JVMCI
3132
#include "jvmci/jvmci.hpp"

0 commit comments

Comments
 (0)
Please sign in to comment.