hotspot/src/share/vm/classfile/classLoader.cpp
changeset 38207 2ed792c9481d
parent 37773 e5b3e9732c3c
parent 38192 05ab1ee04bf2
child 38245 c6c2ac29463b
--- a/hotspot/src/share/vm/classfile/classLoader.cpp	Tue May 03 09:09:20 2016 +0100
+++ b/hotspot/src/share/vm/classfile/classLoader.cpp	Fri May 06 06:12:56 2016 -0700
@@ -539,7 +539,7 @@
 #if INCLUDE_CDS
 void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
   assert(DumpSharedSpaces, "only called at dump time");
-  tty->print_cr("Hint: enable -Xlog:classpath=info to diagnose the failure");
+  tty->print_cr("Hint: enable -Xlog:class+path=info to diagnose the failure");
   vm_exit_during_initialization(error, message);
 }
 #endif
@@ -572,9 +572,9 @@
 }
 
 void ClassLoader::trace_class_path(const char* msg, const char* name) {
-  if (log_is_enabled(Info, classpath)) {
+  if (log_is_enabled(Info, class, path)) {
     ResourceMark rm;
-    outputStream* out = Log(classpath)::info_stream();
+    outputStream* out = Log(class, path)::info_stream();
     if (msg) {
       out->print("%s", msg);
     }
@@ -795,12 +795,12 @@
         }
       }
     }
-    log_info(classpath)("opened: %s", path);
-    log_info(classload)("opened: %s", path);
+    log_info(class, path)("opened: %s", path);
+    log_info(class, load)("opened: %s", path);
   } else {
     // Directory
     new_entry = new ClassPathDirEntry(path);
-    log_info(classload)("path: %s", path);
+    log_info(class, load)("path: %s", path);
   }
   return new_entry;
 }
@@ -1046,6 +1046,10 @@
 
 #if INCLUDE_CDS
 void ClassLoader::initialize_module_loader_map(JImageFile* jimage) {
+  if (!DumpSharedSpaces) {
+    return; // only needed for CDS dump time
+  }
+
   ResourceMark rm;
   jlong size;
   JImageLocationRef location = (*JImageFindResource)(jimage, "java.base", get_jimage_version_string(), MODULE_LOADER_MAP, &size);
@@ -1190,6 +1194,7 @@
 #if INCLUDE_CDS
 s2 ClassLoader::module_to_classloader(const char* module_name) {
 
+  assert(DumpSharedSpaces, "dump time only");
   assert(_boot_modules_array != NULL, "_boot_modules_array is NULL");
   assert(_platform_modules_array != NULL, "_platform_modules_array is NULL");
 
@@ -1209,10 +1214,10 @@
 
   return APP_LOADER;
 }
-#endif
 
 s2 ClassLoader::classloader_type(Symbol* class_name, ClassPathEntry* e, int classpath_index, TRAPS) {
-#if INCLUDE_CDS
+  assert(DumpSharedSpaces, "Only used for CDS dump time");
+
   // obtain the classloader type based on the class name.
   // First obtain the package name based on the class name. Then obtain
   // the classloader type based on the package name from the jimage using
@@ -1237,10 +1242,8 @@
     loader_type = ClassLoader::BOOT_LOADER;
   }
   return loader_type;
+}
 #endif
-  return ClassLoader::BOOT_LOADER; // the classloader type is ignored in non-CDS cases
-}
-
 
 // caller needs ResourceMark
 const char* ClassLoader::file_name_for_class_name(const char* class_name,
@@ -1424,8 +1427,7 @@
     return NULL;
   }
 
-  jshort loader_type = classloader_type(name, e, classpath_index, CHECK_NULL);
-  return context.record_result(classpath_index, loader_type, e, result, THREAD);
+  return context.record_result(name, e, classpath_index, result, THREAD);
 }
 
 // Initialize the class loader's access to methods in libzip.  Parse and
@@ -1840,7 +1842,7 @@
               }
               if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
                 // Clobber the first compile and force second tier compilation
-                nmethod* nm = m->code();
+                CompiledMethod* nm = m->code();
                 if (nm != NULL && !m->is_method_handle_intrinsic()) {
                   // Throw out the code so that the code cache doesn't fill up
                   nm->make_not_entrant();
@@ -1859,7 +1861,7 @@
               tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
             }
 
-            nmethod* nm = m->code();
+            CompiledMethod* nm = m->code();
             if (nm != NULL && !m->is_method_handle_intrinsic()) {
               // Throw out the code so that the code cache doesn't fill up
               nm->make_not_entrant();