JDK-8061817 : Whitebox.deoptimizeMethod() does not deoptimize all OSR versions of method
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-10-22
  • Updated: 2017-08-14
  • Resolved: 2014-10-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b40Fixed
Related Reports
Relates :  
Description
Invoking Whitebox.deoptimizeMethod() on a method that has multiple OSR compiled versions only deoptimizes one OSR method.

The problem is in 'WB_DeoptimizeMethod' in whitebox.cpp:
   
    int bci = InvocationEntryBci;
    while ((code = mh->lookup_osr_nmethod_for(bci, CompLevel_none, false)) != NULL) {
      code->mark_for_deoptimization();
      ++result;
      bci = code->osr_entry_bci() + 1;
    }

After incrementing the bci 'lookup_osr_nmethod_for()' returns NULL and we exit the loop.
Comments
Attached test to trigger bug (DeoptimizeMultipleOSRTest.java).
22-10-2014