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

Obsolete InsertMemBarAfterArraycopy flag

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      The flag is untested. Disabling it causes crashes in the C2 compiler and incorrect code generation. It's unlikely that the flag is used in production.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      Implementation

      Description

      Summary

      Obsolete the broken -XX:-InsertMemBarAfterArraycopy C2 flag.

      Problem

      The flag is enabled by default. Disabling the flag causes crashes during C2 compilation or generation of invalid code.

      Solution

      The InsertMemBarAfterArraycopy 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 obsolete:

      diff -r bdc20ee1a68d src/hotspot/share/runtime/arguments.cpp
      --- a/src/hotspot/share/runtime/arguments.cpp   Fri Sep 04 23:51:26 2020 -0400
      +++ b/src/hotspot/share/runtime/arguments.cpp   Tue Sep 08 08:15:08 2020 +0200
      @@ -553,6 +553,7 @@
         { "UseNewFieldLayout",             JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) },
         { "UseSemaphoreGCThreadsSynchronization", JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
         { "ForceNUMA",                     JDK_Version::jdk(15), JDK_Version::jdk(16), JDK_Version::jdk(17) },
      +  { "InsertMemBarAfterArraycopy",    JDK_Version::undefined(), JDK_Version::jdk(16), JDK_Version::jdk(17) },
      
       #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS
         // These entries will generate build errors.  Their purpose is to test the macros.

      Remove it from C2 code:

      diff -r bdc20ee1a68d src/hotspot/share/opto/c2_globals.hpp
      --- a/src/hotspot/share/opto/c2_globals.hpp     Fri Sep 04 23:51:26 2020 -0400
      +++ b/src/hotspot/share/opto/c2_globals.hpp     Tue Sep 08 08:15:08 2020 +0200
      @@ -384,9 +384,6 @@
         product(bool, UseOnlyInlinedBimorphic, true,                              \
                 "Don't use BimorphicInlining if can't inline a second method")    \
                                                                                   \
      -  product(bool, InsertMemBarAfterArraycopy, true,                           \
      -          "Insert memory barrier after arraycopy call")                     \
      -                                                                            \
         develop(bool, SubsumeLoads, true,                                         \
                 "Attempt to compile while subsuming loads into machine "          \
                 "instructions.")                                                  \

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thartmann Tobias Hartmann
                Reporter:
                thartmann Tobias Hartmann
                Reviewed By:
                Nils Eliasson
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: