30 #include "classfile/classLoader.hpp" 31 #include "classfile/classLoaderData.inline.hpp" 32 #include "classfile/classLoaderExt.hpp" 33 #include "classfile/dictionary.hpp" 34 #include "classfile/javaClasses.inline.hpp" 35 #include "classfile/klassFactory.hpp" 36 #include "classfile/loaderConstraints.hpp" 37 #include "classfile/packageEntry.hpp" 38 #include "classfile/placeholders.hpp" 39 #include "classfile/protectionDomainCache.hpp" 40 #include "classfile/resolutionErrors.hpp" 41 #include "classfile/stringTable.hpp" 42 #include "classfile/systemDictionary.hpp" 43 #include "classfile/vmSymbols.hpp" 44 #include "code/codeCache.hpp" 45 #include "compiler/compileBroker.hpp" 46 #include "gc/shared/gcTraceTime.inline.hpp" 47 #include "gc/shared/oopStorage.inline.hpp" 48 #include "interpreter/bytecodeStream.hpp" 49 #include "interpreter/interpreter.hpp" 50 #include "jfr/jfrEvents.hpp" 51 #include "logging/log.hpp" 52 #include "logging/logStream.hpp" 53 #include "memory/filemap.hpp" 54 #include "memory/metaspaceClosure.hpp" 55 #include "memory/oopFactory.hpp" 56 #include "memory/resourceArea.hpp" 57 #include "oops/access.inline.hpp" 58 #include "oops/instanceKlass.hpp" 59 #include "oops/instanceRefKlass.hpp" 60 #include "oops/klass.inline.hpp" 61 #include "oops/method.inline.hpp" 62 #include "oops/methodData.hpp" 63 #include "oops/objArrayKlass.hpp" 64 #include "oops/objArrayOop.inline.hpp" 65 #include "oops/oop.inline.hpp" 66 #include "oops/symbol.hpp" 67 #include "oops/typeArrayKlass.hpp" 68 #include "prims/jvmtiEnvBase.hpp" 69 #include "prims/resolvedMethodTable.hpp" 70 #include "prims/methodHandles.hpp" 71 #include "runtime/arguments.hpp" 72 #include "runtime/arguments_ext.hpp" 73 #include "runtime/biasedLocking.hpp" 74 #include "runtime/fieldType.hpp" 75 #include "runtime/handles.inline.hpp" 76 #include "runtime/java.hpp" 77 #include "runtime/javaCalls.hpp" 78 #include "runtime/mutexLocker.hpp" 79 #include "runtime/orderAccess.hpp" 80 #include "runtime/sharedRuntime.hpp" 81 #include "runtime/signature.hpp" 82 #include "services/classLoadingService.hpp" 83 #include "services/diagnosticCommand.hpp" 84 #include "services/threadService.hpp" 85 #include "utilities/macros.hpp" 86 #if INCLUDE_CDS 87 #include "classfile/systemDictionaryShared.hpp" 88 #endif 89 #if INCLUDE_JVMCI 90 #include "jvmci/jvmciRuntime.hpp" 91 #endif 92 93 PlaceholderTable* SystemDictionary::_placeholders = NULL; 94 Dictionary* SystemDictionary::_shared_dictionary = NULL; 95 LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; 96 ResolutionErrorTable* SystemDictionary::_resolution_errors = NULL; 97 SymbolPropertyTable* SystemDictionary::_invoke_method_table = NULL; 98 ProtectionDomainCacheTable* SystemDictionary::_pd_cache_table = NULL; 99 100 int SystemDictionary::_number_of_modifications = 0; 101 oop SystemDictionary::_system_loader_lock_obj = NULL; 102 103 InstanceKlass* SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT] 104 = { NULL /*, NULL...*/ }; 105 1834 k->set_init_state(InstanceKlass::loaded); 1835 // Now flush all code that depended on old class hierarchy. 1836 // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) 1837 // Also, first reinitialize vtable because it may have gotten out of synch 1838 // while the new class wasn't connected to the class hierarchy. 1839 CodeCache::flush_dependents_on(k); 1840 } 1841 1842 // ---------------------------------------------------------------------------- 1843 // GC support 1844 1845 // Assumes classes in the SystemDictionary are only unloaded at a safepoint 1846 // Note: anonymous classes are not in the SD. 1847 bool SystemDictionary::do_unloading(GCTimer* gc_timer, 1848 bool do_cleaning) { 1849 1850 bool unloading_occurred; 1851 { 1852 GCTraceTime(Debug, gc, phases) t("ClassLoaderData", gc_timer); 1853 1854 // First, mark for unload all ClassLoaderData referencing a dead class loader. 1855 unloading_occurred = ClassLoaderDataGraph::do_unloading(do_cleaning); 1856 if (unloading_occurred) { 1857 ClassLoaderDataGraph::clean_module_and_package_info(); 1858 } 1859 } 1860 1861 // TODO: just return if !unloading_occurred. 1862 if (unloading_occurred) { 1863 { 1864 GCTraceTime(Debug, gc, phases) t("SymbolTable", gc_timer); 1865 // Check if there's work to do in the SymbolTable 1866 SymbolTable::do_check_concurrent_work(); 1867 } 1868 1869 { 1870 GCTraceTime(Debug, gc, phases) t("Dictionary", gc_timer); 1871 constraints()->purge_loader_constraints(); 1872 resolution_errors()->purge_resolution_errors(); 1873 } 1874 } 1875 1876 { 1877 GCTraceTime(Debug, gc, phases) t("ProtectionDomainCacheTable", gc_timer); | 30 #include "classfile/classLoader.hpp" 31 #include "classfile/classLoaderData.inline.hpp" 32 #include "classfile/classLoaderExt.hpp" 33 #include "classfile/dictionary.hpp" 34 #include "classfile/javaClasses.inline.hpp" 35 #include "classfile/klassFactory.hpp" 36 #include "classfile/loaderConstraints.hpp" 37 #include "classfile/packageEntry.hpp" 38 #include "classfile/placeholders.hpp" 39 #include "classfile/protectionDomainCache.hpp" 40 #include "classfile/resolutionErrors.hpp" 41 #include "classfile/stringTable.hpp" 42 #include "classfile/systemDictionary.hpp" 43 #include "classfile/vmSymbols.hpp" 44 #include "code/codeCache.hpp" 45 #include "compiler/compileBroker.hpp" 46 #include "gc/shared/gcTraceTime.inline.hpp" 47 #include "gc/shared/oopStorage.inline.hpp" 48 #include "interpreter/bytecodeStream.hpp" 49 #include "interpreter/interpreter.hpp" 50 #include "jfr/jfr.hpp" 51 #include "jfr/jfrEvents.hpp" 52 #include "logging/log.hpp" 53 #include "logging/logStream.hpp" 54 #include "memory/filemap.hpp" 55 #include "memory/metaspaceClosure.hpp" 56 #include "memory/oopFactory.hpp" 57 #include "memory/resourceArea.hpp" 58 #include "oops/access.inline.hpp" 59 #include "oops/instanceKlass.hpp" 60 #include "oops/instanceRefKlass.hpp" 61 #include "oops/klass.inline.hpp" 62 #include "oops/method.inline.hpp" 63 #include "oops/methodData.hpp" 64 #include "oops/objArrayKlass.hpp" 65 #include "oops/objArrayOop.inline.hpp" 66 #include "oops/oop.inline.hpp" 67 #include "oops/symbol.hpp" 68 #include "oops/typeArrayKlass.hpp" 69 #include "prims/jvmtiEnvBase.hpp" 70 #include "prims/resolvedMethodTable.hpp" 71 #include "prims/methodHandles.hpp" 72 #include "runtime/arguments.hpp" 73 #include "runtime/arguments_ext.hpp" 74 #include "runtime/biasedLocking.hpp" 75 #include "runtime/fieldType.hpp" 76 #include "runtime/handles.inline.hpp" 77 #include "runtime/java.hpp" 78 #include "runtime/javaCalls.hpp" 79 #include "runtime/mutexLocker.hpp" 80 #include "runtime/orderAccess.hpp" 81 #include "runtime/sharedRuntime.hpp" 82 #include "runtime/signature.hpp" 83 #include "services/classLoadingService.hpp" 84 #include "services/diagnosticCommand.hpp" 85 #include "services/threadService.hpp" 86 #include "utilities/macros.hpp" 87 #include "utilities/ticks.hpp" 88 #if INCLUDE_CDS 89 #include "classfile/systemDictionaryShared.hpp" 90 #endif 91 #if INCLUDE_JVMCI 92 #include "jvmci/jvmciRuntime.hpp" 93 #endif 94 95 PlaceholderTable* SystemDictionary::_placeholders = NULL; 96 Dictionary* SystemDictionary::_shared_dictionary = NULL; 97 LoaderConstraintTable* SystemDictionary::_loader_constraints = NULL; 98 ResolutionErrorTable* SystemDictionary::_resolution_errors = NULL; 99 SymbolPropertyTable* SystemDictionary::_invoke_method_table = NULL; 100 ProtectionDomainCacheTable* SystemDictionary::_pd_cache_table = NULL; 101 102 int SystemDictionary::_number_of_modifications = 0; 103 oop SystemDictionary::_system_loader_lock_obj = NULL; 104 105 InstanceKlass* SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT] 106 = { NULL /*, NULL...*/ }; 107 1836 k->set_init_state(InstanceKlass::loaded); 1837 // Now flush all code that depended on old class hierarchy. 1838 // Note: must be done *after* linking k into the hierarchy (was bug 12/9/97) 1839 // Also, first reinitialize vtable because it may have gotten out of synch 1840 // while the new class wasn't connected to the class hierarchy. 1841 CodeCache::flush_dependents_on(k); 1842 } 1843 1844 // ---------------------------------------------------------------------------- 1845 // GC support 1846 1847 // Assumes classes in the SystemDictionary are only unloaded at a safepoint 1848 // Note: anonymous classes are not in the SD. 1849 bool SystemDictionary::do_unloading(GCTimer* gc_timer, 1850 bool do_cleaning) { 1851 1852 bool unloading_occurred; 1853 { 1854 GCTraceTime(Debug, gc, phases) t("ClassLoaderData", gc_timer); 1855 1856 #if INCLUDE_JFR 1857 // If unloading occurs, make sure time stamp is consistent. 1858 if (Jfr::is_enabled()) { 1859 InstanceKlass::set_class_unload_time(Ticks::now()); 1860 } 1861 #endif 1862 1863 // First, mark for unload all ClassLoaderData referencing a dead class loader. 1864 unloading_occurred = ClassLoaderDataGraph::do_unloading(do_cleaning); 1865 if (unloading_occurred) { 1866 ClassLoaderDataGraph::clean_module_and_package_info(); 1867 #if INCLUDE_JFR 1868 if (Jfr::is_enabled()) { 1869 Jfr::on_unloading_classes(); 1870 } 1871 #endif 1872 } 1873 } 1874 1875 // TODO: just return if !unloading_occurred. 1876 if (unloading_occurred) { 1877 { 1878 GCTraceTime(Debug, gc, phases) t("SymbolTable", gc_timer); 1879 // Check if there's work to do in the SymbolTable 1880 SymbolTable::do_check_concurrent_work(); 1881 } 1882 1883 { 1884 GCTraceTime(Debug, gc, phases) t("Dictionary", gc_timer); 1885 constraints()->purge_loader_constraints(); 1886 resolution_errors()->purge_resolution_errors(); 1887 } 1888 } 1889 1890 { 1891 GCTraceTime(Debug, gc, phases) t("ProtectionDomainCacheTable", gc_timer); |