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

-XX:-UseEmptySlotsInSupers sometime fails to reproduce the layout of the old code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b11

      Description

      The VM option -XX:-UseEmptySlotsInSupers aims to produce the same kind of layout as the old field layout code by disabling some optimizations.
      However, in some cases it fails to do so:

      class TypeLI {
          final long f;
          final int f1;
      }

      produces the following layout:

      Layout of class TypeLI
      Instance fields:
       @0 12/- RESERVED
       @12 4/1 EMPTY
       @16 "f" J 8/8 REGULAR
       @24 "f1" I 4/4 REGULAR
      Static fields:
       @0 112/- RESERVED
      Instance size = 32 bytes

      but the expected field layout is:

      Layout of class TypeLI
      Instance fields:
       @0 12/- RESERVED
       @12 "f1" I 4/4 REGULAR
       @16 "f" J 8/8 REGULAR
      Static fields:
       @0 104/- RESERVED
      Instance size = 24 bytes

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fparain Frederic Parain
              Reporter:
              fparain Frederic Parain
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: