Top


定義場所(file name)

hotspot/src/share/vm/memory/generation.cpp

名前(function name)

CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size,
                               int level,
                               GenRemSet* remset) :

本体部(body)

  {- -------------------------------------------
  (1) スーパークラスの初期化
      ---------------------------------------- -}

      Generation(rs, initial_byte_size, level), _rs(remset)
    {

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

      HeapWord* start = (HeapWord*)rs.base();
      size_t reserved_byte_size = rs.size();
      assert((uintptr_t(start) & 3) == 0, "bad alignment");
      assert((reserved_byte_size & 3) == 0, "bad alignment");
      MemRegion reserved_mr(start, heap_word_size(reserved_byte_size));

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

      _bts = new BlockOffsetSharedArray(reserved_mr,
                                        heap_word_size(initial_byte_size));
      MemRegion committed_mr(start, heap_word_size(initial_byte_size));
      _rs->resize_covered_region(committed_mr);
      if (_bts == NULL)
        vm_exit_during_initialization("Could not allocate a BlockOffsetArray");

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

      // Verify that the start and end of this generation is the start of a card.
      // If this wasn't true, a single card could span more than on generation,
      // which would cause problems when we commit/uncommit memory, and when we
      // clear and dirty cards.
      guarantee(_rs->is_aligned(reserved_mr.start()), "generation must be card aligned");
      if (reserved_mr.end() != Universe::heap()->reserved_region().end()) {
        // Don't check at the very end of the heap as we'll assert that we're probing off
        // the end if we try.
        guarantee(_rs->is_aligned(reserved_mr.end()), "generation must be card aligned");
      }
    }

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