< prev index next > src/hotspot/share/classfile/systemDictionary.cpp
Print this page
#include "classfile/classLoadInfo.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "classfile/klassFactory.hpp"
#include "classfile/loaderConstraints.hpp"
+ #include "classfile/modules.hpp"
#include "classfile/packageEntry.hpp"
#include "classfile/placeholders.hpp"
#include "classfile/resolutionErrors.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/symbolTable.hpp"
ModuleEntry* mod_entry = (pkg_entry == nullptr) ? nullptr : pkg_entry->module();
bool should_be_in_named_module = (mod_entry != nullptr && mod_entry->is_named());
bool was_archived_from_named_module = !cl->has_unnamed_module();
bool visible;
- if (was_archived_from_named_module) {
+ if (mod_entry != nullptr && mod_entry->location() == nullptr && mod_entry->is_named()) {
+ // Archived module for dynamic proxies. It's always visible.
+ assert(Modules::is_dynamic_proxy_module(mod_entry), "must be");
+ visible = true;
+ } else if (was_archived_from_named_module) {
if (should_be_in_named_module) {
// Is the module loaded from the same location as during dump time?
visible = mod_entry->shared_path_index() == scp_index;
if (visible) {
assert(!mod_entry->is_patched(), "cannot load archived classes for patched module");
// For boot loader, ensure that GetSystemPackage knows that a class in this
// package was loaded.
if (loader_data->is_the_null_class_loader_data()) {
s2 path_index = ik->shared_classpath_index();
- ik->set_classpath_index(path_index);
+ if (path_index >= 0) { // FIXME ... for lambda form classes
+ ik->set_classpath_index(path_index);
+
+ if (CDSConfig::is_dumping_final_static_archive()) {
+ AOTClassLocationConfig::dumptime_update_max_used_index(path_index);
+ }
+ }
}
// notify a class loaded from shared object
ClassLoadingService::notify_class_loaded(ik, true /* shared class */);
InstanceKlass* k = nullptr;
#if INCLUDE_CDS
if (CDSConfig::is_using_archive())
{
- PerfTraceTime vmtimer(ClassLoader::perf_shared_classload_time());
+ PerfTraceElapsedTime vmtimer(ClassLoader::perf_shared_classload_time());
InstanceKlass* ik = SystemDictionaryShared::find_builtin_class(class_name);
if (ik != nullptr && ik->is_shared_boot_class() && !ik->shared_loading_failed()) {
SharedClassLoadingMark slm(THREAD, ik);
k = load_shared_class(ik, class_loader, Handle(), nullptr, pkg_entry, CHECK_NULL);
}
}
#endif
if (k == nullptr) {
// Use VM class loader
- PerfTraceTime vmtimer(ClassLoader::perf_sys_classload_time());
+ PerfTraceElapsedTime vmtimer(ClassLoader::perf_sys_classload_time());
k = ClassLoader::load_class(class_name, pkg_entry, search_only_bootloader_append, CHECK_NULL);
}
// find_or_define_instance_class may return a different InstanceKlass
if (k != nullptr) {
< prev index next >