8146551: The output from classresolve tag has been shortened and moved to debug level.
authormockner
Thu, 10 Mar 2016 15:52:56 -0500
changeset 37078 dc9ee85e80d3
parent 37063 c9d5a3727011
child 37079 a92fc7ba87a2
8146551: The output from classresolve tag has been shortened and moved to debug level. Summary: The output from classresolve tag has been shortened and moved to debug level. Reviewed-by: coleenp, rprotacio
hotspot/src/share/vm/classfile/classFileParser.cpp
hotspot/src/share/vm/classfile/verificationType.cpp
hotspot/src/share/vm/classfile/verifier.cpp
hotspot/src/share/vm/oops/constantPool.cpp
hotspot/src/share/vm/prims/jni.cpp
hotspot/src/share/vm/prims/jvm.cpp
hotspot/src/share/vm/runtime/arguments.cpp
hotspot/src/share/vm/runtime/reflection.cpp
hotspot/test/runtime/logging/ClassResolutionTest.java
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -5358,12 +5358,12 @@
       ik->print_loading_log(LogLevel::Debug, _loader_data, _stream);
     }
 
-    if (log_is_enabled(Info, classresolve))  {
+    if (log_is_enabled(Debug, classresolve))  {
       ResourceMark rm;
       // print out the superclass.
       const char * from = ik->external_name();
       if (ik->java_super() != NULL) {
-        log_info(classresolve)("%s %s (super)",
+        log_debug(classresolve)("%s %s (super)",
                    from,
                    ik->java_super()->external_name());
       }
@@ -5374,7 +5374,7 @@
         for (int i = 0; i < length; i++) {
           const Klass* const k = local_interfaces->at(i);
           const char * to = k->external_name();
-          log_info(classresolve)("%s %s (interface)", from, to);
+          log_debug(classresolve)("%s %s (interface)", from, to);
         }
       }
     }
--- a/hotspot/src/share/vm/classfile/verificationType.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/classfile/verificationType.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -61,7 +61,7 @@
     Klass* obj = SystemDictionary::resolve_or_fail(
         name(), Handle(THREAD, klass->class_loader()),
         Handle(THREAD, klass->protection_domain()), true, CHECK_false);
-    if (log_is_enabled(Info, classresolve)) {
+    if (log_is_enabled(Debug, classresolve)) {
       Verifier::trace_class_resolution(obj, klass());
     }
 
@@ -80,7 +80,7 @@
       Klass* from_class = SystemDictionary::resolve_or_fail(
           from.name(), Handle(THREAD, klass->class_loader()),
           Handle(THREAD, klass->protection_domain()), true, CHECK_false);
-      if (log_is_enabled(Info, classresolve)) {
+      if (log_is_enabled(Debug, classresolve)) {
         Verifier::trace_class_resolution(from_class, klass());
       }
       return InstanceKlass::cast(from_class)->is_subclass_of(this_class());
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -107,9 +107,9 @@
   const char* resolve = resolve_class->external_name();
   // print in a single call to reduce interleaving between threads
   if (source_file != NULL) {
-    log_info(classresolve)("%s %s %s (verification)", verify, resolve, source_file);
+    log_debug(classresolve)("%s %s %s (verification)", verify, resolve, source_file);
   } else {
-    log_info(classresolve)("%s %s (verification)", verify, resolve);
+    log_debug(classresolve)("%s %s (verification)", verify, resolve);
   }
 }
 
@@ -205,7 +205,7 @@
     ResourceMark rm(THREAD);
     instanceKlassHandle kls =
       SystemDictionary::resolve_or_fail(exception_name, true, CHECK_false);
-    if (log_is_enabled(Info, classresolve)) {
+    if (log_is_enabled(Debug, classresolve)) {
       Verifier::trace_class_resolution(kls(), klass());
     }
 
@@ -1994,7 +1994,7 @@
     name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
     true, THREAD);
 
-  if (log_is_enabled(Info, classresolve)) {
+  if (log_is_enabled(Debug, classresolve)) {
     instanceKlassHandle cur_class = current_class();
     Verifier::trace_class_resolution(kls, cur_class());
   }
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -208,11 +208,11 @@
   if (k() != this_cp->pool_holder()) {
     // only print something if the classes are different
     if (source_file != NULL) {
-      log_info(classresolve)("%s %s %s:%d",
+      log_debug(classresolve)("%s %s %s:%d",
                  this_cp->pool_holder()->external_name(),
                  k->external_name(), source_file, line_number);
     } else {
-      log_info(classresolve)("%s %s",
+      log_debug(classresolve)("%s %s",
                  this_cp->pool_holder()->external_name(),
                  k->external_name());
     }
@@ -281,15 +281,10 @@
   ClassLoaderData* this_key = this_cp->pool_holder()->class_loader_data();
   this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM
 
-  if (log_is_enabled(Info, classresolve) && !k->is_array_klass()) {
-    // skip resolving the constant pool so that this code gets
-    // called the next time some bytecodes refer to this class.
-    trace_class_resolution(this_cp, k);
-    return k();
-  } else {
-    this_cp->klass_at_put(which, k());
-  }
+  // logging for classresolve tag.
+  trace_class_resolution(this_cp, k);
 
+  this_cp->klass_at_put(which, k());
   entry = this_cp->resolved_klass_at(which);
   assert(entry.is_resolved() && entry.get_klass()->is_klass(), "must be resolved at this point");
   return entry.get_klass();
--- a/hotspot/src/share/vm/prims/jni.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/prims/jni.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -347,7 +347,7 @@
                                                    &st,
                                                    CHECK_NULL);
 
-  if (log_is_enabled(Info, classresolve) && k != NULL) {
+  if (log_is_enabled(Debug, classresolve) && k != NULL) {
     trace_class_resolution(k);
   }
 
@@ -417,7 +417,7 @@
   result = find_class_from_class_loader(env, sym, true, loader,
                                         protection_domain, true, thread);
 
-  if (log_is_enabled(Info, classresolve) && result != NULL) {
+  if (log_is_enabled(Debug, classresolve) && result != NULL) {
     trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
   }
 
@@ -3269,7 +3269,7 @@
   TempNewSymbol sym = SymbolTable::new_symbol(name, CHECK_NULL);
   jclass result =  find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL);
 
-  if (log_is_enabled(Info, classresolve) && result != NULL) {
+  if (log_is_enabled(Debug, classresolve) && result != NULL) {
     trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
   }
   return result;
--- a/hotspot/src/share/vm/prims/jvm.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -206,9 +206,9 @@
       const char * to = to_class->external_name();
       // print in a single call to reduce interleaving between threads
       if (source_file != NULL) {
-        log_info(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace);
+        log_debug(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace);
       } else {
-        log_info(classresolve)("%s %s (%s)", from, to, trace);
+        log_debug(classresolve)("%s %s (%s)", from, to, trace);
       }
     }
   }
@@ -835,7 +835,7 @@
     return NULL;
   }
 
-  if (log_is_enabled(Info, classresolve)) {
+  if (log_is_enabled(Debug, classresolve)) {
     trace_class_resolution(k);
   }
   return (jclass) JNIHandles::make_local(env, k->java_mirror());
@@ -872,7 +872,7 @@
   jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
                                                h_prot, false, THREAD);
 
-  if (log_is_enabled(Info, classresolve) && result != NULL) {
+  if (log_is_enabled(Debug, classresolve) && result != NULL) {
     trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result)));
   }
   return result;
@@ -902,7 +902,7 @@
   jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
                                                h_prot, true, thread);
 
-  if (log_is_enabled(Info, classresolve) && result != NULL) {
+  if (log_is_enabled(Debug, classresolve) && result != NULL) {
     // this function is generally only used for class loading during verification.
     ResourceMark rm;
     oop from_mirror = JNIHandles::resolve_non_null(from);
@@ -912,7 +912,7 @@
     oop mirror = JNIHandles::resolve_non_null(result);
     Klass* to_class = java_lang_Class::as_Klass(mirror);
     const char * to = to_class->external_name();
-    log_info(classresolve)("%s %s (verification)", from_name, to);
+    log_debug(classresolve)("%s %s (verification)", from_name, to);
   }
 
   return result;
@@ -980,7 +980,7 @@
                                                    &st,
                                                    CHECK_NULL);
 
-  if (log_is_enabled(Info, classresolve) && k != NULL) {
+  if (log_is_enabled(Debug, classresolve) && k != NULL) {
     trace_class_resolution(k);
   }
 
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -408,7 +408,7 @@
   { "TraceBiasedLocking",        LogLevel::Info,  true,  LogTag::_biasedlocking },
   { "TraceClassLoading",         LogLevel::Info,  true,  LogTag::_classload },
   { "TraceClassPaths",           LogLevel::Info,  true,  LogTag::_classpath },
-  { "TraceClassResolution",      LogLevel::Info,  true,  LogTag::_classresolve },
+  { "TraceClassResolution",      LogLevel::Debug, true,  LogTag::_classresolve },
   { "TraceClassUnloading",       LogLevel::Info,  true,  LogTag::_classunload },
   { "TraceExceptions",           LogLevel::Info,  true,  LogTag::_exceptions },
   { "TraceMonitorInflation",     LogLevel::Debug, true,  LogTag::_monitorinflation },
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Thu Mar 10 15:52:56 2016 -0500
@@ -74,9 +74,9 @@
     const char * to = to_class->external_name();
     // print in a single call to reduce interleaving between threads
     if (source_file != NULL) {
-      log_info(classresolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number);
+      log_debug(classresolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number);
     } else {
-      log_info(classresolve)("%s %s (reflection)", from, to);
+      log_debug(classresolve)("%s %s (reflection)", from, to);
     }
   }
 }
@@ -599,7 +599,7 @@
                                                        Handle(THREAD, protection_domain),
                                                        true,
                                                        CHECK_NULL);
-    if (log_is_enabled(Info, classresolve)) {
+    if (log_is_enabled(Debug, classresolve)) {
       trace_class_resolution(k);
     }
     return k->java_mirror();
@@ -654,7 +654,7 @@
                                       Handle(THREAD, k->protection_domain()),
                                       true, CHECK_(Handle()));
 
-  if (log_is_enabled(Info, classresolve)) {
+  if (log_is_enabled(Debug, classresolve)) {
     trace_class_resolution(result);
   }
 
--- a/hotspot/test/runtime/logging/ClassResolutionTest.java	Thu Mar 10 14:15:15 2016 +0100
+++ b/hotspot/test/runtime/logging/ClassResolutionTest.java	Thu Mar 10 15:52:56 2016 -0500
@@ -58,13 +58,13 @@
     public static void main(String... args) throws Exception {
 
         // (1) classresolve should turn on.
-        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=info",
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
                                                                   ClassResolutionTestMain.class.getName());
         OutputAnalyzer o = new OutputAnalyzer(pb.start());
         o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
 
         // (2) classresolve should turn off.
-        pb = ProcessTools.createJavaProcessBuilder("-Xlog",
+        pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
                                                    "-Xlog:classresolve=off",
                                                    ClassResolutionTestMain.class.getName());
         o = new OutputAnalyzer(pb.start());
@@ -77,12 +77,12 @@
         o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1");
 
         // (4) TraceClassResolution should turn off.
-        pb = ProcessTools.createJavaProcessBuilder("-Xlog",
+        pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug",
                                                    "-XX:-TraceClassResolution",
                                                    ClassResolutionTestMain.class.getName());
         o = new OutputAnalyzer(pb.start());
         o.shouldNotContain("[classresolve]");
 
+    };
 
-    };
 }