Details
-
Bug
-
Resolution: Fixed
-
P3
-
hs25
-
b08
Description
To optimize this:
m(Object o) {
if (o == null) {
} else {
}
}
C2 uses branch profiling. If the object is never null, profiling tells it that one branch is always taken and it's not compiled. If m() is called from many places branch profiling can be polluted and C2 may not be able to optimize one of the branch out.
Several type profiling points also record whether they see a null object or not so in the example above some method that calls m() may have profile data that indicate whether o is null or not and that can be used to overcome branch profile pollution in m(). To achieve this, we need type speculation to take advantage of the part of the profile data that tells whether a null was seen.
m(Object o) {
if (o == null) {
} else {
}
}
C2 uses branch profiling. If the object is never null, profiling tells it that one branch is always taken and it's not compiled. If m() is called from many places branch profiling can be polluted and C2 may not be able to optimize one of the branch out.
Several type profiling points also record whether they see a null object or not so in the example above some method that calls m() may have profile data that indicate whether o is null or not and that can be used to overcome branch profile pollution in m(). To achieve this, we need type speculation to take advantage of the part of the profile data that tells whether a null was seen.
Attachments
Issue Links
- relates to
-
JDK-8160942 Unused code in GraphKit::record_profiled_receiver_for_speculation
-
- Resolved
-
-
JDK-8031751 When doing multiple identical runs in the same environment, benchmark peak scores vary widely for octane benchmarks on Nashorn
-
- Resolved
-