< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page

        

*** 986,1002 **** } enum { NESTMATE = java_lang_invoke_MemberName::MN_NESTMATE_CLASS, HIDDEN_CLASS = java_lang_invoke_MemberName::MN_HIDDEN_CLASS, ! WEAK_CLASS = java_lang_invoke_MemberName::MN_WEAK_CLASS, ACCESS_VM_ANNOTATIONS = java_lang_invoke_MemberName::MN_ACCESS_VM_ANNOTATIONS }; /* * Define a class with the specified flags that indicates if it's a nestmate, ! * hidden, or weakly referenced from class loader. */ static jclass jvm_lookup_define_class(JNIEnv *env, jclass lookup, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, jboolean init, int flags, jobject classData, TRAPS) { assert(THREAD->is_Java_thread(), "must be a JavaThread"); --- 986,1002 ---- } enum { NESTMATE = java_lang_invoke_MemberName::MN_NESTMATE_CLASS, HIDDEN_CLASS = java_lang_invoke_MemberName::MN_HIDDEN_CLASS, ! STRONG_LOADER_LINK = java_lang_invoke_MemberName::MN_STRONG_LOADER_LINK, ACCESS_VM_ANNOTATIONS = java_lang_invoke_MemberName::MN_ACCESS_VM_ANNOTATIONS }; /* * Define a class with the specified flags that indicates if it's a nestmate, ! * hidden, or strongly referenced from class loader. */ static jclass jvm_lookup_define_class(JNIEnv *env, jclass lookup, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, jboolean init, int flags, jobject classData, TRAPS) { assert(THREAD->is_Java_thread(), "must be a JavaThread");
*** 1010,1020 **** } assert(lookup_k->is_instance_klass(), "Lookup class must be an instance klass"); jboolean is_nestmate = (flags & NESTMATE) == NESTMATE; jboolean is_hidden = (flags & HIDDEN_CLASS) == HIDDEN_CLASS; ! jboolean is_weak = (flags & WEAK_CLASS) == WEAK_CLASS; jboolean vm_annotations = (flags & ACCESS_VM_ANNOTATIONS) == ACCESS_VM_ANNOTATIONS; InstanceKlass* host_class = NULL; if (is_nestmate) { host_class = InstanceKlass::cast(lookup_k)->nest_host(CHECK_NULL); --- 1010,1020 ---- } assert(lookup_k->is_instance_klass(), "Lookup class must be an instance klass"); jboolean is_nestmate = (flags & NESTMATE) == NESTMATE; jboolean is_hidden = (flags & HIDDEN_CLASS) == HIDDEN_CLASS; ! jboolean is_strong = (flags & STRONG_LOADER_LINK) == STRONG_LOADER_LINK; jboolean vm_annotations = (flags & ACCESS_VM_ANNOTATIONS) == ACCESS_VM_ANNOTATIONS; InstanceKlass* host_class = NULL; if (is_nestmate) { host_class = InstanceKlass::cast(lookup_k)->nest_host(CHECK_NULL);
*** 1024,1034 **** log_info(class, nestmates)("LookupDefineClass: %s - %s%s, %s, %s, %s", name, is_nestmate ? "with dynamic nest-host " : "non-nestmate", is_nestmate ? host_class->external_name() : "", is_hidden ? "hidden" : "not hidden", ! is_weak ? "weak" : "strong", vm_annotations ? "with vm annotations" : "without vm annotation"); } if (!is_hidden) { // classData is only applicable for hidden classes --- 1024,1034 ---- log_info(class, nestmates)("LookupDefineClass: %s - %s%s, %s, %s, %s", name, is_nestmate ? "with dynamic nest-host " : "non-nestmate", is_nestmate ? host_class->external_name() : "", is_hidden ? "hidden" : "not hidden", ! is_strong ? "strong" : "weak", vm_annotations ? "with vm annotations" : "without vm annotation"); } if (!is_hidden) { // classData is only applicable for hidden classes
*** 1036,1054 **** THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "classData is only applicable for hidden classes"); } if (is_nestmate) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "dynamic nestmate is only applicable for hidden classes"); } ! if (is_weak) { ! THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "weak class is only applicable for hidden classes"); } if (vm_annotations) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "vm annotations only allowed for hidden classes"); } ! if (flags) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), ! err_msg("flag 0x%x can only be set for hidden classes", flags)); } } // Since exceptions can be thrown, class initialization can take place --- 1036,1054 ---- THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "classData is only applicable for hidden classes"); } if (is_nestmate) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "dynamic nestmate is only applicable for hidden classes"); } ! if (!is_strong) { ! THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "an ordinary class must be strongly referenced by its defining loader"); } if (vm_annotations) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "vm annotations only allowed for hidden classes"); } ! if (flags != STRONG_LOADER_LINK) { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), ! err_msg("invalid flag 0x%x", flags)); } } // Since exceptions can be thrown, class initialization can take place
*** 1091,1101 **** NULL, // unsafe_anonymous_host NULL, // cp_patches host_class, classData_h, is_hidden, ! is_weak, vm_annotations); defined_k = SystemDictionary::parse_stream(class_name, class_loader, &st, cl_info, --- 1091,1101 ---- NULL, // unsafe_anonymous_host NULL, // cp_patches host_class, classData_h, is_hidden, ! !is_strong, vm_annotations); defined_k = SystemDictionary::parse_stream(class_name, class_loader, &st, cl_info,
< prev index next >