hotspot/src/share/vm/classfile/classLoaderData.hpp
changeset 31038 2fd2fdc6a70a
parent 29577 bb06d25e302d
child 31046 d01ad7a0ecb0
equal deleted inserted replaced
31037:01a5c5fa5681 31038:2fd2fdc6a70a
    49 // system dictionary, are roots of garbage collection, and provides iterators
    49 // system dictionary, are roots of garbage collection, and provides iterators
    50 // for root tracing and other GC operations.
    50 // for root tracing and other GC operations.
    51 
    51 
    52 class ClassLoaderData;
    52 class ClassLoaderData;
    53 class JNIMethodBlock;
    53 class JNIMethodBlock;
    54 class JNIHandleBlock;
       
    55 class Metadebug;
    54 class Metadebug;
    56 
    55 
    57 // GC root for walking class loader data created
    56 // GC root for walking class loader data created
    58 
    57 
    59 class ClassLoaderDataGraph : public AllStatic {
    58 class ClassLoaderDataGraph : public AllStatic {
   171   volatile int _claimed;   // true if claimed, for example during GC traces.
   170   volatile int _claimed;   // true if claimed, for example during GC traces.
   172                            // To avoid applying oop closure more than once.
   171                            // To avoid applying oop closure more than once.
   173                            // Has to be an int because we cas it.
   172                            // Has to be an int because we cas it.
   174   Klass* _klasses;         // The classes defined by the class loader.
   173   Klass* _klasses;         // The classes defined by the class loader.
   175 
   174 
   176   JNIHandleBlock* _handles; // Handles to constant pool arrays
       
   177 
       
   178   // These method IDs are created for the class loader and set to NULL when the
   175   // These method IDs are created for the class loader and set to NULL when the
   179   // class loader is unloaded.  They are rarely freed, only for redefine classes
   176   // class loader is unloaded.  They are rarely freed, only for redefine classes
   180   // and if they lose a data race in InstanceKlass.
   177   // and if they lose a data race in InstanceKlass.
   181   JNIMethodBlock*                  _jmethod_ids;
   178   JNIMethodBlock*                  _jmethod_ids;
   182 
   179 
   197 
   194 
   198   ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
   195   ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
   199   ~ClassLoaderData();
   196   ~ClassLoaderData();
   200 
   197 
   201   void set_metaspace(Metaspace* m) { _metaspace = m; }
   198   void set_metaspace(Metaspace* m) { _metaspace = m; }
   202 
       
   203   JNIHandleBlock* handles() const;
       
   204   void set_handles(JNIHandleBlock* handles);
       
   205 
   199 
   206   // GC interface.
   200   // GC interface.
   207   void clear_claimed()          { _claimed = 0; }
   201   void clear_claimed()          { _claimed = 0; }
   208   bool claimed() const          { return _claimed == 1; }
   202   bool claimed() const          { return _claimed == 1; }
   209   bool claim();
   203   bool claim();
   288   void print_value_on(outputStream* out) const;
   282   void print_value_on(outputStream* out) const;
   289   void dump(outputStream * const out) PRODUCT_RETURN;
   283   void dump(outputStream * const out) PRODUCT_RETURN;
   290   void verify();
   284   void verify();
   291   const char* loader_name();
   285   const char* loader_name();
   292 
   286 
   293   jobject add_handle(Handle h);
       
   294   void add_class(Klass* k);
   287   void add_class(Klass* k);
   295   void remove_class(Klass* k);
   288   void remove_class(Klass* k);
   296   bool contains_klass(Klass* k);
   289   bool contains_klass(Klass* k);
   297   void record_dependency(Klass* to, TRAPS);
   290   void record_dependency(Klass* to, TRAPS);
   298   void init_dependencies(TRAPS);
   291   void init_dependencies(TRAPS);