40 class ClassLoaderDataGraphIterator;
41
42 // All CLDs (except unlinked CLDs) can be reached by walking _head->_next->...
43 static ClassLoaderData* volatile _head;
44
45 // Set if there's anything to purge in the deallocate lists or previous versions
46 // during a safepoint after class unloading in a full GC.
47 static bool _should_clean_deallocate_lists;
48 static bool _safepoint_cleanup_needed;
49
50 // OOM has been seen in metaspace allocation. Used to prevent some
51 // allocations until class unloading
52 static bool _metaspace_oom;
53
54 static volatile size_t _num_instance_classes;
55 static volatile size_t _num_array_classes;
56
57 static ClassLoaderData* add_to_graph(Handle class_loader, bool has_class_mirror_holder);
58
59 public:
60 static ClassLoaderData* find_or_create(Handle class_loader);
61 static ClassLoaderData* add(Handle class_loader, bool has_class_mirror_holder);
62 static void clean_module_and_package_info();
63 static void purge(bool at_safepoint);
64 static void clear_claimed_marks();
65 static void clear_claimed_marks(int claim);
66 static void verify_claimed_marks_cleared(int claim);
67 // Iteration through CLDG; GC support
68 static void cld_do(CLDClosure* cl);
69 static void roots_cld_do(CLDClosure* strong, CLDClosure* weak);
70 static void always_strong_cld_do(CLDClosure* cl);
71 // Iteration through CLDG not by GC.
72 // All the do suffixed functions do not keep the CLD alive. Any CLD OopHandles
73 // (modules, mirrors, resolved refs) resolved must be treated as no keepalive.
74 // And requires that its CLD's holder is kept alive if they escape the
75 // caller's safepoint or ClassLoaderDataGraph_lock critical section.
76 // The do_keepalive suffixed functions will keep all CLDs alive.
77 static void loaded_cld_do(CLDClosure* cl);
78 // klass do
79 // Walking classes through the ClassLoaderDataGraph include array classes. It also includes
80 // classes that are allocated but not loaded, classes that have errors, and scratch classes
|
40 class ClassLoaderDataGraphIterator;
41
42 // All CLDs (except unlinked CLDs) can be reached by walking _head->_next->...
43 static ClassLoaderData* volatile _head;
44
45 // Set if there's anything to purge in the deallocate lists or previous versions
46 // during a safepoint after class unloading in a full GC.
47 static bool _should_clean_deallocate_lists;
48 static bool _safepoint_cleanup_needed;
49
50 // OOM has been seen in metaspace allocation. Used to prevent some
51 // allocations until class unloading
52 static bool _metaspace_oom;
53
54 static volatile size_t _num_instance_classes;
55 static volatile size_t _num_array_classes;
56
57 static ClassLoaderData* add_to_graph(Handle class_loader, bool has_class_mirror_holder);
58
59 public:
60 static ClassLoaderData* find_or_create(Handle class_loader, bool& created);
61 static ClassLoaderData* add(Handle class_loader, bool has_class_mirror_holder);
62 static void clean_module_and_package_info();
63 static void purge(bool at_safepoint);
64 static void clear_claimed_marks();
65 static void clear_claimed_marks(int claim);
66 static void verify_claimed_marks_cleared(int claim);
67 // Iteration through CLDG; GC support
68 static void cld_do(CLDClosure* cl);
69 static void roots_cld_do(CLDClosure* strong, CLDClosure* weak);
70 static void always_strong_cld_do(CLDClosure* cl);
71 // Iteration through CLDG not by GC.
72 // All the do suffixed functions do not keep the CLD alive. Any CLD OopHandles
73 // (modules, mirrors, resolved refs) resolved must be treated as no keepalive.
74 // And requires that its CLD's holder is kept alive if they escape the
75 // caller's safepoint or ClassLoaderDataGraph_lock critical section.
76 // The do_keepalive suffixed functions will keep all CLDs alive.
77 static void loaded_cld_do(CLDClosure* cl);
78 // klass do
79 // Walking classes through the ClassLoaderDataGraph include array classes. It also includes
80 // classes that are allocated but not loaded, classes that have errors, and scratch classes
|