src/share/vm/memory/sharedHeap.hpp

Print this page


   1 /*
   2  * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 







  25 // A "SharedHeap" is an implementation of a java heap for HotSpot.  This
  26 // is an abstract class: there may be many different kinds of heaps.  This
  27 // class defines the functions that a heap must implement, and contains
  28 // infrastructure common to all heaps.
  29 
  30 class PermGen;
  31 class Generation;
  32 class BarrierSet;
  33 class GenRemSet;
  34 class Space;
  35 class SpaceClosure;
  36 class OopClosure;
  37 class OopsInGenClosure;
  38 class ObjectClosure;
  39 class SubTasksDone;
  40 class WorkGang;
  41 class CollectorPolicy;
  42 class KlassHandle;
  43 
  44 class SharedHeap : public CollectedHeap {


 267     assert(perm_gen(), "NULL perm gen");
 268     return _perm_gen->mem_allocate(size);
 269   }
 270 
 271   void permanent_oop_iterate(OopClosure* cl) {
 272     assert(perm_gen(), "NULL perm gen");
 273     _perm_gen->oop_iterate(cl);
 274   }
 275 
 276   void permanent_object_iterate(ObjectClosure* cl) {
 277     assert(perm_gen(), "NULL perm gen");
 278     _perm_gen->object_iterate(cl);
 279   }
 280 
 281   // Some utilities.
 282   void print_size_transition(outputStream* out,
 283                              size_t bytes_before,
 284                              size_t bytes_after,
 285                              size_t capacity);
 286 };


   1 /*
   2  * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_MEMORY_SHAREDHEAP_HPP
  26 #define SHARE_VM_MEMORY_SHAREDHEAP_HPP
  27 
  28 #include "gc_interface/collectedHeap.hpp"
  29 #include "memory/generation.hpp"
  30 #include "memory/permGen.hpp"
  31 
  32 // A "SharedHeap" is an implementation of a java heap for HotSpot.  This
  33 // is an abstract class: there may be many different kinds of heaps.  This
  34 // class defines the functions that a heap must implement, and contains
  35 // infrastructure common to all heaps.
  36 
  37 class PermGen;
  38 class Generation;
  39 class BarrierSet;
  40 class GenRemSet;
  41 class Space;
  42 class SpaceClosure;
  43 class OopClosure;
  44 class OopsInGenClosure;
  45 class ObjectClosure;
  46 class SubTasksDone;
  47 class WorkGang;
  48 class CollectorPolicy;
  49 class KlassHandle;
  50 
  51 class SharedHeap : public CollectedHeap {


 274     assert(perm_gen(), "NULL perm gen");
 275     return _perm_gen->mem_allocate(size);
 276   }
 277 
 278   void permanent_oop_iterate(OopClosure* cl) {
 279     assert(perm_gen(), "NULL perm gen");
 280     _perm_gen->oop_iterate(cl);
 281   }
 282 
 283   void permanent_object_iterate(ObjectClosure* cl) {
 284     assert(perm_gen(), "NULL perm gen");
 285     _perm_gen->object_iterate(cl);
 286   }
 287 
 288   // Some utilities.
 289   void print_size_transition(outputStream* out,
 290                              size_t bytes_before,
 291                              size_t bytes_after,
 292                              size_t capacity);
 293 };
 294 
 295 #endif // SHARE_VM_MEMORY_SHAREDHEAP_HPP