-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 18
-
b07
```
class TestInline {
static int sum;
public static int caller(int a , int b) {
return a + b;
}
public static void main(String[] args) {
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++) {
sum += caller(i, 0);
}
}
}
}
```
Run the above program with
```
-XX:+PrintCompilation \
-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining \
-XX:CompileCommand=quiet \
-XX:CompileCommand=inline,TestInline::caller \
-XX:CompileCommand=dontinline,TestInline::caller \
-XX:CompileCommand=compileonly,TestInline::main \
```
Then we get
```
28 1 % 3 TestInline::main @ 11 (43 bytes)
@ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
29 2 3 TestInline::main (43 bytes)
@ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
31 3 % 4 TestInline::main @ 11 (43 bytes)
33 1 % 3 TestInline::main @ 11 (43 bytes) made not entrant
@ 23 TestInline::caller (4 bytes) force inline by CompileCommand
```
It shows that inlining of TestInline::caller is disallowed by C1 but force-inlined by C2, which are conflict inlining decisions of C1/C2.
class TestInline {
static int sum;
public static int caller(int a , int b) {
return a + b;
}
public static void main(String[] args) {
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++) {
sum += caller(i, 0);
}
}
}
}
```
Run the above program with
```
-XX:+PrintCompilation \
-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining \
-XX:CompileCommand=quiet \
-XX:CompileCommand=inline,TestInline::caller \
-XX:CompileCommand=dontinline,TestInline::caller \
-XX:CompileCommand=compileonly,TestInline::main \
```
Then we get
```
28 1 % 3 TestInline::main @ 11 (43 bytes)
@ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
29 2 3 TestInline::main (43 bytes)
@ 23 TestInline::caller (4 bytes) disallowed by CompileCommand
31 3 % 4 TestInline::main @ 11 (43 bytes)
33 1 % 3 TestInline::main @ 11 (43 bytes) made not entrant
@ 23 TestInline::caller (4 bytes) force inline by CompileCommand
```
It shows that inlining of TestInline::caller is disallowed by C1 but force-inlined by C2, which are conflict inlining decisions of C1/C2.
- relates to
-
JDK-8316411 compiler/compilercontrol/TestConflictInlineCommands.java fails intermittent with force inline by CompileCommand missing
-
- Resolved
-