Top


定義場所(file name)

hotspot/src/share/vm/gc_implementation/g1/g1AllocRegion.cpp

名前(function name)

void G1AllocRegion::retire(bool fill_up) {

本体部(body)

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

      assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));

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

      trace("retiring");

  {- -------------------------------------------
  (1) もし現在の _alloc_region フィールドが _dummy_region でなければ, 
      以下の if 文の中で retire 処理を行う.
      ---------------------------------------- -}

      HeapRegion* alloc_region = _alloc_region;
      if (alloc_region != _dummy_region) {

    {- -------------------------------------------
  (1.1) (assert)
        ---------------------------------------- -}

        // We never have to check whether the active region is empty or not,
        // and potentially free it if it is, given that it's guaranteed that
        // it will never be empty.
        assert(!alloc_region->is_empty(),
               ar_ext_msg(this, "the alloc region should never be empty"));

    {- -------------------------------------------
  (1.1) 引数で...#TODO が指定されていた場合には, 
        G1AllocRegion::fill_up_remaining_space() を呼び出し, 
        もう確保処理ができないように残りの領域を埋めておく.
        ---------------------------------------- -}

        if (fill_up) {
          fill_up_remaining_space(alloc_region, _bot_updates);
        }

    {- -------------------------------------------
  (1.1) (assert)
        ---------------------------------------- -}

        assert(alloc_region->used() >= _used_bytes_before,
               ar_ext_msg(this, "invariant"));

    {- -------------------------------------------
  (1.1) MutatorAllocRegion::retire_region() を呼び出して, 
        incremental collection set に追加する.
        ---------------------------------------- -}

        size_t allocated_bytes = alloc_region->used() - _used_bytes_before;
        retire_region(alloc_region, allocated_bytes);

    {- -------------------------------------------
  (1.1) フィールドの値をリセット
        ---------------------------------------- -}

        _used_bytes_before = 0;
        _alloc_region = _dummy_region;
      }

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

      trace("retired");
    }

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