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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      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).

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

              Created:
              Updated:
              Resolved: