< prev index next >
src/hotspot/share/classfile/systemDictionaryShared.cpp
Print this page
*** 34,43 ****
--- 34,44 ----
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/systemDictionaryShared.hpp"
#include "classfile/verificationType.hpp"
#include "classfile/vmSymbols.hpp"
+ #include "jfr/jfrEvents.hpp"
#include "logging/log.hpp"
#include "memory/allocation.hpp"
#include "memory/archiveUtils.hpp"
#include "memory/dynamicArchive.hpp"
#include "memory/filemap.hpp"
*** 1665,1675 ****
assert(!DumpSharedSpaces && UseSharedSpaces, "called at run time with CDS enabled only");
RunTimeSharedClassInfo* record = RunTimeSharedClassInfo::get_for(lambda_ik);
return record->nest_host();
}
! InstanceKlass* SystemDictionaryShared::load_shared_lambda_proxy_class(InstanceKlass* lambda_ik,
InstanceKlass* caller_ik,
bool initialize, TRAPS) {
Handle class_loader(THREAD, caller_ik->class_loader());
Handle protection_domain;
PackageEntry* pkg_entry = get_package_entry_from_class_name(class_loader, caller_ik->name());
--- 1666,1676 ----
assert(!DumpSharedSpaces && UseSharedSpaces, "called at run time with CDS enabled only");
RunTimeSharedClassInfo* record = RunTimeSharedClassInfo::get_for(lambda_ik);
return record->nest_host();
}
! InstanceKlass* SystemDictionaryShared::prepare_shared_lambda_proxy_class(InstanceKlass* lambda_ik,
InstanceKlass* caller_ik,
bool initialize, TRAPS) {
Handle class_loader(THREAD, caller_ik->class_loader());
Handle protection_domain;
PackageEntry* pkg_entry = get_package_entry_from_class_name(class_loader, caller_ik->name());
*** 1679,1697 ****
InstanceKlass* shared_nest_host = get_shared_nest_host(lambda_ik);
assert(shared_nest_host != NULL, "unexpected NULL _nest_host");
InstanceKlass* loaded_lambda =
! SystemDictionary::load_shared_lambda_proxy_class(lambda_ik, class_loader, protection_domain, pkg_entry, initialize, CHECK_NULL);
! InstanceKlass* nest_host = caller_ik->nest_host(THREAD);
! // The following ensures that the caller's nest host is the same as the lambda proxy's
// nest host recorded at dump time.
! assert(nest_host->has_nest_member(caller_ik, THREAD) ||
! nest_host == caller_ik, "caller_ik failed nest member check");
assert(nest_host == shared_nest_host, "mismatched nest host");
return loaded_lambda;
}
static char get_loader_type_by(oop loader) {
assert(SystemDictionary::is_builtin_class_loader(loader), "Must be built-in loader");
--- 1680,1719 ----
InstanceKlass* shared_nest_host = get_shared_nest_host(lambda_ik);
assert(shared_nest_host != NULL, "unexpected NULL _nest_host");
InstanceKlass* loaded_lambda =
! SystemDictionary::load_shared_lambda_proxy_class(lambda_ik, class_loader, protection_domain, pkg_entry, CHECK_NULL);
! // Ensures the nest host is the same as the lambda proxy's
// nest host recorded at dump time.
! InstanceKlass* nest_host = caller_ik->nest_host(THREAD);
assert(nest_host == shared_nest_host, "mismatched nest host");
+ EventClassLoad class_load_start_event;
+ {
+ MutexLocker mu_r(THREAD, Compile_lock);
+
+ // Add to class hierarchy, initialize vtables, and do possible
+ // deoptimizations.
+ SystemDictionary::add_to_hierarchy(loaded_lambda, CHECK_NULL); // No exception, but can block
+ // But, do not add to dictionary.
+ }
+ loaded_lambda->link_class(CHECK_NULL);
+ // notify jvmti
+ if (JvmtiExport::should_post_class_load()) {
+ assert(THREAD->is_Java_thread(), "thread->is_Java_thread()");
+ JvmtiExport::post_class_load((JavaThread *) THREAD, loaded_lambda);
+ }
+ if (class_load_start_event.should_commit()) {
+ SystemDictionary::post_class_load_event(&class_load_start_event, loaded_lambda, ClassLoaderData::class_loader_data(class_loader()));
+ }
+
+ if (initialize) {
+ loaded_lambda->initialize(CHECK_NULL);
+ }
+
return loaded_lambda;
}
static char get_loader_type_by(oop loader) {
assert(SystemDictionary::is_builtin_class_loader(loader), "Must be built-in loader");
< prev index next >