< prev index next >

src/hotspot/share/memory/metaspace.hpp

Print this page
rev 50068 : [mq]: metaspace-split

@@ -53,26 +53,27 @@
 //                       |                   |
 //                       |                   |
 //                       +-------------------+
 //
 
-class ChunkManager;
 class ClassLoaderData;
-class Metablock;
-class Metachunk;
 class MetaspaceTracer;
 class MetaWord;
 class Mutex;
 class outputStream;
-class PrintCLDMetaspaceInfoClosure;
-class SpaceManager;
-class VirtualSpaceList;
+
 class CollectedHeap;
 
 namespace metaspace {
 namespace internals {
+  class ChunkManager;
   class ClassLoaderMetaspaceStatistics;
+  class Metablock;
+  class Metachunk;
+  class PrintCLDMetaspaceInfoClosure;
+  class SpaceManager;
+  class VirtualSpaceList;
 }}
 
 // Metaspaces each have a  SpaceManager and allocations
 // are done by the SpaceManager.  Allocations are done
 // out of the current Metachunk.  When the current Metachunk

@@ -129,35 +130,35 @@
   static size_t _commit_alignment;
   static size_t _reserve_alignment;
   DEBUG_ONLY(static bool   _frozen;)
 
   // Virtual Space lists for both classes and other metadata
-  static VirtualSpaceList* _space_list;
-  static VirtualSpaceList* _class_space_list;
+  static metaspace::internals::VirtualSpaceList* _space_list;
+  static metaspace::internals::VirtualSpaceList* _class_space_list;
 
-  static ChunkManager* _chunk_manager_metadata;
-  static ChunkManager* _chunk_manager_class;
+  static metaspace::internals::ChunkManager* _chunk_manager_metadata;
+  static metaspace::internals::ChunkManager* _chunk_manager_class;
 
   static const MetaspaceTracer* _tracer;
 
  public:
-  static VirtualSpaceList* space_list()       { return _space_list; }
-  static VirtualSpaceList* class_space_list() { return _class_space_list; }
-  static VirtualSpaceList* get_space_list(MetadataType mdtype) {
+  static metaspace::internals::VirtualSpaceList* space_list()       { return _space_list; }
+  static metaspace::internals::VirtualSpaceList* class_space_list() { return _class_space_list; }
+  static metaspace::internals::VirtualSpaceList* get_space_list(MetadataType mdtype) {
     assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
     return mdtype == ClassType ? class_space_list() : space_list();
   }
 
-  static ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; }
-  static ChunkManager* chunk_manager_class()    { return _chunk_manager_class; }
-  static ChunkManager* get_chunk_manager(MetadataType mdtype) {
+  static metaspace::internals::ChunkManager* chunk_manager_metadata() { return _chunk_manager_metadata; }
+  static metaspace::internals::ChunkManager* chunk_manager_class()    { return _chunk_manager_class; }
+  static metaspace::internals::ChunkManager* get_chunk_manager(MetadataType mdtype) {
     assert(mdtype != MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
     return mdtype == ClassType ? chunk_manager_class() : chunk_manager_metadata();
   }
 
   // convenience function
-  static ChunkManager* get_chunk_manager(bool is_class) {
+  static metaspace::internals::ChunkManager* get_chunk_manager(bool is_class) {
     return is_class ? chunk_manager_class() : chunk_manager_metadata();
   }
 
   static const MetaspaceTracer* tracer() { return _tracer; }
   static void freeze() {

@@ -229,31 +230,31 @@
 // Manages the metaspace portion belonging to a class loader
 class ClassLoaderMetaspace : public CHeapObj<mtClass> {
   friend class CollectedHeap; // For expand_and_allocate()
   friend class Metaspace;
   friend class MetaspaceUtils;
-  friend class PrintCLDMetaspaceInfoClosure;
+  friend class metaspace::internals::PrintCLDMetaspaceInfoClosure;
   friend class VM_CollectForMetadataAllocation; // For expand_and_allocate()
 
  private:
 
   void initialize(Mutex* lock, Metaspace::MetaspaceType type);
 
   // Initialize the first chunk for a Metaspace.  Used for
   // special cases such as the boot class loader, reflection
   // class loader and anonymous class loader.
   void initialize_first_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype);
-  Metachunk* get_initialization_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype);
+  metaspace::internals::Metachunk* get_initialization_chunk(Metaspace::MetaspaceType type, Metaspace::MetadataType mdtype);
 
   const Metaspace::MetaspaceType _space_type;
   Mutex* const  _lock;
-  SpaceManager* _vsm;
-  SpaceManager* _class_vsm;
+  metaspace::internals::SpaceManager* _vsm;
+  metaspace::internals::SpaceManager* _class_vsm;
 
-  SpaceManager* vsm() const { return _vsm; }
-  SpaceManager* class_vsm() const { return _class_vsm; }
-  SpaceManager* get_space_manager(Metaspace::MetadataType mdtype) {
+  metaspace::internals::SpaceManager* vsm() const { return _vsm; }
+  metaspace::internals::SpaceManager* class_vsm() const { return _class_vsm; }
+  metaspace::internals::SpaceManager* get_space_manager(Metaspace::MetadataType mdtype) {
     assert(mdtype != Metaspace::MetadataTypeCount, "MetadaTypeCount can't be used as mdtype");
     return mdtype == Metaspace::ClassType ? class_vsm() : vsm();
   }
 
   Mutex* lock() const { return _lock; }

@@ -263,17 +264,17 @@
   size_t class_chunk_size(size_t word_size);
 
   // Adds to the given statistic object. Must be locked with CLD metaspace lock.
   void add_to_statistics_locked(metaspace::internals::ClassLoaderMetaspaceStatistics* out) const;
 
+  Metaspace::MetaspaceType space_type() const { return _space_type; }
+
  public:
 
   ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType type);
   ~ClassLoaderMetaspace();
 
-  Metaspace::MetaspaceType space_type() const { return _space_type; }
-
   // Allocate space for metadata of type mdtype. This is space
   // within a Metachunk and is used by
   //   allocate(ClassLoaderData*, size_t, bool, MetadataType, TRAPS)
   MetaWord* allocate(size_t word_size, Metaspace::MetadataType mdtype);
 

@@ -292,11 +293,11 @@
 }; // ClassLoaderMetaspace
 
 class MetaspaceUtils : AllStatic {
 
   // Spacemanager updates running counters.
-  friend class SpaceManager;
+  friend class metaspace::internals::SpaceManager;
 
   // Running counters for statistics concerning in-use chunks.
   // Note: capacity = used + free + waste + overhead. Note that we do not
   // count free and waste. Their sum can be deduces from the three other values.
   // For more details, one should call print_report() from within a safe point.
< prev index next >