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

More precise closures for WeakProcessor::weak_oops_do calls

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 10
    • 10
    • hotspot
    • None
    • gc
    • b31

    Description

      WeakProcessor::weak_oops_do takes three closures:

      * is_alive - checks if the oop* points to an alive object

      * keep_alive - applied to all oop*s that point to live objects. It's typically used by the GC to update forwarded pointers to the to the new copy of object. The marking GCs pass in a closure that marks objects and pushes references to the marking stacks.

      * complete - the intention is to use this closure to scan objects copied by keep_alive, or mark through objects passed to the marking stacks.

      However, much of this work is unnecessary and actually misleading.

      The marking GCs should never find unmarked objects when the keep_alive closure is applied. So, there's actually no need to apply the keep_alive closure, and therefore also not necessary to apply the complete closure. The proposal is to change these calls to:
      WeakProcessor::weak_oops_do(is_alive, &do_nothing_cl);

      The copying young GCs should never find objects that have not been copied, only pointers that have not been forwarded to already copied objects. Therefore, the complete closure isn't needed for these calls either. As a first step we could change them to:
       WeakProcessor::weak_oops_do(is_alive, keep_alive);
       assert(verify that no objects where copied...)

      The keep_alive closure is still needed to forward the pointers to the copied objects, but later changes could change the keep_alive closure to be more explicit and only do the forwarding.

      Attachments

        Activity

          People

            stefank Stefan Karlsson
            stefank Stefan Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: