204 if (to_class != caller) { |
204 if (to_class != caller) { |
205 const char * from = caller->external_name(); |
205 const char * from = caller->external_name(); |
206 const char * to = to_class->external_name(); |
206 const char * to = to_class->external_name(); |
207 // print in a single call to reduce interleaving between threads |
207 // print in a single call to reduce interleaving between threads |
208 if (source_file != NULL) { |
208 if (source_file != NULL) { |
209 tty->print("RESOLVE %s %s %s:%d (%s)\n", from, to, source_file, line_number, trace); |
209 log_info(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace); |
210 } else { |
210 } else { |
211 tty->print("RESOLVE %s %s (%s)\n", from, to, trace); |
211 log_info(classresolve)("%s %s (%s)", from, to, trace); |
212 } |
212 } |
213 } |
213 } |
214 } |
214 } |
215 } |
215 } |
216 |
216 |
833 Klass* k = SystemDictionary::resolve_or_null(h_name, CHECK_NULL); |
833 Klass* k = SystemDictionary::resolve_or_null(h_name, CHECK_NULL); |
834 if (k == NULL) { |
834 if (k == NULL) { |
835 return NULL; |
835 return NULL; |
836 } |
836 } |
837 |
837 |
838 if (TraceClassResolution) { |
838 if (log_is_enabled(Info, classresolve)) { |
839 trace_class_resolution(k); |
839 trace_class_resolution(k); |
840 } |
840 } |
841 return (jclass) JNIHandles::make_local(env, k->java_mirror()); |
841 return (jclass) JNIHandles::make_local(env, k->java_mirror()); |
842 JVM_END |
842 JVM_END |
843 |
843 |
870 Handle h_loader(THREAD, loader_oop); |
870 Handle h_loader(THREAD, loader_oop); |
871 Handle h_prot(THREAD, protection_domain); |
871 Handle h_prot(THREAD, protection_domain); |
872 jclass result = find_class_from_class_loader(env, h_name, init, h_loader, |
872 jclass result = find_class_from_class_loader(env, h_name, init, h_loader, |
873 h_prot, false, THREAD); |
873 h_prot, false, THREAD); |
874 |
874 |
875 if (TraceClassResolution && result != NULL) { |
875 if (log_is_enabled(Info, classresolve) && result != NULL) { |
876 trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); |
876 trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); |
877 } |
877 } |
878 return result; |
878 return result; |
879 JVM_END |
879 JVM_END |
880 |
880 |
900 Handle h_loader(THREAD, class_loader); |
900 Handle h_loader(THREAD, class_loader); |
901 Handle h_prot (THREAD, protection_domain); |
901 Handle h_prot (THREAD, protection_domain); |
902 jclass result = find_class_from_class_loader(env, h_name, init, h_loader, |
902 jclass result = find_class_from_class_loader(env, h_name, init, h_loader, |
903 h_prot, true, thread); |
903 h_prot, true, thread); |
904 |
904 |
905 if (TraceClassResolution && result != NULL) { |
905 if (log_is_enabled(Info, classresolve) && result != NULL) { |
906 // this function is generally only used for class loading during verification. |
906 // this function is generally only used for class loading during verification. |
907 ResourceMark rm; |
907 ResourceMark rm; |
908 oop from_mirror = JNIHandles::resolve_non_null(from); |
908 oop from_mirror = JNIHandles::resolve_non_null(from); |
909 Klass* from_class = java_lang_Class::as_Klass(from_mirror); |
909 Klass* from_class = java_lang_Class::as_Klass(from_mirror); |
910 const char * from_name = from_class->external_name(); |
910 const char * from_name = from_class->external_name(); |
911 |
911 |
912 oop mirror = JNIHandles::resolve_non_null(result); |
912 oop mirror = JNIHandles::resolve_non_null(result); |
913 Klass* to_class = java_lang_Class::as_Klass(mirror); |
913 Klass* to_class = java_lang_Class::as_Klass(mirror); |
914 const char * to = to_class->external_name(); |
914 const char * to = to_class->external_name(); |
915 tty->print("RESOLVE %s %s (verification)\n", from_name, to); |
915 log_info(classresolve)("%s %s (verification)", from_name, to); |
916 } |
916 } |
917 |
917 |
918 return result; |
918 return result; |
919 JVM_END |
919 JVM_END |
920 |
920 |