Top


定義場所(file name)

hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp

名前(function name)

void PSParallelCompact::adjust_roots() {

本体部(body)

  {- -------------------------------------------
  (1) (この関数で, 各 live object 内のポインタをコンパクション後の新しいアドレスに修正する)
      ---------------------------------------- -}

      // Adjust the pointers to reflect the new locations

  {- -------------------------------------------
  (1) (トレース出力)
      ---------------------------------------- -}

      EventMark m("3 adjust roots");
      TraceTime tm("adjust roots", print_phases(), true, gclog_or_tty);

  {- -------------------------------------------
  (1) 全ての strong root に対して, PSParallelCompact::AdjustPointerClosure を適用し, 
      全ての live object 内のポインタをコンパクション後の新しいアドレスに修正する.
      ---------------------------------------- -}

      // General strong roots.
      Universe::oops_do(adjust_root_pointer_closure());
      ReferenceProcessor::oops_do(adjust_root_pointer_closure());
      JNIHandles::oops_do(adjust_root_pointer_closure());   // Global (strong) JNI handles
      Threads::oops_do(adjust_root_pointer_closure(), NULL);
      ObjectSynchronizer::oops_do(adjust_root_pointer_closure());
      FlatProfiler::oops_do(adjust_root_pointer_closure());
      Management::oops_do(adjust_root_pointer_closure());
      JvmtiExport::oops_do(adjust_root_pointer_closure());
      // SO_AllClasses
      SystemDictionary::oops_do(adjust_root_pointer_closure());

      // Now adjust pointers in remaining weak roots.  (All of which should
      // have been cleared if they pointed to non-surviving objects.)
      // Global (weak) JNI handles
      JNIHandles::weak_oops_do(&always_true, adjust_root_pointer_closure());

      CodeCache::oops_do(adjust_pointer_closure());
      StringTable::oops_do(adjust_root_pointer_closure());
      ref_processor()->weak_oops_do(adjust_root_pointer_closure());
      // Roots were visited so references into the young gen in roots
      // may have been scanned.  Process them also.
      // Should the reference processor have a span that excludes
      // young gen objects?
      PSScavenge::reference_processor()->weak_oops_do(
                                                  adjust_root_pointer_closure());
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.