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.") \
\
- csr of
-
JDK-8245864 Obsolete BranchOnRegister
-
- Resolved
-