Top


定義場所(file name)

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

名前(function name)

void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {

本体部(body)

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      assert(Universe::heap()->is_gc_active(), "called outside gc");

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      ResourceMark rm;

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

      NOT_PRODUCT(TraceTime tm("ThreadRootsMarkingTask",
        PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));

  {- -------------------------------------------
  (1) ParCompactionManager::gc_thread_compaction_manager() で, 
      これを実行している GCTaskThread 用の ParCompactionManager オブジェクトを取得する.
      ---------------------------------------- -}

      ParCompactionManager* cm =
        ParCompactionManager::gc_thread_compaction_manager(which);

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
      CodeBlobToOopClosure mark_and_push_in_blobs(&mark_and_push_closure, /*do_marking=*/ true);

  {- -------------------------------------------
  (1) 処理対象のスレッドが JavaThread であれば JavaThread::oops_do() を呼び出す.
      処理対象のスレッドが VMThread であれば VMThread::oops_do() を呼び出す.
      ---------------------------------------- -}

      if (_java_thread != NULL)
        _java_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);

      if (_vm_thread != NULL)
        _vm_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);

  {- -------------------------------------------
  (1) PSParallelCompact::MarkAndPushClosure::follow_marking_stacks() で, 
      タスクキューに追加したポインタに対して, 再帰的な mark 処理を行う.
      ---------------------------------------- -}

      // Do the real work
      cm->follow_marking_stacks();
    }

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