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

Allocation elimination fails on arrays of non-constant lengths

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9, 10
    • 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

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

              Created:
              Updated: