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
@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
- relates to
-
JDK-8327963 C2: fix construction of memory graph around Initialize node to prevent incorrect execution if allocation is removed
-
- Open
-