The test came from _the mtrt specjvm98 test where I found this case
when we not inlining monomorphic call.
Note: the test should be compiled with 1.3.1 javac.
Ouput with additional CHA prints (I added):
C:\share>c:/jdk1.5.0_01/bin/java_g -server -XX:+PrintCompilation -XX:+PrintInlining test3
VM option '+PrintCompilation'
VM option '+PrintInlining'
1 B::getXp1 (7 bytes)
CHA: 2 targets, 3 receivers
0: A::getX (0x143d5698)
1: A::getX (0x143d5698)
'virtual call' -> @ 1 A::getX (10000 counts) (10000 rc) (5 bytes)
2 C::check (24 bytes)
@ 9 B::getXp1 inline (hot)
CHA: monomorphic A::getX
@ 1 A::getX inline (hot)
abstract class A {
int X;
public int getX() { return X; }
}
abstract class B extends A {
public int getXp1() { return getX() + 1; }
}
class C extends B {
void B() { X = 3; }
int check(int N) {
int j = 0;
for (int i=0; i<N; i++)
j += super.getXp1();
return j;
}
}
public class test3 extends B {
public static void main(String[] args) {
C c = new C();
int ic1 = c.check(10000); // warmup
int ic2 = c.check(10000); // compile
}
}
###@###.### 2004-12-21 23:13:57 GMT
when we not inlining monomorphic call.
Note: the test should be compiled with 1.3.1 javac.
Ouput with additional CHA prints (I added):
C:\share>c:/jdk1.5.0_01/bin/java_g -server -XX:+PrintCompilation -XX:+PrintInlining test3
VM option '+PrintCompilation'
VM option '+PrintInlining'
1 B::getXp1 (7 bytes)
CHA: 2 targets, 3 receivers
0: A::getX (0x143d5698)
1: A::getX (0x143d5698)
'virtual call' -> @ 1 A::getX (10000 counts) (10000 rc) (5 bytes)
2 C::check (24 bytes)
@ 9 B::getXp1 inline (hot)
CHA: monomorphic A::getX
@ 1 A::getX inline (hot)
abstract class A {
int X;
public int getX() { return X; }
}
abstract class B extends A {
public int getXp1() { return getX() + 1; }
}
class C extends B {
void B() { X = 3; }
int check(int N) {
int j = 0;
for (int i=0; i<N; i++)
j += super.getXp1();
return j;
}
}
public class test3 extends B {
public static void main(String[] args) {
C c = new C();
int ic1 = c.check(10000); // warmup
int ic2 = c.check(10000); // compile
}
}
###@###.### 2004-12-21 23:13:57 GMT