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

Igor Veresov iveresov at openjdk.java.net
Thu Oct 1 16:55:04 UTC 2020


On Thu, 1 Oct 2020 16:14:42 GMT, Vladimir Kozlov <kvn 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.
>
> 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.

No we shouldn't. That's intentional. Sometimes we have to go to the lower level (3->1 or 2->1) when the method is not
compilable at level 4.

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

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


More information about the hotspot-compiler-dev mailing list