Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8133873

Simplify {Register,Unregister}NMethodOopClosure

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • None
    • hotspot
    • gc
    • b05
    • generic
    • generic

      The classes {Register,Unregister}NMethodOopClosure implement both oop* and narrowOop* do_oop overloads, using a shared function template. However, these are called from nmethod::oops_do, which only ever calls the do_oop(oop*) overload. As a result, generating code for the narrowOop* overload is just a waste of time and space. The body of the narrowOop* overload could just be ShouldNotReachHere(), and move the function template code directly into the oop* overload.

      In addition, the do_oop implementations for these closures get the associated region for the oop using heap_region_containing. They then assert the region is not a continues_humongous region. But that isn't possible here, since heap_region_containing implicitly resolves continues_humongous to the associated start_humongous region. And besides, an oop that refers to a continues_humongous region has other problems, which would be better handled in heap_region_containing. So the assert in this case is just a big blob of uninteresting and unneeded code.

            ayang Albert Yang
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: