< prev index next >

src/hotspot/share/classfile/sharedPathsMiscInfo.cpp

Print this page




 140         if (!PrintSharedArchiveAndExit) {
 141           return false;
 142         }
 143       } else {
 144         ClassLoader::trace_class_path("ok");
 145       }
 146     } else {
 147       ClassLoader::trace_class_path("skipped check");
 148     }
 149     cur_index++;
 150   }
 151 
 152   return true;
 153 }
 154 
 155 char* skip_first_path_entry(const char* path) {
 156   size_t path_sep_len = strlen(os::path_separator());
 157   char* p = strstr((char*)path, os::path_separator());
 158   if (p != NULL) {
 159     debug_only( {
 160       size_t image_name_len = strlen(MODULES_IMAGE_NAME);
 161       assert(strncmp(p - image_name_len, MODULES_IMAGE_NAME, image_name_len) == 0,


 162              "first entry must be the modules image");
 163     } );
 164     p += path_sep_len;
 165   } else {
 166     debug_only( {
 167       assert(ClassLoader::string_ends_with(path, MODULES_IMAGE_NAME),
 168              "first entry must be the modules image");
 169     } );
 170   }
 171   return p;
 172 }
 173 
 174 bool SharedPathsMiscInfo::check(jint type, const char* path) {
 175   assert(UseSharedSpaces, "runtime only");
 176   switch (type) {
 177   case BOOT_PATH:
 178     {
 179       //
 180       // - Archive contains boot classes only - relaxed boot path check:
 181       //   Extra path elements appended to the boot path at runtime are allowed.
 182       //
 183       // - Archive contains application or platform classes - strict boot path check:
 184       //   Validate the entire runtime boot path, which must be compactible
 185       //   with the dump time boot path. Appending boot path at runtime is not
 186       //   allowed.
 187       //




 140         if (!PrintSharedArchiveAndExit) {
 141           return false;
 142         }
 143       } else {
 144         ClassLoader::trace_class_path("ok");
 145       }
 146     } else {
 147       ClassLoader::trace_class_path("skipped check");
 148     }
 149     cur_index++;
 150   }
 151 
 152   return true;
 153 }
 154 
 155 char* skip_first_path_entry(const char* path) {
 156   size_t path_sep_len = strlen(os::path_separator());
 157   char* p = strstr((char*)path, os::path_separator());
 158   if (p != NULL) {
 159     debug_only( {
 160       const char* image_name = ClassLoader::modules_image_name();
 161       assert(image_name != NULL, "modules image name must not be NULL");
 162       size_t image_name_len = strlen(image_name);
 163       assert(strncmp(p - image_name_len, image_name, image_name_len) == 0,
 164              "first entry must be the modules image");
 165     } );
 166     p += path_sep_len;
 167   } else {
 168     debug_only( {
 169       assert(ClassLoader::is_modules_image(path),
 170              "first entry must be the modules image");
 171     } );
 172   }
 173   return p;
 174 }
 175 
 176 bool SharedPathsMiscInfo::check(jint type, const char* path) {
 177   assert(UseSharedSpaces, "runtime only");
 178   switch (type) {
 179   case BOOT_PATH:
 180     {
 181       //
 182       // - Archive contains boot classes only - relaxed boot path check:
 183       //   Extra path elements appended to the boot path at runtime are allowed.
 184       //
 185       // - Archive contains application or platform classes - strict boot path check:
 186       //   Validate the entire runtime boot path, which must be compactible
 187       //   with the dump time boot path. Appending boot path at runtime is not
 188       //   allowed.
 189       //


< prev index next >