-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
9, 10
step1: Try to compile simple class:
import java.lang.reflect.Method;
public class test {
private static final int ITERATIONS = 100000;
public static void main(String[] args) {
new test().test();
}
private void test() {
for (int i = 0; i < ITERATIONS; i++) {
testMethod();
}
}
private void testMethod() {
Helper helper = new Helper("" + System.currentTimeMillis());
if (helper.string.length() < 1) {
throw new AssertionError("impossible");
}
}
private class Helper {
public String string;
public Helper(String s) {
this.string = s;
}
}
}
step2:
run this class with following vm options:
1) -XX:+TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
2) -XX:-TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
3) -Xcomp -XX:+TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
4) -Xcomp -XX:-TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
A console log for testMethod escape analysis will have different results for first 3 launch and another for launch number 4.
A first string is the most interesting one:
for vmoptions set 1-2-3:
JavaObject NoEscape(NoEscape) [ 1171F 993F [ 37 42 ]] 25 Allocate === 5 6 7 8 1 ( 23 21 22 1 10 1 ) [[ 26 27 28 35 36 37 ]] ... test::testMethod ... bci:0
and for vmoptions set 4:
JavaObject ArgEscape(GlobalEscape) [ 192F [ 37 42 ]] 25 Allocate === 5 6 7 8 1 ( 23 21 22 1 10 1 ) [[ 26 27 28 35 36 37 ]] ... test::testMethod ... bci:0
So, a helper object is considered to be escaped and can be stack allocated for first 3 cases and considered to be ArgEscape(GlobalEscape) for 4th case, which seems to be wrong
import java.lang.reflect.Method;
public class test {
private static final int ITERATIONS = 100000;
public static void main(String[] args) {
new test().test();
}
private void test() {
for (int i = 0; i < ITERATIONS; i++) {
testMethod();
}
}
private void testMethod() {
Helper helper = new Helper("" + System.currentTimeMillis());
if (helper.string.length() < 1) {
throw new AssertionError("impossible");
}
}
private class Helper {
public String string;
public Helper(String s) {
this.string = s;
}
}
}
step2:
run this class with following vm options:
1) -XX:+TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
2) -XX:-TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
3) -Xcomp -XX:+TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
4) -Xcomp -XX:-TieredCompilation -XX:+PrintCompilation -XX:+PrintEscapeAnalysis -XX:+Verbose
A console log for testMethod escape analysis will have different results for first 3 launch and another for launch number 4.
A first string is the most interesting one:
for vmoptions set 1-2-3:
JavaObject NoEscape(NoEscape) [ 1171F 993F [ 37 42 ]] 25 Allocate === 5 6 7 8 1 ( 23 21 22 1 10 1 ) [[ 26 27 28 35 36 37 ]] ... test::testMethod ... bci:0
and for vmoptions set 4:
JavaObject ArgEscape(GlobalEscape) [ 192F [ 37 42 ]] 25 Allocate === 5 6 7 8 1 ( 23 21 22 1 10 1 ) [[ 26 27 28 35 36 37 ]] ... test::testMethod ... bci:0
So, a helper object is considered to be escaped and can be stack allocated for first 3 cases and considered to be ArgEscape(GlobalEscape) for 4th case, which seems to be wrong
- relates to
-
JDK-8139703 [TESTBUG] compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest fails using -Xcomp
-
- Resolved
-
-
JDK-8161508 JVMCI: MaterializeVirtualObjectTest fails w/ "CASE: invalidate=true: has no virtual object before materialization
-
- Resolved
-