RFR: 8253118: Avoid unnecessary deopts when OSR nmethods of the same level are present.

Vladimir Kozlov kvn at openjdk.java.net
Thu Oct 1 16:47:05 UTC 2020


On Fri, 25 Sep 2020 16:05:34 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

> When running with ```-XX:TieredStopAtLevel={2|3}``` the policy tried to switch to OSR method of the same level if those
> are present, which caused constant deopting. The fix is to consider only higher levels for OSR switches.

Changes requested by kvn (Reviewer).

src/hotspot/share/compiler/tieredThresholdPolicy.cpp line 519:

> 517:       nmethod* osr_nm = inlinee->lookup_osr_nmethod_for(bci, expected_comp_level, false);
> 518:       assert(osr_nm == NULL || osr_nm->comp_level() >= expected_comp_level, "lookup_osr_nmethod_for is broken");
> 519:       if (osr_nm != NULL && osr_nm->comp_level() != comp_level) {

Should you check  '> comp_level' here?  expected_comp_level could be CompLevel_simple and as result you can get our_nm
with lower level than current comp_level.

-------------

PR: https://git.openjdk.java.net/jdk/pull/360


More information about the hotspot-compiler-dev mailing list