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

[lworld] Fix C1 handling of unloaded Q classes

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      JDK-8214689 (http://hg.openjdk.java.net/valhalla/valhalla/rev/b890823b8dc6) introduced unloaded ciValueKlass for cases like:

            anewarray #3 // class "QV;"

      ... where the V class has not yet been loaded. However, ciObjectFactory stores unloaded classes using their unadorned (?) names -- i.e., any leading "L" or "Q" are stripped. This leads to confusion when both "Q" and "L" references are made to the same unloaded class:

          static Object[] test5(int n) {
              if (n == 0) {
                  return null;
              } else if (n == 1) {
                  MyValue5.box[] arr = new MyValue5.box[10];
                  arr[1] = MyValue5.make(22345);
                  return arr;
              } else {
                  MyValue5[] arr = new MyValue5[10];
                  arr[1] = MyValue5.make(12345);
                  return arr;
              }
          }

      The above method would cause C1 to assert.

      A proper fix would be to revert the JDK-8214689 changes in unloaded classes handling. Instead, we should determine the Q-ness using ciBytecodeStream::is_klass_never_null()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iklam Ioi Lam
                Reporter:
                iklam Ioi Lam
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: