src/hotspot/share/classfile/systemDictionary.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/hotspot/share/classfile/systemDictionary.cpp Thu Oct 5 17:16:16 2017
--- new/src/hotspot/share/classfile/systemDictionary.cpp Thu Oct 5 17:16:16 2017
*** 102,111 ****
--- 102,112 ----
= { NULL /*, NULL...*/ };
InstanceKlass* SystemDictionary::_box_klasses[T_VOID+1] = { NULL /*, NULL...*/ };
oop SystemDictionary::_java_system_loader = NULL;
+ oop SystemDictionary::_java_platform_loader = NULL;
bool SystemDictionary::_has_loadClassInternal = false;
bool SystemDictionary::_has_checkPackageAccess = false;
// lazily initialized klass variables
*** 115,144 ****
--- 116,159 ----
const int defaultProtectionDomainCacheSize = 1009;
// ----------------------------------------------------------------------------
! // Java-level SystemLoader and PlatformLoader
oop SystemDictionary::java_system_loader() {
return _java_system_loader;
}
void SystemDictionary::compute_java_system_loader(TRAPS) {
Klass* system_klass = WK_KLASS(ClassLoader_klass);
JavaValue result(T_OBJECT);
JavaCalls::call_static(&result,
! WK_KLASS(ClassLoader_klass),
! SystemDictionary::ClassLoader_klass(),
vmSymbols::getSystemClassLoader_name(),
vmSymbols::void_classloader_signature(),
CHECK);
_java_system_loader = (oop)result.get_jobject();
CDS_ONLY(SystemDictionaryShared::initialize(CHECK);)
}
+ oop SystemDictionary::java_platform_loader() {
+ return _java_platform_loader;
+ }
+
+ void SystemDictionary::compute_java_platform_loader(TRAPS) {
+ JavaValue result(T_OBJECT);
+ JavaCalls::call_static(&result,
+ SystemDictionary::ClassLoader_klass(),
+ vmSymbols::getPlatformClassLoader_name(),
+ vmSymbols::void_classloader_signature(),
+ CHECK);
+
+ _java_platform_loader = (oop)result.get_jobject();
+ }
+
ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, TRAPS) {
if (class_loader() == NULL) return ClassLoaderData::the_null_class_loader_data();
return ClassLoaderDataGraph::find_or_create(class_loader, THREAD);
}
*** 166,185 ****
--- 181,199 ----
// specified via -Djava.system.class.loader.
bool SystemDictionary::is_system_class_loader(oop class_loader) {
if (class_loader == NULL) {
return false;
}
! return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_AppClassLoader_klass() ||
class_loader == _java_system_loader);
! return (class_loader == _java_system_loader);
}
// Returns true if the passed class loader is the platform class loader.
bool SystemDictionary::is_platform_class_loader(oop class_loader) {
if (class_loader == NULL) {
return false;
}
! return (class_loader->klass() == SystemDictionary::jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass());
! return (class_loader == _java_platform_loader);
}
// ----------------------------------------------------------------------------
// Resolving of classes
*** 1938,1947 ****
--- 1952,1962 ----
return unloading_occurred;
}
void SystemDictionary::roots_oops_do(OopClosure* strong, OopClosure* weak) {
strong->do_oop(&_java_system_loader);
+ strong->do_oop(&_java_platform_loader);
strong->do_oop(&_system_loader_lock_obj);
CDS_ONLY(SystemDictionaryShared::roots_oops_do(strong);)
// Do strong roots marking if the closures are the same.
if (strong == weak || !ClassUnloading) {
*** 1962,1971 ****
--- 1977,1987 ----
}
}
void SystemDictionary::oops_do(OopClosure* f) {
f->do_oop(&_java_system_loader);
+ f->do_oop(&_java_platform_loader);
f->do_oop(&_system_loader_lock_obj);
CDS_ONLY(SystemDictionaryShared::oops_do(f);)
// Only the protection domain oops contain references into the heap. Iterate
// over all of them.
src/hotspot/share/classfile/systemDictionary.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File