< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page




1917   // Walk methods in loaded classes
1918   MutexLocker ml(ClassLoaderDataGraph_lock);
1919   ClassLoaderDataGraph::methods_do(f);
1920   // Walk method handle intrinsics
1921   invoke_method_table()->methods_do(f);
1922 }
1923 
1924 class RemoveClassesClosure : public CLDClosure {
1925   public:
1926     void do_cld(ClassLoaderData* cld) {
1927       if (cld->is_system_class_loader_data() || cld->is_platform_class_loader_data()) {
1928         cld->dictionary()->remove_classes_in_error_state();
1929       }
1930     }
1931 };
1932 
1933 void SystemDictionary::remove_classes_in_error_state() {
1934   ClassLoaderData::the_null_class_loader_data()->dictionary()->remove_classes_in_error_state();
1935   RemoveClassesClosure rcc;
1936   MutexLocker ml(ClassLoaderDataGraph_lock);
1937   ClassLoaderDataGraph::cld_do(&rcc);
1938 }
1939 
1940 // ----------------------------------------------------------------------------
1941 // Initialization
1942 
1943 void SystemDictionary::initialize(TRAPS) {
1944   // Allocate arrays
1945   _placeholders        = new PlaceholderTable(_placeholder_table_size);
1946   _number_of_modifications = 0;
1947   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
1948   _resolution_errors   = new ResolutionErrorTable(_resolution_error_size);
1949   _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
1950   _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
1951 
1952   // Allocate private object used as system class loader lock
1953   _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
1954   // Initialize basic classes
1955   resolve_well_known_classes(CHECK);
1956 }
1957 


3059             } else {
3060               log_trace(cds)("Moved to boot dictionary: %s", name->as_C_string());
3061               curr_dictionary->unlink_entry(p);
3062               p->set_pd_set(NULL); // pd_set is runtime only information and will be reconstructed.
3063               _master_dictionary->add_entry(d_index, p);
3064             }
3065             p = next;
3066           }
3067           *curr_dictionary->bucket_addr(i) = NULL;
3068         }
3069       }
3070     }
3071 };
3072 
3073 // Combining platform and system loader dictionaries into boot loader dictionary.
3074 // During run time, we only have one shared dictionary.
3075 void SystemDictionary::combine_shared_dictionaries() {
3076   assert(DumpSharedSpaces, "dump time only");
3077   Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary();
3078   CombineDictionariesClosure cdc(master_dictionary);
3079   ClassLoaderDataGraph::cld_do(&cdc);
3080 
3081   // These tables are no longer valid or necessary. Keeping them around will
3082   // cause SystemDictionary::verify() to fail. Let's empty them.
3083   _placeholders        = new PlaceholderTable(_placeholder_table_size);
3084   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
3085 
3086   NOT_PRODUCT(SystemDictionary::verify());
3087 }
3088 
3089 void SystemDictionary::initialize_oop_storage() {
3090   _vm_weak_oop_storage =
3091     new OopStorage("VM Weak Oop Handles",
3092                    VMWeakAlloc_lock,
3093                    VMWeakActive_lock);
3094 }
3095 
3096 OopStorage* SystemDictionary::vm_weak_oop_storage() {
3097   assert(_vm_weak_oop_storage != NULL, "Uninitialized");
3098   return _vm_weak_oop_storage;
3099 }


1917   // Walk methods in loaded classes
1918   MutexLocker ml(ClassLoaderDataGraph_lock);
1919   ClassLoaderDataGraph::methods_do(f);
1920   // Walk method handle intrinsics
1921   invoke_method_table()->methods_do(f);
1922 }
1923 
1924 class RemoveClassesClosure : public CLDClosure {
1925   public:
1926     void do_cld(ClassLoaderData* cld) {
1927       if (cld->is_system_class_loader_data() || cld->is_platform_class_loader_data()) {
1928         cld->dictionary()->remove_classes_in_error_state();
1929       }
1930     }
1931 };
1932 
1933 void SystemDictionary::remove_classes_in_error_state() {
1934   ClassLoaderData::the_null_class_loader_data()->dictionary()->remove_classes_in_error_state();
1935   RemoveClassesClosure rcc;
1936   MutexLocker ml(ClassLoaderDataGraph_lock);
1937   ClassLoaderDataGraph::loaded_cld_do(&rcc);
1938 }
1939 
1940 // ----------------------------------------------------------------------------
1941 // Initialization
1942 
1943 void SystemDictionary::initialize(TRAPS) {
1944   // Allocate arrays
1945   _placeholders        = new PlaceholderTable(_placeholder_table_size);
1946   _number_of_modifications = 0;
1947   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
1948   _resolution_errors   = new ResolutionErrorTable(_resolution_error_size);
1949   _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
1950   _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
1951 
1952   // Allocate private object used as system class loader lock
1953   _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
1954   // Initialize basic classes
1955   resolve_well_known_classes(CHECK);
1956 }
1957 


3059             } else {
3060               log_trace(cds)("Moved to boot dictionary: %s", name->as_C_string());
3061               curr_dictionary->unlink_entry(p);
3062               p->set_pd_set(NULL); // pd_set is runtime only information and will be reconstructed.
3063               _master_dictionary->add_entry(d_index, p);
3064             }
3065             p = next;
3066           }
3067           *curr_dictionary->bucket_addr(i) = NULL;
3068         }
3069       }
3070     }
3071 };
3072 
3073 // Combining platform and system loader dictionaries into boot loader dictionary.
3074 // During run time, we only have one shared dictionary.
3075 void SystemDictionary::combine_shared_dictionaries() {
3076   assert(DumpSharedSpaces, "dump time only");
3077   Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary();
3078   CombineDictionariesClosure cdc(master_dictionary);
3079   ClassLoaderDataGraph::loaded_cld_do(&cdc);
3080 
3081   // These tables are no longer valid or necessary. Keeping them around will
3082   // cause SystemDictionary::verify() to fail. Let's empty them.
3083   _placeholders        = new PlaceholderTable(_placeholder_table_size);
3084   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
3085 
3086   NOT_PRODUCT(SystemDictionary::verify());
3087 }
3088 
3089 void SystemDictionary::initialize_oop_storage() {
3090   _vm_weak_oop_storage =
3091     new OopStorage("VM Weak Oop Handles",
3092                    VMWeakAlloc_lock,
3093                    VMWeakActive_lock);
3094 }
3095 
3096 OopStorage* SystemDictionary::vm_weak_oop_storage() {
3097   assert(_vm_weak_oop_storage != NULL, "Uninitialized");
3098   return _vm_weak_oop_storage;
3099 }
< prev index next >