Allocation elimination fails on arrays of non-constant lengths

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 9, 10
    • Component/s: hotspot

      This gets redundant allocations eliminated fine:

          @Benchmark
          public Object arr_const_2() {
              Object o;
              o = new int[10];
              o = new int[10];
              return o;
          }

      ...and here they are not:

          @Benchmark
          public Object arr_var_2() {
              Object o;
              o = new int[size];
              o = new int[size];
              return o;
          }

      This seems to affect e.g. JavaGrande.

      Benchmarks:
       http://cr.openjdk.java.net/~shade/8180290/MultiAlloc.java
       http://cr.openjdk.java.net/~shade/8180290/benchmarks.jar

      Perf data:
       http://cr.openjdk.java.net/~shade/8180290/perf.txt

            Assignee:
            Unassigned
            Reporter:
            Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: