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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 15
    • 15
    • hotspot
    • b11

      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

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

              Created:
              Updated:
              Resolved: