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

[C1, C2] Split inlining control flags

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Hide
      The currently shared flags will no longer apply to C1 JIT compiler. However, this is expected to be an advantage.
      People who try to tune C1 need to use the new flags. Otherwise, performance impact may be observable. No behavioral change.
      Show
      The currently shared flags will no longer apply to C1 JIT compiler. However, this is expected to be an advantage. People who try to tune C1 need to use the new flags. Otherwise, performance impact may be observable. No behavioral change.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      Support independent configuration of inlining for C1 and C2 JIT compilers.

      Problem

      C1 and C2 JIT compilers are currently using the same global inlining control flags. Tuning is often performed for C2, but with possibly negative impact on C1. We should have separate flags for C1 and C2. In addition to that, C1 creates compiled methods which require much stack due to its inlining strategy. There should be a new flag to limit stack usage.

      Solution

      Introduce new flags for C1 with "C1" prefix. Move C2 flags into c2_globals.hpp. Obsolete these flags when JVM is built without C2.

      Specification

      C1 versions for c1_globals:

      +   product(intx, C1MaxInlineSize, 35,                                        \
      +           "The maximum bytecode size of a method to be inlined by C1")      \
      +                                                                             \
      +   product(intx, C1MaxTrivialSize, 6,                                        \
      +           "The maximum bytecode size of a trivial method to be inlined by " \
      +           "C1")                                                             \
      +                                                                             \
      +   product(intx, C1MaxInlineLevel, 9,                                        \
      +           "The maximum number of nested calls that are inlined by C1")      \
      +                                                                             \
      +   product(intx, C1MaxRecursiveInlineLevel, 1,                               \
      +           "maximum number of nested recursive calls that are inlined by C1")\

      New in c1_globals:

      +   product(intx, C1InlineStackLimit, 10,                                     \
      +           "inlining only allowed for methods which don't exceed this "      \
      +           "number of expression stack and local slots")                     \

      Move to c2_globals (only used by C2, no name change):

      +   product(intx, MaxInlineLevel, 15,                                         \
      +           "maximum number of nested calls that are inlined by high tier "   \
      +           "compiler")                                                       \
      +                                                                             \
      +   product(intx, MaxRecursiveInlineLevel, 1,                                 \
      +           "maximum number of nested recursive calls that are inlined by "   \
      +           "high tier compiler")                                             \
      +                                                                             \
      +   product_pd(intx, InlineSmallCode,                                         \
      +           "Only inline already compiled methods if their code size is "     \
      +           "less than this")                                                 \
      +                                                                             \
      +   product(intx, MaxInlineSize, 35,                                          \
      +           "The maximum bytecode size of a method to be inlined by high "    \
      +           "tier compiler")                                                  \
      +                                                                             \
      +   product_pd(intx, FreqInlineSize,                                          \
      +           "The maximum bytecode size of a frequent method to be inlined")   \
      +                                                                             \
      +   product(intx, MaxTrivialSize, 6,                                          \
      +           "The maximum bytecode size of a trivial method to be inlined by " \
      +           "high tier compiler")                                             \

      They will be obsolete when C2 is excluded from build. Update the special flags table as follows:

      +#ifndef COMPILER2
      +  { "MaxInlineLevel",               JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +  { "MaxRecursiveInlineLevel",      JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +  { "InlineSmallCode",              JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +  { "MaxInlineSize",                JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +  { "FreqInlineSize",               JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +  { "MaxTrivialSize",               JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
      +#endif

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mdoerr Martin Doerr
              Reporter:
              mdoerr Martin Doerr
              Reviewed By:
              Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: