JDK-8245865 : Obsolete BranchOnRegister
  • Type: CSR
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 15
  • Submitted: 2020-05-26
  • Updated: 2020-05-27
  • Resolved: 2020-05-27
Related Reports
CSR :  
Description
Summary
-------

Obsolete the -XX:+BranchOnRegister flag.

Problem
-------

After the removal of Solaris and Sparc in JDK-8241787 the BranchOnRegister flag no longer has any effect and should be removed. Since the flag was only used for Sparc and since all the code it once controlled is now gone the flag will go directly to obsolete, skipping the deprecation step.

Solution
--------

The BranchOnRegister flag will be obsoleted, meaning it will still be recognized but a warning will be generated at startup if it is specified on the command line.

Specification
-------------

Mark the flag as obsoleted:

    diff -r 9207cfe2f936 src/hotspot/share/runtime/arguments.cpp
    --- a/src/hotspot/share/runtime/arguments.cpp   Tue May 26 12:36:59 2020 -0700
    +++ b/src/hotspot/share/runtime/arguments.cpp   Tue May 26 13:37:19 2020 -0700
    @@ -560,6 +560,7 @@
     #endif // !X86
       { "UseAdaptiveGCBoundary",         JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },
       { "MonitorBound",                  JDK_Version::jdk(14),     JDK_Version::jdk(15), JDK_Version::jdk(16) },
    +  { "BranchOnRegister",              JDK_Version::undefined(), JDK_Version::jdk(15), JDK_Version::jdk(16) },

     #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
       // These entries will generate build errors.  Their purpose is to test the macros.


And remove it from the global flags:

    diff -r 9207cfe2f936 src/hotspot/share/opto/c2_globals.hpp
    --- a/src/hotspot/share/opto/c2_globals.hpp     Tue May 26 12:36:59 2020 -0700
    +++ b/src/hotspot/share/opto/c2_globals.hpp     Tue May 26 13:37:19 2020 -0700
    @@ -357,10 +357,6 @@
               "Limit of ops to make speculative when using CMOVE")              \
               range(0, max_jint)                                                \
                                                                             \
    -  /* Set BranchOnRegister == false. See 4965987. */                         \
    -  product(bool, BranchOnRegister, false,                                    \
    -          "Use Sparc V9 branch-on-register opcodes")                        \
    -                                                                            \
       product(bool, UseRDPCForConstantTableBase, false,                         \
               "Use Sparc RDPC instruction for the constant table base.")        \
                                                                             \

Comments
Moving to Approved.
27-05-2020

Please move to Finalized.
27-05-2020

Reviewed. Some minor edits s/Solaris/Sparc/. Also the code blocks were the wrong way around :)
27-05-2020

BranchOnRegister was not used since JDK 1.4 where it was set to false: JDK-4965987.
26-05-2020