Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8243205

Modularize JVM flags declaration

    XMLWordPrintable

Details

    • b02

    Description

      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)

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: