< prev index next >

src/hotspot/share/memory/classLoaderMetaspace.hpp

Print this page
@@ -31,11 +31,13 @@
  
  class outputStream;
  
  namespace metaspace {
    struct ClmsStats;
+   class ClmsTester;
    class MetaspaceArena;
+   class MetaspaceContext;
  }
  
  // A ClassLoaderMetaspace manages MetaspaceArena(s) for a CLD.
  //
  // A CLD owns one MetaspaceArena if UseCompressedClassPointers is false. Otherwise

@@ -55,10 +57,11 @@
  //                                                  + chunk ... chunk
  //                                                               ^
  //                                                               alloc top
  //
  class ClassLoaderMetaspace : public CHeapObj<mtClass> {
+   friend class metaspace::ClmsTester; // for gtests
  
    // A reference to an outside lock, held by the CLD.
    Mutex* const _lock;
  
    const Metaspace::MetaspaceType _space_type;

@@ -73,12 +76,18 @@
  
    Mutex* lock() const                             { return _lock; }
    metaspace::MetaspaceArena* non_class_space_arena() const   { return _non_class_space_arena; }
    metaspace::MetaspaceArena* class_space_arena() const       { return _class_space_arena; }
  
- public:
+   bool have_class_space_arena() const { return _class_space_arena != nullptr; }
+ 
+   ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType space_type,
+                        metaspace::MetaspaceContext* non_class_context,
+                        metaspace::MetaspaceContext* class_context,
+                        size_t klass_alignment_words);
  
+ public:
    ClassLoaderMetaspace(Mutex* lock, Metaspace::MetaspaceType space_type);
  
    ~ClassLoaderMetaspace();
  
    Metaspace::MetaspaceType space_type() const { return _space_type; }
< prev index next >