Top


定義場所(file name)

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

名前(function name)

void
YoungList::reset_auxilary_lists() {

本体部(body)

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

      guarantee( is_empty(), "young list should be empty" );
      assert(check_list_well_formed(), "young list should be well formed");

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

      // Add survivor regions to SurvRateGroup.
      _g1h->g1_policy()->note_start_adding_survivor_regions();
      _g1h->g1_policy()->finished_recalculating_age_indexes(true /* is_survivors */);

  {- -------------------------------------------
  (1) _survivor_head フィールドに格納されている Survivor 相当の領域全てに対し, #TODO
      ---------------------------------------- -}

      for (HeapRegion* curr = _survivor_head;
           curr != NULL;
           curr = curr->get_next_young_region()) {
        _g1h->g1_policy()->set_region_survivors(curr);

        // The region is a non-empty survivor so let's add it to
        // the incremental collection set for the next evacuation
        // pause.
        _g1h->g1_policy()->add_region_to_incremental_cset_rhs(curr);
      }

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

      _g1h->g1_policy()->note_stop_adding_survivor_regions();

  {- -------------------------------------------
  (1) _head フィールドに格納しているリストを
      _survivor_head フィールドに格納されている Survivor 相当の領域のリストに置き換える.
      (ついでに _length フィールドも _survivor_length の値に置き換える)
      (ついでに, _survivor_head フィールドが NULL でなかった場合には
      _survivor_tail->set_next_young_region(NULL);)
      ---------------------------------------- -}

      _head   = _survivor_head;
      _length = _survivor_length;
      if (_survivor_head != NULL) {
        assert(_survivor_tail != NULL, "cause it shouldn't be");
        assert(_survivor_length > 0, "invariant");
        _survivor_tail->set_next_young_region(NULL);
      }

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

      // Don't clear the survivor list handles until the start of
      // the next evacuation pause - we need it in order to re-tag
      // the survivor regions from this evacuation pause as 'young'
      // at the start of the next.

      _g1h->g1_policy()->finished_recalculating_age_indexes(false /* is_survivors */);

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

      assert(check_list_well_formed(), "young list should be well formed");
    }

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