< prev index next >
src/share/vm/classfile/classLoaderData.hpp
Print this page
*** 44,71 ****
//
// A ClassLoaderData also encapsulates the allocation space, called a metaspace,
// used by the dynamic linker to allocate the runtime representation of all
// the types it defines.
//
! // ClassLoaderData are stored in the runtime representation of classes and the
! // system dictionary, are roots of garbage collection, and provides iterators
! // for root tracing and other GC operations.
class ClassLoaderData;
class JNIMethodBlock;
class Metadebug;
class ModuleEntry;
class PackageEntry;
class ModuleEntryTable;
class PackageEntryTable;
// GC root for walking class loader data created
class ClassLoaderDataGraph : public AllStatic {
friend class ClassLoaderData;
friend class ClassLoaderDataGraphMetaspaceIterator;
friend class ClassLoaderDataGraphKlassIteratorAtomic;
friend class VMStructs;
private:
// All CLDs (except the null CLD) can be reached by walking _head->_next->...
static ClassLoaderData* _head;
static ClassLoaderData* _unloading;
--- 44,73 ----
//
// A ClassLoaderData also encapsulates the allocation space, called a metaspace,
// used by the dynamic linker to allocate the runtime representation of all
// the types it defines.
//
! // ClassLoaderData are stored in the runtime representation of classes,
! // and provides iterators for root tracing and other GC operations.
class ClassLoaderData;
class JNIMethodBlock;
class Metadebug;
class ModuleEntry;
class PackageEntry;
class ModuleEntryTable;
class PackageEntryTable;
+ class DictionaryEntry;
+ class Dictionary;
// GC root for walking class loader data created
class ClassLoaderDataGraph : public AllStatic {
friend class ClassLoaderData;
friend class ClassLoaderDataGraphMetaspaceIterator;
friend class ClassLoaderDataGraphKlassIteratorAtomic;
+ friend class ClassLoaderDataGraphKlassIteratorStatic;
friend class VMStructs;
private:
// All CLDs (except the null CLD) can be reached by walking _head->_next->...
static ClassLoaderData* _head;
static ClassLoaderData* _unloading;
*** 107,116 ****
--- 109,134 ----
static void packages_unloading_do(void f(PackageEntry*));
static void loaded_classes_do(KlassClosure* klass_closure);
static void classes_unloading_do(void f(Klass* const));
static bool do_unloading(BoolObjectClosure* is_alive, bool clean_previous_versions);
+ // dictionary do
+ // Iterate over all klasses in dictionary, but
+ // just the classes from defining class loaders.
+ static void dictionary_classes_do(void f(InstanceKlass*));
+ // Added for initialize_itable_for_klass to handle exceptions.
+ static void dictionary_classes_do(void f(InstanceKlass*, TRAPS), TRAPS);
+
+ // Iterate all classes and their class loaders, including initiating class loaders.
+ static void dictionary_all_entries_do(void f(InstanceKlass*, ClassLoaderData*));
+
+ // VM_CounterDecay iteration support
+ static InstanceKlass* try_get_next_class();
+
+ static void verify_dictionary();
+ static void print_dictionary(bool details);
+
// CMS support.
static void remember_new_clds(bool remember) { _saved_head = (remember ? _head : NULL); }
static GrowableArray<ClassLoaderData*>* new_clds();
static void set_should_purge(bool b) { _should_purge = b; }
*** 191,200 ****
--- 209,219 ----
void oops_do(OopClosure* f);
};
friend class ClassLoaderDataGraph;
friend class ClassLoaderDataGraphKlassIteratorAtomic;
+ friend class ClassLoaderDataGraphKlassIteratorStatic;
friend class ClassLoaderDataGraphMetaspaceIterator;
friend class MetaDataFactory;
friend class Method;
static ClassLoaderData * _the_null_class_loader_data;
*** 219,230 ****
ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
// have the same life cycle of the corresponding ClassLoader.
Klass* volatile _klasses; // The classes defined by the class loader.
PackageEntryTable* volatile _packages; // The packages defined by the class loader.
- ModuleEntry* _unnamed_module; // This class loader's unnamed module.
ModuleEntryTable* volatile _modules; // The modules defined by the class loader.
// These method IDs are created for the class loader and set to NULL when the
// class loader is unloaded. They are rarely freed, only for redefine classes
// and if they lose a data race in InstanceKlass.
JNIMethodBlock* _jmethod_ids;
--- 238,250 ----
ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
// have the same life cycle of the corresponding ClassLoader.
Klass* volatile _klasses; // The classes defined by the class loader.
PackageEntryTable* volatile _packages; // The packages defined by the class loader.
ModuleEntryTable* volatile _modules; // The modules defined by the class loader.
+ ModuleEntry* _unnamed_module; // This class loader's unnamed module.
+ Dictionary* _dictionary; // The loaded InstanceKlasses, including initiated by this class loader
// These method IDs are created for the class loader and set to NULL when the
// class loader is unloaded. They are rarely freed, only for redefine classes
// and if they lose a data race in InstanceKlass.
JNIMethodBlock* _jmethod_ids;
*** 267,276 ****
--- 287,297 ----
void free_deallocate_list();
// Allocate out of this class loader data
MetaWord* allocate(size_t size);
+ Dictionary* create_dictionary();
public:
bool is_alive(BoolObjectClosure* is_alive_closure) const;
// Accessors
*** 322,341 ****
// Used to refcount an anonymous class's CLD in order to
// indicate their aliveness without a keep_alive_object().
void inc_keep_alive();
void dec_keep_alive();
! inline unsigned int identity_hash() const;
// Used when tracing from klasses.
void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
void classes_do(KlassClosure* klass_closure);
JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
void print_value() { print_value_on(tty); }
void print_value_on(outputStream* out) const;
void dump(outputStream * const out) PRODUCT_RETURN;
void verify();
const char* loader_name();
--- 343,365 ----
// Used to refcount an anonymous class's CLD in order to
// indicate their aliveness without a keep_alive_object().
void inc_keep_alive();
void dec_keep_alive();
! inline unsigned int identity_hash() const { return (unsigned int)(((intptr_t)this) >> 3); }
// Used when tracing from klasses.
void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim);
void classes_do(KlassClosure* klass_closure);
+ Klass* klasses() { return _klasses; }
JNIMethodBlock* jmethod_ids() const { return _jmethod_ids; }
void set_jmethod_ids(JNIMethodBlock* new_block) { _jmethod_ids = new_block; }
+ void print() { print_on(tty); }
+ void print_on(outputStream* out) const;
void print_value() { print_value_on(tty); }
void print_value_on(outputStream* out) const;
void dump(outputStream * const out) PRODUCT_RETURN;
void verify();
const char* loader_name();
*** 350,359 ****
--- 374,386 ----
PackageEntryTable* packages() { return _packages; }
ModuleEntry* unnamed_module() { return _unnamed_module; }
ModuleEntryTable* modules();
bool modules_defined() { return (_modules != NULL); }
+ // Loaded class dictionary
+ Dictionary* dictionary() const { return _dictionary; }
+
void add_to_deallocate_list(Metadata* m);
static ClassLoaderData* class_loader_data(oop loader);
static ClassLoaderData* class_loader_data_or_null(oop loader);
static ClassLoaderData* anonymous_class_loader_data(oop loader, TRAPS);
< prev index next >