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

[lworld] Scalarization of default value type with non-flattenable field fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      The following test fails with "Should be null":

          value final class Test90Value {
              public final __NotFlattened MyValue1 valueField;

              public Test90Value() {
                  valueField = MyValue1.createDefaultDontInline();
              }

              public Test90Value setValueField(MyValue1 valueField) {
                  return __WithField(this.valueField, valueField);
              }
          }

          // Test scalarization of default value type with non-flattenable field
          @Test()
          public Test90Value test90(boolean b) {
              Test90Value vt1 = Test90Value.default;
              if ((Object)vt1.valueField != null) {
                  throw new RuntimeException("Should be null");
              }
              Test90Value vt2 = vt1.setValueField(testValue1);
              return b ? vt1 : vt2;
          }

          @DontCompile
          public void test90_verifier(boolean warmup) {
              test90(true);
              test90(false);
          }

      The problem is in valuetypenode.cpp:510 where we should check for
      vt->field_is_flattenable(i).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thartmann Tobias Hartmann
              Reporter:
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: