Remove MetaspaceClosure::Ref::keep_after_pushing()

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: None
    • Component/s: hotspot
    • b24

      We currently keep a reference to the MetaspaceClosure::Ref inside ArchiveBuilder::SourceObjInfo:

      https://github.com/openjdk/jdk/blob/6f75dd8741f44b3012c5cab5268e89d09121e4be/src/hotspot/share/cds/archiveBuilder.hpp#L125-L126

      ArchiveBuilder uses the Ref::keep_after_pushing() API to tell MetaspaceClosure to keep the Ref alive, even though MetaspaceClosure has finished using it.

      This makes the lifecycle convoluted.

      The only reason to keep the Ref inside SourceObjInfo is to query Ref::msotype() and Ref::obj(), but we're already cached these values in SourceObjInfo::msotype() and SourceObjInfo::source_addr(). So there's no need to keep the Ref around.

            Assignee:
            Ioi Lam
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: