Frequency of acmp followed equals pattern
rwestrel at redhat.com
Thu Nov 15 11:01:59 UTC 2018
John suggested we should try to determine how often an acmp is followed
by a call to Object.equals() as this could help optimize acmp if it's
implemented as a substituability test.
c2 compiled code code is instrumented so acmp's are classified as:
1- followed by a call to equals()
2- not followed by a call to equals()
3- in an inlined call to equals().
Then 1- and 2- are counted separately and 1 / (1 + 2) is the percentage
of acmp followed by equals(). Null checks are ignored.
This works by:
- delaying inlining of Object.equals()
- After parsing is over, going over the equals() call, looking for
an acmp and tagging one if found as "followed by equals".
- tagging non already tagged acmp as "not followed by equals"
- attempting inlining of Object.equals() using existing JIT heuristics.
I then ran specjvm2008 tests with this. Here is the percentage of acmp
followed by equals according to this.
More information about the valhalla-dev