1016 ClassFileStream st((u1*)buf, len, source, ClassFileStream::verify);
1017
1018 if (!is_nonfindable) {
1019 k = SystemDictionary::resolve_from_stream(class_name,
1020 class_loader,
1021 protection_domain,
1022 &st,
1023 CHECK_NULL);
1024
1025 if (log_is_enabled(Debug, class, resolve) && k != NULL) {
1026 trace_class_resolution(k);
1027 }
1028 } else { //nonfindable
1029 k = SystemDictionary::parse_stream(class_name,
1030 class_loader,
1031 protection_domain,
1032 &st,
1033 NULL, // unsafe_anonymous_host
1034 NULL, // cp_patches
1035 is_nonfindable,
1036 true, // is_weak - workaround to allow access to VM annotations
1037 CHECK_NULL);
1038 if (k == NULL) {
1039 THROW_MSG_0(vmSymbols::java_lang_Error(), "Failure to define a nonfindable class");
1040 }
1041
1042 // The nonfindable class loader data has been artificially been kept alive to
1043 // this point. The mirror and any instances of this class have to keep
1044 // it alive afterwards.
1045 InstanceKlass::cast(k)->class_loader_data()->dec_keep_alive();
1046 }
1047
1048 // set nest host
1049 if (is_nestmate) {
1050 InstanceKlass* ik = InstanceKlass::cast(k);
1051 ik->set_nest_host((InstanceKlass*)nest_host);
1052 if (log_is_enabled(Debug, class, nestmates)) {
1053 ModuleEntry* module = ik->module();
1054 const char * module_name = module->is_named() ? module->name()->as_C_string() : UNNAMED_MODULE;
1055 log_debug(class, nestmates)("Dynamic nestmate: %s/%s nest_host %s is_nonfindable %s",
1056 module_name, ik->external_name(), nest_host->external_name(),
|
1016 ClassFileStream st((u1*)buf, len, source, ClassFileStream::verify);
1017
1018 if (!is_nonfindable) {
1019 k = SystemDictionary::resolve_from_stream(class_name,
1020 class_loader,
1021 protection_domain,
1022 &st,
1023 CHECK_NULL);
1024
1025 if (log_is_enabled(Debug, class, resolve) && k != NULL) {
1026 trace_class_resolution(k);
1027 }
1028 } else { //nonfindable
1029 k = SystemDictionary::parse_stream(class_name,
1030 class_loader,
1031 protection_domain,
1032 &st,
1033 NULL, // unsafe_anonymous_host
1034 NULL, // cp_patches
1035 is_nonfindable,
1036 is_weak,
1037 vm_annotations,
1038 CHECK_NULL);
1039 if (k == NULL) {
1040 THROW_MSG_0(vmSymbols::java_lang_Error(), "Failure to define a nonfindable class");
1041 }
1042
1043 // The nonfindable class loader data has been artificially been kept alive to
1044 // this point. The mirror and any instances of this class have to keep
1045 // it alive afterwards.
1046 InstanceKlass::cast(k)->class_loader_data()->dec_keep_alive();
1047 }
1048
1049 // set nest host
1050 if (is_nestmate) {
1051 InstanceKlass* ik = InstanceKlass::cast(k);
1052 ik->set_nest_host((InstanceKlass*)nest_host);
1053 if (log_is_enabled(Debug, class, nestmates)) {
1054 ModuleEntry* module = ik->module();
1055 const char * module_name = module->is_named() ? module->name()->as_C_string() : UNNAMED_MODULE;
1056 log_debug(class, nestmates)("Dynamic nestmate: %s/%s nest_host %s is_nonfindable %s",
1057 module_name, ik->external_name(), nest_host->external_name(),
|