/* * Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
void ClassLoaderExt::append_boot_classpath(ClassPathEntry* new_entry) { if (UseSharedSpaces) {
warning("Sharing is only supported for boot loader classes because bootstrap classpath has been appended");
FileMapInfo::current_info()->set_has_platform_or_app_classes(false);
}
ClassLoader::add_to_boot_append_entries(new_entry);
}
if (strcmp(app_class_path, ".") == 0) { // This doesn't make any sense, even for AppCDS, so let's skip it. We // don't want to throw an error here because -cp "." is usually assigned // by the launcher when classpath is not specified.
trace_class_path("app loader class path (skipped)=", app_class_path);
} else {
trace_class_path("app loader class path=", app_class_path);
ClassLoader::setup_app_search_path(current, app_class_path);
}
}
while (line_start < end) { char* line_end = strchr(line_start, '\n'); if (line_end == NULL) { // JAR spec require the manifest file to be terminated by a new line. break;
} if (strncmp(tag, line_start, tag_len) == 0) { if (found != NULL) { // Same behavior as jdk/src/share/classes/java/util/jar/Attributes.java // If duplicated entries are found, the last one is used.
log_warning(cds)("Warning: Duplicate name in Manifest: %s.\n" "Ensure that the manifest does not have duplicate entries, and\n" "that blank lines separate individual sections in both your\n" "manifest and in the META-INF/MANIFEST.MF entry in the jar file:\n%s\n", tag, jar_path);
}
found = line_start + tag_len;
assert(found <= line_end, "sanity");
*line_end = '\0';
}
line_start = line_end + 1;
} return found;
}
if (strstr(manifest, "Extension-List:") != NULL) {
vm_exit_during_cds_dumping(err_msg("-Xshare:dump does not support Extension-List in JAR manifest: %s", entry->name()));
}
// We need to remember where the class comes from during dumping.
oop loader = result->class_loader();
s2 classloader_type = ClassLoader::BOOT_LOADER; if (SystemDictionary::is_system_class_loader(loader)) {
classloader_type = ClassLoader::APP_LOADER;
ClassLoaderExt::set_has_app_classes();
} elseif (SystemDictionary::is_platform_class_loader(loader)) {
classloader_type = ClassLoader::PLATFORM_LOADER;
ClassLoaderExt::set_has_platform_classes();
} if (classpath_index > ClassLoaderExt::max_used_path_index()) {
ClassLoaderExt::set_max_used_path_index(classpath_index);
}
result->set_shared_classpath_index(classpath_index);
result->set_shared_class_loader_type(classloader_type); #if INCLUDE_CDS_JAVA_HEAP if (DumpSharedSpaces && AllowArchivingWithJavaAgent && classloader_type == ClassLoader::BOOT_LOADER &&
classpath_index < 0 && HeapShared::can_write() && redefined) { // During static dump, classes for the built-in loaders are always loaded from // known locations (jimage, classpath or modulepath), so classpath_index should // always be >= 0. // The only exception is when a java agent is used during dump time (for testing // purposes only). If a class is transformed by the agent, the CodeSource of // this class may point to an unknown location. This may break heap object archiving, // which requires all the boot classes to be from known locations. This is an // uncommon scenario (even in test cases). Let's simply disable heap object archiving.
ResourceMark rm;
log_warning(cds)("CDS heap objects cannot be written because class %s maybe modified by ClassFileLoadHook.",
result->external_name());
HeapShared::disable_writing();
} #endif// INCLUDE_CDS_JAVA_HEAP
}
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.