< prev index next >
src/hotspot/share/classfile/classLoader.cpp
Print this page
*** 460,470 ****
return true;
}
#if INCLUDE_CDS
void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
! assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "only called at dump time");
tty->print_cr("Hint: enable -Xlog:class+path=info to diagnose the failure");
vm_exit_during_initialization(error, message);
}
#endif
--- 460,470 ----
return true;
}
#if INCLUDE_CDS
void ClassLoader::exit_with_path_failure(const char* error, const char* message) {
! assert(Arguments::is_dumping_archive(), "only called at dump time");
tty->print_cr("Hint: enable -Xlog:class+path=info to diagnose the failure");
vm_exit_during_initialization(error, message);
}
#endif
*** 530,540 ****
setup_boot_search_path(sys_class_path);
}
#if INCLUDE_CDS
void ClassLoader::setup_app_search_path(const char *class_path) {
! assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "Sanity");
ResourceMark rm;
ClasspathStream cp_stream(class_path);
while (cp_stream.has_next()) {
--- 530,540 ----
setup_boot_search_path(sys_class_path);
}
#if INCLUDE_CDS
void ClassLoader::setup_app_search_path(const char *class_path) {
! assert(Arguments::is_dumping_archive(), "Sanity");
ResourceMark rm;
ClasspathStream cp_stream(class_path);
while (cp_stream.has_next()) {
*** 544,554 ****
}
void ClassLoader::add_to_module_path_entries(const char* path,
ClassPathEntry* entry) {
assert(entry != NULL, "ClassPathEntry should not be NULL");
! assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
// The entry does not exist, add to the list
if (_module_path_entries == NULL) {
assert(_last_module_path_entry == NULL, "Sanity");
_module_path_entries = _last_module_path_entry = entry;
--- 544,554 ----
}
void ClassLoader::add_to_module_path_entries(const char* path,
ClassPathEntry* entry) {
assert(entry != NULL, "ClassPathEntry should not be NULL");
! assert(Arguments::is_dumping_archive(), "dump time only");
// The entry does not exist, add to the list
if (_module_path_entries == NULL) {
assert(_last_module_path_entry == NULL, "Sanity");
_module_path_entries = _last_module_path_entry = entry;
*** 558,568 ****
}
}
// Add a module path to the _module_path_entries list.
void ClassLoader::update_module_path_entry_list(const char *path, TRAPS) {
! assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump time only");
struct stat st;
if (os::stat(path, &st) != 0) {
tty->print_cr("os::stat error %d (%s). CDS dump aborted (path was \"%s\").",
errno, os::errno_name(errno), path);
vm_exit_during_initialization();
--- 558,568 ----
}
}
// Add a module path to the _module_path_entries list.
void ClassLoader::update_module_path_entry_list(const char *path, TRAPS) {
! assert(Arguments::is_dumping_archive(), "dump time only");
struct stat st;
if (os::stat(path, &st) != 0) {
tty->print_cr("os::stat error %d (%s). CDS dump aborted (path was \"%s\").",
errno, os::errno_name(errno), path);
vm_exit_during_initialization();
*** 654,664 ****
ResourceMark rm(THREAD);
ClasspathStream cp_stream(class_path);
bool set_base_piece = true;
#if INCLUDE_CDS
! if (DumpSharedSpaces || DynamicDumpSharedSpaces) {
if (!Arguments::has_jimage()) {
vm_exit_during_initialization("CDS is not supported in exploded JDK build", NULL);
}
}
#endif
--- 654,664 ----
ResourceMark rm(THREAD);
ClasspathStream cp_stream(class_path);
bool set_base_piece = true;
#if INCLUDE_CDS
! if (Arguments::is_dumping_archive()) {
if (!Arguments::has_jimage()) {
vm_exit_during_initialization("CDS is not supported in exploded JDK build", NULL);
}
}
#endif
*** 1358,1368 ****
}
// Record the shared classpath index and loader type for classes loaded
// by the builtin loaders at dump time.
void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) {
! assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "sanity");
assert(stream != NULL, "sanity");
if (ik->is_unsafe_anonymous()) {
// We do not archive unsafe anonymous classes.
return;
--- 1358,1368 ----
}
// Record the shared classpath index and loader type for classes loaded
// by the builtin loaders at dump time.
void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream, TRAPS) {
! assert(Arguments::is_dumping_archive(), "sanity");
assert(stream != NULL, "sanity");
if (ik->is_unsafe_anonymous()) {
// We do not archive unsafe anonymous classes.
return;
*** 1535,1551 ****
setup_bootstrap_search_path();
}
#if INCLUDE_CDS
void ClassLoader::initialize_shared_path() {
! if (DumpSharedSpaces || DynamicDumpSharedSpaces) {
ClassLoaderExt::setup_search_paths();
}
}
void ClassLoader::initialize_module_path(TRAPS) {
! if (DumpSharedSpaces || DynamicDumpSharedSpaces) {
ClassLoaderExt::setup_module_paths(THREAD);
FileMapInfo::allocate_shared_path_table();
}
}
#endif
--- 1535,1551 ----
setup_bootstrap_search_path();
}
#if INCLUDE_CDS
void ClassLoader::initialize_shared_path() {
! if (Arguments::is_dumping_archive()) {
ClassLoaderExt::setup_search_paths();
}
}
void ClassLoader::initialize_module_path(TRAPS) {
! if (Arguments::is_dumping_archive()) {
ClassLoaderExt::setup_module_paths(THREAD);
FileMapInfo::allocate_shared_path_table();
}
}
#endif
< prev index next >