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

Deprecate -XX:+UseEmptySlotsInSupers

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 23
    • hotspot
    • None
    • behavioral
    • minimal
    • Users should not rely on Java object field layout. This behavior has been in since JDK 15.
    • add/remove/modify command line option
    • JDK

      Summary

      The HotSpot command line option -XX:+UseEmptySlotsInSupers, that implemented the pre JDK 15 object layout format should be deprecated.

      Problem

      This option adds extra cases and code to the HotSpot object layout code which is being modified for JEP 401.

      Solution

      We should deprecate and remove this option, since it affects something that Java users should be not be able to observe.

      Specification

      diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
      index 9ff8b878692..2ea044a97df 100644
      --- a/src/hotspot/share/runtime/arguments.cpp
      +++ b/src/hotspot/share/runtime/arguments.cpp
      @@ -502,6 +502,7 @@ static SpecialFlag const special_jvm_flags[] = {
         { "UseSharedSpaces",              JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::undefined() },
         { "RegisterFinalizersAtInit",     JDK_Version::jdk(22), JDK_Version::jdk(23), JDK_Version::jdk(24) },
         { "PreserveAllAnnotations",       JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
      +  { "UseEmptySlotsInSupers",        JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
       #if defined(X86)
         { "UseRTMLocking",                JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
         { "UseRTMDeopt",                  JDK_Version::jdk(23), JDK_Version::jdk(24), JDK_Version::jdk(25) },
      diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
      index 575d9a3de36..6b9e5858fd5 100644
      --- a/src/hotspot/share/runtime/globals.hpp
      +++ b/src/hotspot/share/runtime/globals.hpp
      @@ -1958,7 +1958,8 @@ const int ObjectAlignmentInBytes = 8;
             "Use platform unstable time where supported for timestamps only") \
                                                                                   \
         product(bool, UseEmptySlotsInSupers, true,                                \
      -                "Allow allocating fields in empty slots of super-classes")  \
      +          "(Deprecated) Allow allocating fields in empty slots of "         \
      +          "super-classes")                                                  \
                                                                                   \
         product(bool, DeoptimizeNMethodBarriersALot, false, DIAGNOSTIC,           \
                       "Make nmethod barriers deoptimise a lot.")                  \

            coleenp Coleen Phillimore
            coleenp Coleen Phillimore
            Dan Heidinga, Daniel Daugherty, Frederic Parain
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: