Top


定義場所(file name)

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

名前(function name)

void PSPromotionManager::initialize() {

本体部(body)

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

      ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
      assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");

      _old_gen = heap->old_gen();
      _young_space = heap->young_gen()->to_space();

  {- -------------------------------------------
  (1) フィールドの初期化
      ---------------------------------------- -}

      assert(_manager_array == NULL, "Attempt to initialize twice");
      _manager_array = NEW_C_HEAP_ARRAY(PSPromotionManager*, ParallelGCThreads+1 );
      guarantee(_manager_array != NULL, "Could not initialize promotion manager");

      _stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
      guarantee(_stack_array_depth != NULL, "Cound not initialize promotion manager");

    {- -------------------------------------------
  (1.1) 以下の for ループ内で _manager_array の中身を初期化している
        (ParallelGCThreads 個の PSPromotionManager オブジェクトを生成し, _manager_array 内に詰めている)
        ---------------------------------------- -}

      // Create and register the PSPromotionManager(s) for the worker threads.
      for(uint i=0; i<ParallelGCThreads; i++) {
        _manager_array[i] = new PSPromotionManager();
        guarantee(_manager_array[i] != NULL, "Could not create PSPromotionManager");
        stack_array_depth()->register_queue(i, _manager_array[i]->claimed_stack_depth());
      }

      // The VMThread gets its own PSPromotionManager, which is not available
      // for work stealing.
      _manager_array[ParallelGCThreads] = new PSPromotionManager();
      guarantee(_manager_array[ParallelGCThreads] != NULL, "Could not create PSPromotionManager");
    }

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