The purpose of this RFE is to improve modularization of the source code and speed up compilation of HotSpot C++ source code.
Today all global variables generated by the JVM XXX_FLAGS macros are declared at the end of globals.hpp.
http://hg.openjdk.java.net/jdk/jdk/file/4a5a7dc9d05c/src/hotspot/share/runtime/globals.hpp#l2498
As a result, any file that needs just one of such globals will need to include a large number of header files, with a total of over 1000 global declarations.
We should modularize this by doing the variable declaration in each individual header that has a XXX_FLAGS specification. E.g.,
c1_globals.hpp:
#define C1_FLAGS(develop, develop_pd, product, .........) \
develop(intx, C1FlagA, 123, "some flag A for C1) \
product(intx, C1FlagB, 456, "some flag B for C1)
DECLARE_FLAGS(C1_FLAGS)
The DECLARE_FLAGS macro will expand to this (in product build)
extern intx C1FlagA;
const intx C1FlagB = 456;
Most of the HotSpot files that reference C1FlagA/C1FlagB can simply include c1_globals.hpp, without including the other unrelated xxx_globals.hpp file.
DECLARE_FLAGS would be something like:
#define DECLARE_FLAGS(FLAG_SPECIFIER) \
FLAG_SPECIFIER(
DECLARE_DEVELOPER_FLAG, \
DECLARE_PD_DEVELOPER_FLAG, \
DECLARE_PRODUCT_FLAG, \
DECLARE_PD_PRODUCT_FLAG, \
DECLARE_NOTPRODUCT_FLAG, \
IGNORE_RANGE, \
IGNORE_CONSTRAINT)
Today all global variables generated by the JVM XXX_FLAGS macros are declared at the end of globals.hpp.
http://hg.openjdk.java.net/jdk/jdk/file/4a5a7dc9d05c/src/hotspot/share/runtime/globals.hpp#l2498
As a result, any file that needs just one of such globals will need to include a large number of header files, with a total of over 1000 global declarations.
We should modularize this by doing the variable declaration in each individual header that has a XXX_FLAGS specification. E.g.,
c1_globals.hpp:
#define C1_FLAGS(develop, develop_pd, product, .........) \
develop(intx, C1FlagA, 123, "some flag A for C1) \
product(intx, C1FlagB, 456, "some flag B for C1)
DECLARE_FLAGS(C1_FLAGS)
The DECLARE_FLAGS macro will expand to this (in product build)
extern intx C1FlagA;
const intx C1FlagB = 456;
Most of the HotSpot files that reference C1FlagA/C1FlagB can simply include c1_globals.hpp, without including the other unrelated xxx_globals.hpp file.
DECLARE_FLAGS would be something like:
#define DECLARE_FLAGS(FLAG_SPECIFIER) \
FLAG_SPECIFIER(
DECLARE_DEVELOPER_FLAG, \
DECLARE_PD_DEVELOPER_FLAG, \
DECLARE_PRODUCT_FLAG, \
DECLARE_PD_PRODUCT_FLAG, \
DECLARE_NOTPRODUCT_FLAG, \
IGNORE_RANGE, \
IGNORE_CONSTRAINT)
- is blocked by
-
JDK-8243208 Clean up JVMFlag implementation
-
- Resolved
-
- relates to
-
JDK-8258856 VM build without C1/C2 fails after JDK-8243205
-
- Resolved
-
-
JDK-8245226 Clean-up FlagSetting and remove misuse.
-
- Resolved
-
-
JDK-8258074 Move some flags related to compiler to compiler_globals.hpp
-
- Resolved
-
-
JDK-8258459 Decouple gc_globals.hpp from globals.hpp
-
- Resolved
-
-
JDK-8236988 Modular Design for JVM Flags
-
- Closed
-
(1 relates to, 2 links to)