With this backport, interface call could be inlined if there is only one implementation of the invoked method after class hierarchy analysis, as shown in the following case.
interface I1 {
public int m();
}
abstract class C1 implements I1 {}
class C2 extends C1 {
public int m() {
return 0;
}
}
class Test {
public static void main(String[] args) {
run(new C2());
}
public static void run(C1 c1) {
c1.m(); // will inline C2.m because only class C2 implements method m after Class Hierarchy Analysis
}
}
There isn't any change for SPECjbb on x86 and aarch64 platform.
Corresponding upstream commit
6986483CHA: optimize calls through interfaces
8223171Redundant nmethod dependencies for effectively final methods
8261954Dependencies: Improve iteration over class hierarchy under context class
8264548Dependencies: ClassHierarchyWalker::is_witness() cleanups
8266074 Vtable-based CHA implementation
8065760 CHA: Improve abstract method support
8036580 CHA: improve default method support
Others
Because the absence of JDK-8264873 Dependencies: Split ClassHierarchyWalker in JDK11, the implementation of class LinkedConcreteMethodFinder in backported JDK-8266074 is little different with upstream, but keeps functionality consistent.
Total number of new lines of this backport is about 2400, including 1500 lines for test cases and 900 lines for feature code.
Introduction
With this backport, interface call could be inlined if there is only one implementation of the invoked method after class hierarchy analysis, as shown in the following case.
Test results
benchmark: renaissance platform: x86 config:4C8G
benchmark: renaissance platform: aarch64 config:4C8G
There isn't any change for SPECjbb on x86 and aarch64 platform.
Corresponding upstream commit
6986483CHA: optimize calls through interfaces 8223171Redundant nmethod dependencies for effectively final methods 8261954Dependencies: Improve iteration over class hierarchy under context class 8264548Dependencies: ClassHierarchyWalker::is_witness() cleanups 8266074 Vtable-based CHA implementation 8065760 CHA: Improve abstract method support 8036580 CHA: improve default method support
Others
JDK-8264873 Dependencies: Split ClassHierarchyWalker
in JDK11, the implementation of classLinkedConcreteMethodFinder
in backported JDK-8266074 is little different with upstream, but keeps functionality consistent.