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 106 InstanceKlass* SystemDictionary::_box_klasses[T_VOID+1] = { NULL /*, NULL...*/ }; 107 108 oop SystemDictionary::_java_system_loader = NULL; 109 oop SystemDictionary::_java_platform_loader = NULL; 110 111 bool SystemDictionary::_has_checkPackageAccess = false; 112 113 // lazily initialized klass variables 114 InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL; 115 116 // Default ProtectionDomainCacheSize value 117 118 const int defaultProtectionDomainCacheSize = 1009; 119 120 OopStorage* SystemDictionary::_vm_weak_oop_storage = NULL; 121 122 123 // ---------------------------------------------------------------------------- 124 // Java-level SystemLoader and PlatformLoader 125 126 oop SystemDictionary::java_system_loader() { 127 return _java_system_loader; 128 } 129 130 oop SystemDictionary::java_platform_loader() { 131 return _java_platform_loader; 132 } 133 134 void SystemDictionary::compute_java_loaders(TRAPS) { 135 JavaValue result(T_OBJECT); 1877 void SystemDictionary::methods_do(void f(Method*)) { 1878 // Walk methods in loaded classes 1879 ClassLoaderDataGraph::methods_do(f); 1880 // Walk method handle intrinsics 1881 invoke_method_table()->methods_do(f); 1882 } 1883 1884 class RemoveClassesClosure : public CLDClosure { 1885 public: 1886 void do_cld(ClassLoaderData* cld) { 1887 if (cld->is_system_class_loader_data() || cld->is_platform_class_loader_data()) { 1888 cld->dictionary()->remove_classes_in_error_state(); 1889 } 1890 } 1891 }; 1892 1893 void SystemDictionary::remove_classes_in_error_state() { 1894 ClassLoaderData::the_null_class_loader_data()->dictionary()->remove_classes_in_error_state(); 1895 RemoveClassesClosure rcc; 1896 ClassLoaderDataGraph::cld_do(&rcc); 1897 } 1898 1899 // ---------------------------------------------------------------------------- 1900 // Lazily load klasses 1901 1902 void SystemDictionary::load_abstract_ownable_synchronizer_klass(TRAPS) { 1903 // if multiple threads calling this function, only one thread will load 1904 // the class. The other threads will find the loaded version once the 1905 // class is loaded. 1906 Klass* aos = _abstract_ownable_synchronizer_klass; 1907 if (aos == NULL) { 1908 Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK); 1909 // Force a fence to prevent any read before the write completes 1910 OrderAccess::fence(); 1911 _abstract_ownable_synchronizer_klass = InstanceKlass::cast(k); 1912 } 1913 } 1914 1915 // ---------------------------------------------------------------------------- 1916 // Initialization 1917 1918 void SystemDictionary::initialize(TRAPS) { 1919 // Allocate arrays 1920 _placeholders = new PlaceholderTable(_placeholder_table_size); 1921 _number_of_modifications = 0; 1922 _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); 1923 _resolution_errors = new ResolutionErrorTable(_resolution_error_size); 1924 _invoke_method_table = new SymbolPropertyTable(_invoke_method_size); 1925 _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize); 1926 1927 // Allocate private object used as system class loader lock 1928 _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK); 1929 // Initialize basic classes 1930 initialize_preloaded_classes(CHECK); 1931 } 1932 | 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 106 InstanceKlass* SystemDictionary::_box_klasses[T_VOID+1] = { NULL /*, NULL...*/ }; 107 108 oop SystemDictionary::_java_system_loader = NULL; 109 oop SystemDictionary::_java_platform_loader = NULL; 110 111 bool SystemDictionary::_has_checkPackageAccess = false; 112 113 // Default ProtectionDomainCacheSize value 114 115 const int defaultProtectionDomainCacheSize = 1009; 116 117 OopStorage* SystemDictionary::_vm_weak_oop_storage = NULL; 118 119 120 // ---------------------------------------------------------------------------- 121 // Java-level SystemLoader and PlatformLoader 122 123 oop SystemDictionary::java_system_loader() { 124 return _java_system_loader; 125 } 126 127 oop SystemDictionary::java_platform_loader() { 128 return _java_platform_loader; 129 } 130 131 void SystemDictionary::compute_java_loaders(TRAPS) { 132 JavaValue result(T_OBJECT); 1874 void SystemDictionary::methods_do(void f(Method*)) { 1875 // Walk methods in loaded classes 1876 ClassLoaderDataGraph::methods_do(f); 1877 // Walk method handle intrinsics 1878 invoke_method_table()->methods_do(f); 1879 } 1880 1881 class RemoveClassesClosure : public CLDClosure { 1882 public: 1883 void do_cld(ClassLoaderData* cld) { 1884 if (cld->is_system_class_loader_data() || cld->is_platform_class_loader_data()) { 1885 cld->dictionary()->remove_classes_in_error_state(); 1886 } 1887 } 1888 }; 1889 1890 void SystemDictionary::remove_classes_in_error_state() { 1891 ClassLoaderData::the_null_class_loader_data()->dictionary()->remove_classes_in_error_state(); 1892 RemoveClassesClosure rcc; 1893 ClassLoaderDataGraph::cld_do(&rcc); 1894 } 1895 1896 // ---------------------------------------------------------------------------- 1897 // Initialization 1898 1899 void SystemDictionary::initialize(TRAPS) { 1900 // Allocate arrays 1901 _placeholders = new PlaceholderTable(_placeholder_table_size); 1902 _number_of_modifications = 0; 1903 _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); 1904 _resolution_errors = new ResolutionErrorTable(_resolution_error_size); 1905 _invoke_method_table = new SymbolPropertyTable(_invoke_method_size); 1906 _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize); 1907 1908 // Allocate private object used as system class loader lock 1909 _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK); 1910 // Initialize basic classes 1911 initialize_preloaded_classes(CHECK); 1912 } 1913 |