mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
Merge
This commit is contained in:
commit
80a863b62a
2 changed files with 52 additions and 34 deletions
|
@ -1246,6 +1246,9 @@ Klass* SystemDictionary::find_shared_class(Symbol* class_name) {
|
||||||
|
|
||||||
instanceKlassHandle SystemDictionary::load_shared_class(
|
instanceKlassHandle SystemDictionary::load_shared_class(
|
||||||
Symbol* class_name, Handle class_loader, TRAPS) {
|
Symbol* class_name, Handle class_loader, TRAPS) {
|
||||||
|
// Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
|
||||||
|
// is enabled since posting CFLH is not supported when loading shared class.
|
||||||
|
if (!JvmtiExport::should_post_class_file_load_hook()) {
|
||||||
instanceKlassHandle ik (THREAD, find_shared_class(class_name));
|
instanceKlassHandle ik (THREAD, find_shared_class(class_name));
|
||||||
// Make sure we only return the boot class for the NULL classloader.
|
// Make sure we only return the boot class for the NULL classloader.
|
||||||
if (ik.not_null() &&
|
if (ik.not_null() &&
|
||||||
|
@ -1253,6 +1256,7 @@ instanceKlassHandle SystemDictionary::load_shared_class(
|
||||||
Handle protection_domain;
|
Handle protection_domain;
|
||||||
return load_shared_class(ik, class_loader, protection_domain, THREAD);
|
return load_shared_class(ik, class_loader, protection_domain, THREAD);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return instanceKlassHandle();
|
return instanceKlassHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1334,8 +1338,14 @@ bool SystemDictionary::is_shared_class_visible(Symbol* class_name,
|
||||||
instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
|
instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
|
||||||
Handle class_loader,
|
Handle class_loader,
|
||||||
Handle protection_domain, TRAPS) {
|
Handle protection_domain, TRAPS) {
|
||||||
if (ik.not_null()) {
|
|
||||||
instanceKlassHandle nh = instanceKlassHandle(); // null Handle
|
instanceKlassHandle nh = instanceKlassHandle(); // null Handle
|
||||||
|
if (JvmtiExport::should_post_class_file_load_hook()) {
|
||||||
|
// Don't load shared class when JvmtiExport::should_post_class_file_load_hook()
|
||||||
|
// is enabled since posting CFLH is not supported when loading shared class.
|
||||||
|
return nh;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ik.not_null()) {
|
||||||
Symbol* class_name = ik->name();
|
Symbol* class_name = ik->name();
|
||||||
|
|
||||||
bool visible = is_shared_class_visible(
|
bool visible = is_shared_class_visible(
|
||||||
|
|
|
@ -3164,14 +3164,21 @@ void Metaspace::global_initialize() {
|
||||||
#endif // _LP64
|
#endif // _LP64
|
||||||
#endif // INCLUDE_CDS
|
#endif // INCLUDE_CDS
|
||||||
} else {
|
} else {
|
||||||
|
#if INCLUDE_CDS
|
||||||
|
if (UseSharedSpaces) {
|
||||||
// If using shared space, open the file that contains the shared space
|
// If using shared space, open the file that contains the shared space
|
||||||
// and map in the memory before initializing the rest of metaspace (so
|
// and map in the memory before initializing the rest of metaspace (so
|
||||||
// the addresses don't conflict)
|
// the addresses don't conflict)
|
||||||
address cds_address = NULL;
|
address cds_address = NULL;
|
||||||
if (UseSharedSpaces) {
|
|
||||||
#if INCLUDE_CDS
|
|
||||||
FileMapInfo* mapinfo = new FileMapInfo();
|
FileMapInfo* mapinfo = new FileMapInfo();
|
||||||
|
|
||||||
|
if (JvmtiExport::should_post_class_file_load_hook()) {
|
||||||
|
// Currently CDS does not support JVMTI CFLH when loading shared class.
|
||||||
|
// If JvmtiExport::should_post_class_file_load_hook is already enabled,
|
||||||
|
// just disable UseSharedSpaces.
|
||||||
|
FileMapInfo::fail_continue("Tool agent requires sharing to be disabled.");
|
||||||
|
delete mapinfo;
|
||||||
|
} else {
|
||||||
// Open the shared archive file, read and validate the header. If
|
// Open the shared archive file, read and validate the header. If
|
||||||
// initialization fails, shared spaces [UseSharedSpaces] are
|
// initialization fails, shared spaces [UseSharedSpaces] are
|
||||||
// disabled and the file is closed.
|
// disabled and the file is closed.
|
||||||
|
@ -3195,8 +3202,9 @@ void Metaspace::global_initialize() {
|
||||||
assert(!mapinfo->is_open() && !UseSharedSpaces,
|
assert(!mapinfo->is_open() && !UseSharedSpaces,
|
||||||
"archive file not closed or shared spaces not disabled.");
|
"archive file not closed or shared spaces not disabled.");
|
||||||
}
|
}
|
||||||
#endif // INCLUDE_CDS
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif // INCLUDE_CDS
|
||||||
|
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
if (!UseSharedSpaces && using_class_space()) {
|
if (!UseSharedSpaces && using_class_space()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue