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

[lworld] TESTBUG Do not force COMP_LEVEL_SIMPLE when EnableValhallaC1 is true

    Details

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

      Description

      When C2 is enabled, the tests based on test/hotspot/jtreg/compiler/valhalla/valuetypes/ValueTypeTest.java are designed to be compiled with C2. E.g., in this version of TestArrays.test48()

      http://hg.openjdk.java.net/valhalla/valhalla/file/001a0187778a/test/hotspot/jtreg/compiler/valhalla/valuetypes/TestArrays.java#l1181

      The method test48 is compiled twice. The first time with aggressive optimization (that requires the src and dst arrays be the same type??), but this version would deoptimize due to the following call, where src and dst are of different types (different flatness??)

              Object[] src = new Object[8];
              MyValue2[] dst = new MyValue2[8];
              ...
              test48(src, dst);

      subsequently, test48 is compiled again, and (due to the fact that it has been deoptimized before) this time it simply calls slow_arraycopy, so it will not be deoptimized again.

              if (!warmup) {
                  Method m = tests.get("TestArrays::test48");
                  assertDeoptimizedByC2(m);
                  enqueueMethodForCompilation(m, COMP_LEVEL_FULL_OPTIMIZATION); <<< compiled again
                  test48(src, dst);
                  verify(dst, src);
                  if (USE_COMPILER && !WHITE_BOX.isMethodCompiled(m, false) && !XCOMP) {
                      throw new RuntimeException("unexpected deoptimization");
                  }
      However, when executed with:

      jtreg -vmoption:-XX:+EnableValhallaC1 TestArrays.java

      The first compilation is done using C1. The second compilation is done with C2 using aggressive optimization, and thus will deoptimize and will cause the RuntimeException to be thrown.

        Attachments

          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: