8205327: Clean up #if INCLUDE_CDS in classLoaderExt.cpp and classLoaderExt.hpp
authorjiangli
Mon, 29 Oct 2018 14:00:48 -0400
changeset 52315 50426919edbb
parent 52314 e53af5fa0dae
child 52316 3152b928769d
8205327: Clean up #if INCLUDE_CDS in classLoaderExt.cpp and classLoaderExt.hpp Summary: Clean up #if INCLUDE_CDS in classLoaderExt.* files. Reviewed-by: dholmes
src/hotspot/share/classfile/classLoaderExt.cpp
src/hotspot/share/classfile/classLoaderExt.hpp
--- a/src/hotspot/share/classfile/classLoaderExt.cpp	Thu Oct 25 11:23:43 2018 -0700
+++ b/src/hotspot/share/classfile/classLoaderExt.cpp	Mon Oct 29 14:00:48 2018 -0400
@@ -55,12 +55,10 @@
 bool ClassLoaderExt::_has_platform_classes = false;
 
 void ClassLoaderExt::append_boot_classpath(ClassPathEntry* new_entry) {
-#if INCLUDE_CDS
   if (UseSharedSpaces) {
     warning("Sharing is only supported for boot loader classes because bootstrap classpath has been appended");
     FileMapInfo::current_info()->header()->set_has_platform_or_app_classes(false);
   }
-#endif
   ClassLoader::add_to_boot_append_entries(new_entry);
 }
 
--- a/src/hotspot/share/classfile/classLoaderExt.hpp	Thu Oct 25 11:23:43 2018 -0700
+++ b/src/hotspot/share/classfile/classLoaderExt.hpp	Mon Oct 29 14:00:48 2018 -0400
@@ -33,12 +33,17 @@
 
 class ClassLoaderExt: public ClassLoader { // AllStatic
 public:
+  static bool should_verify(int classpath_index) {
+    CDS_ONLY(return (classpath_index >= _app_class_paths_start_index);)
+    NOT_CDS(return false;)
+  }
+
+#if INCLUDE_CDS
+private:
   enum SomeConstants {
     max_classpath_index = 0x7fff
   };
 
-private:
-#if INCLUDE_CDS
   static char* get_class_path_attr(const char* jar_path, char* manifest, jint manifest_size);
   static void setup_app_search_path(); // Only when -Xshare:dump
   static void process_module_table(ModuleEntryTable* met, TRAPS);
@@ -54,27 +59,19 @@
 
   static bool _has_app_classes;
   static bool _has_platform_classes;
-#endif
 
-public:
-  CDS_ONLY(static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates);)
-
-  static bool should_verify(int classpath_index) {
-    CDS_ONLY(return (classpath_index >= _app_class_paths_start_index);)
-    NOT_CDS(return false;)
-  }
-  // Called by JVMTI code to add boot classpath
-  static void append_boot_classpath(ClassPathEntry* new_entry);
-
-  static void setup_search_paths() NOT_CDS_RETURN;
-  static void setup_module_paths(TRAPS) NOT_CDS_RETURN;
-
-#if INCLUDE_CDS
-private:
   static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, bool clean_text, TRAPS);
   static ClassPathEntry* find_classpath_entry_from_cache(const char* path, TRAPS);
 
 public:
+  static void process_jar_manifest(ClassPathEntry* entry, bool check_for_duplicates);
+
+  // Called by JVMTI code to add boot classpath
+  static void append_boot_classpath(ClassPathEntry* new_entry);
+
+  static void setup_search_paths();
+  static void setup_module_paths(TRAPS);
+
   static char* read_manifest(ClassPathEntry* entry, jint *manifest_size, TRAPS) {
     // Remove all the new-line continuations (which wrap long lines at 72 characters, see
     // http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html#JAR%20Manifest), so