Top


定義場所(file name)

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

名前(function name)

PermGen* PermanentGenerationSpec::init(ReservedSpace rs,
                                       size_t init_size,
                                       GenRemSet *remset) {

本体部(body)

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

      // Break the reserved spaces into pieces for the permanent space
      // and the shared spaces.
      ReservedSpace perm_rs = rs.first_part(_max_size, UseSharedSpaces,
                                            UseSharedSpaces);
      ReservedSpace shared_rs = rs.last_part(_max_size);

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

      if (enable_shared_spaces()) {
        if (!perm_rs.is_reserved() ||
            perm_rs.base() + perm_rs.size() != shared_rs.base()) {
          FileMapInfo* mapinfo = FileMapInfo::current_info();
          mapinfo->fail_continue("Sharing disabled - unable to "
                                     "reserve address space.");
          shared_rs.release();
          disable_sharing();
        }
      }

  {- -------------------------------------------
  (1) 指定された名前に応じて, 以下の switch-case で
      適切な PermGen クラスのコンストラクタを呼び出し, 
      生成された PermGen オブジェクトをリターンする.
      ---------------------------------------- -}

      switch (name()) {
        case PermGen::MarkSweepCompact:
          return new CompactingPermGen(perm_rs, shared_rs, init_size, remset, this);

    #ifndef SERIALGC
        case PermGen::MarkSweep:
          guarantee(false, "NYI");
          return NULL;

        case PermGen::ConcurrentMarkSweep: {
          assert(UseConcMarkSweepGC, "UseConcMarkSweepGC should be set");
          CardTableRS* ctrs = remset->as_CardTableRS();
          if (ctrs == NULL) {
            vm_exit_during_initialization("RemSet/generation incompatibility.");
          }
          // XXXPERM
          return new CMSPermGen(perm_rs, init_size, ctrs,
                       (FreeBlockDictionary::DictionaryChoice)CMSDictionaryChoice);
        }
    #endif // SERIALGC
        default:
          guarantee(false, "unrecognized GenerationName");
          return NULL;
      }
    }

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