JDK-8244507 : [C1, C2] Split inlining control flags
  • Type: CSR
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2020-05-06
  • Updated: 2020-05-15
  • Resolved: 2020-05-15
Related Reports
CSR :  
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


Comments
Moving to Approved.
15-05-2020

Moving to Provisional. Please have one or more engineers who work on C1/C2 review the CSR before the CSR is finalized for the second round of review.
06-05-2020