src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp

changeset 435
a61af66fc99e
child 574
c0492d52d55b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/cmsPermGen.hpp	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,74 @@
     1.4 +/*
     1.5 + * Copyright (c) 2007 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.
    1.11 + *
    1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 + * version 2 for more details (a copy is included in the LICENSE file that
    1.16 + * accompanied this code).
    1.17 + *
    1.18 + * You should have received a copy of the GNU General Public License version
    1.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 + *
    1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
    1.24 + * have any questions.
    1.25 + *
    1.26 + */
    1.27 +
    1.28 +class CardTableRS;   // fwd decl
    1.29 +class ConcurrentMarkSweepGeneration;
    1.30 +
    1.31 +// A PermGen implemented with a CMS space, collected by a CMS collector.
    1.32 +class CMSPermGen:  public PermGen {
    1.33 +  friend class VMStructs;
    1.34 +
    1.35 +  HeapWord* mem_allocate_work(size_t size);
    1.36 + protected:
    1.37 +  // The "generation" view.
    1.38 +  ConcurrentMarkSweepGeneration* _gen;
    1.39 +
    1.40 + public:
    1.41 +  CMSPermGen(ReservedSpace rs, size_t initial_byte_size,
    1.42 +             CardTableRS* ct, FreeBlockDictionary::DictionaryChoice);
    1.43 +
    1.44 +  HeapWord* mem_allocate(size_t size);
    1.45 +
    1.46 +  void compute_new_size();
    1.47 +
    1.48 +  Generation* as_gen() const { return _gen; }
    1.49 +};
    1.50 +
    1.51 +// This is the "generation" view of a CMSPermGen.
    1.52 +class CMSPermGenGen: public ConcurrentMarkSweepGeneration {
    1.53 +  // Abstractly, this is a subtype that gets access to protected fields.
    1.54 +  friend class CMSPermGen;
    1.55 +public:
    1.56 +  CMSPermGenGen(ReservedSpace rs, size_t initial_byte_size,
    1.57 +                       int level, CardTableRS* ct):
    1.58 +    // See comments in the constructor for CompactibleFreeListSpace
    1.59 +    // regarding not using adaptive free lists for a perm gen.
    1.60 +    ConcurrentMarkSweepGeneration(rs, initial_byte_size, // MinPermHeapExapnsion
    1.61 +      level, ct, false /* use adaptive freelists */,
    1.62 +      (FreeBlockDictionary::DictionaryChoice)CMSDictionaryChoice)
    1.63 +  {}
    1.64 +
    1.65 +  void initialize_performance_counters();
    1.66 +
    1.67 +  const char* name() const {
    1.68 +    return "concurrent-mark-sweep perm gen";
    1.69 +  }
    1.70 +
    1.71 +  const char* short_name() const {
    1.72 +    return "CMS Perm";
    1.73 +  }
    1.74 +
    1.75 +  bool must_be_youngest() const { return false; }
    1.76 +  bool must_be_oldest() const { return false; }
    1.77 +};

mercurial