RFR: 8349915: CTW: Lots of level 3 compiles are done at level 2 after JDK-8348570
Aleksey Shipilev
shade at openjdk.org
Wed Feb 12 14:52:46 UTC 2025
Noticed this in manual CTW runs after [JDK-8348570](https://bugs.openjdk.org/browse/JDK-8348570) that lots and lots of methods are compiled at level 2 instead of requested level 3:
...
[97] javax.enterprise.deploy.shared.ActionType::getValue() WARNING compilation level = 2, but not 3
[97] javax.enterprise.deploy.shared.ActionType::getOffset() WARNING compilation level = 2, but not 3
[97] javax.enterprise.deploy.shared.ActionType::getEnumValueTable() WARNING compilation level = 2, but not 3
[97] javax.enterprise.deploy.shared.ActionType::getStringTable() WARNING compilation level = 2, but not 3
[97] javax.enterprise.deploy.shared.ActionType::getActionType(int) WARNING compilation level = 2, but not 3
[97] javax.enterprise.deploy.shared.ActionType::toString() WARNING compilation level = 2, but not 3
[99] javax.enterprise.deploy.shared.DConfigBeanVersionType
[98] javax.enterprise.deploy.shared.CommandType::toString() WARNING compilation level = 2, but not 3
[98] javax.enterprise.deploy.shared.CommandType::getOffset() WARNING compilation level = 2, but not 3
...
I narrowed it down to level downgrade in compilation policy here:
https://github.com/openjdk/jdk/blob/ed17c55ea34b3b6009dab11d64f21e0b7af3d701/src/hotspot/share/compiler/compilationPolicy.cpp#L677
[JDK-8348570](https://bugs.openjdk.org/browse/JDK-8348570) enters here, because we mark all methods as having profiles to extend the CTW scope. So now `is_method_profiled(max_method_h)` is `true` and downgrade happens. There is already check for `!Arguments::is_compiler_only()` there, so I think we better exclude CTW from this downgrade as well.
I looked at possibly making this kind of downgrade fatal in CTW runner, but the error propagation there is not simple. I filed [JDK-8349917](https://bugs.openjdk.org/browse/JDK-8349917) if anyone want to take a stab on it.
I looked at other `set_comp_level()` uses in Hotspot, and this is the only place where it is called. So I presume we have caught all places where this downgrade can happen.
Additional testing:
- [x] Linux x86_64 server fastdebug, eyeballing some manual CTW run results
- [x] Linux x86_64 server fastdebug, `applications/ctw/modules` passes
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.org/jdk/pull/23589/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23589&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8349915
Stats: 6 lines in 2 files changed: 5 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/23589.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23589/head:pull/23589
PR: https://git.openjdk.org/jdk/pull/23589
More information about the hotspot-compiler-dev
mailing list