1054 InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name, |
1054 InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name, |
1055 Handle class_loader, |
1055 Handle class_loader, |
1056 Handle protection_domain, |
1056 Handle protection_domain, |
1057 ClassFileStream* st, |
1057 ClassFileStream* st, |
1058 TRAPS) { |
1058 TRAPS) { |
1059 #if INCLUDE_CDS |
|
1060 ResourceMark rm(THREAD); |
|
1061 if (DumpSharedSpaces && !class_loader.is_null() && |
|
1062 !UseAppCDS && strcmp(class_name->as_C_string(), "Unnamed") != 0) { |
|
1063 // If AppCDS is not enabled, don't define the class at dump time (except for the "Unnamed" |
|
1064 // class, which is used by MethodHandles). |
|
1065 THROW_MSG_NULL(vmSymbols::java_lang_ClassNotFoundException(), class_name->as_C_string()); |
|
1066 } |
|
1067 #endif |
|
1068 |
1059 |
1069 HandleMark hm(THREAD); |
1060 HandleMark hm(THREAD); |
1070 |
1061 |
1071 // Classloaders that support parallelism, e.g. bootstrap classloader, |
1062 // Classloaders that support parallelism, e.g. bootstrap classloader, |
1072 // do not acquire lock here |
1063 // do not acquire lock here |
3077 } |
3068 } |
3078 } |
3069 } |
3079 } |
3070 } |
3080 }; |
3071 }; |
3081 |
3072 |
3082 // Combining platform and system loader dictionaries into boot loader dictionaries. |
3073 // Combining platform and system loader dictionaries into boot loader dictionary. |
3083 // During run time, we only have one shared dictionary. |
3074 // During run time, we only have one shared dictionary. |
3084 void SystemDictionary::combine_shared_dictionaries() { |
3075 void SystemDictionary::combine_shared_dictionaries() { |
3085 assert(DumpSharedSpaces, "dump time only"); |
3076 assert(DumpSharedSpaces, "dump time only"); |
3086 Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary(); |
3077 // If AppCDS isn't enabled, we only dump the classes in the boot loader dictionary |
3087 CombineDictionariesClosure cdc(master_dictionary); |
3078 // into the shared archive. |
3088 ClassLoaderDataGraph::cld_do(&cdc); |
3079 if (UseAppCDS) { |
|
3080 Dictionary* master_dictionary = ClassLoaderData::the_null_class_loader_data()->dictionary(); |
|
3081 CombineDictionariesClosure cdc(master_dictionary); |
|
3082 ClassLoaderDataGraph::cld_do(&cdc); |
|
3083 } |
3089 |
3084 |
3090 // These tables are no longer valid or necessary. Keeping them around will |
3085 // These tables are no longer valid or necessary. Keeping them around will |
3091 // cause SystemDictionary::verify() to fail. Let's empty them. |
3086 // cause SystemDictionary::verify() to fail. Let's empty them. |
3092 _placeholders = new PlaceholderTable(_placeholder_table_size); |
3087 _placeholders = new PlaceholderTable(_placeholder_table_size); |
3093 _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); |
3088 _loader_constraints = new LoaderConstraintTable(_loader_constraint_size); |