8232887: Remove SystemDictionary::has_checkPackageAccess
authorredestad
Wed, 23 Oct 2019 15:48:11 +0200
changeset 58756 b7aa58d7f5aa
parent 58754 f67f4674b466
child 58758 2b13d126a2d8
8232887: Remove SystemDictionary::has_checkPackageAccess Reviewed-by: coleenp, lfoltan
src/hotspot/share/classfile/dictionary.hpp
src/hotspot/share/classfile/systemDictionary.cpp
src/hotspot/share/classfile/systemDictionary.hpp
--- a/src/hotspot/share/classfile/dictionary.hpp	Wed Oct 23 05:48:17 2019 -0700
+++ b/src/hotspot/share/classfile/dictionary.hpp	Wed Oct 23 15:48:11 2019 +0200
@@ -156,7 +156,6 @@
   // Tells whether the initiating class' protection domain can access the klass in this entry
   bool is_valid_protection_domain(Handle protection_domain) {
     if (!ProtectionDomainVerification) return true;
-    if (!SystemDictionary::has_checkPackageAccess()) return true;
 
     return protection_domain() == NULL
          ? true
--- a/src/hotspot/share/classfile/systemDictionary.cpp	Wed Oct 23 05:48:17 2019 -0700
+++ b/src/hotspot/share/classfile/systemDictionary.cpp	Wed Oct 23 15:48:11 2019 +0200
@@ -109,8 +109,6 @@
 oop         SystemDictionary::_java_system_loader         =  NULL;
 oop         SystemDictionary::_java_platform_loader       =  NULL;
 
-bool        SystemDictionary::_has_checkPackageAccess     =  false;
-
 // Default ProtectionDomainCacheSize value
 
 const int defaultProtectionDomainCacheSize = 1009;
@@ -447,8 +445,6 @@
                                                   Handle class_loader,
                                                   Handle protection_domain,
                                                   TRAPS) {
-  if(!has_checkPackageAccess()) return;
-
   // Now we have to call back to java to check if the initating class has access
   JavaValue result(T_VOID);
   LogTarget(Debug, protectiondomain) lt;
@@ -2021,11 +2017,6 @@
   //_box_klasses[T_OBJECT]  = WK_KLASS(object_klass);
   //_box_klasses[T_ARRAY]   = WK_KLASS(object_klass);
 
-  { // Compute whether we should use checkPackageAccess or NOT
-    Method* method = InstanceKlass::cast(ClassLoader_klass())->find_method(vmSymbols::checkPackageAccess_name(), vmSymbols::class_protectiondomain_signature());
-    _has_checkPackageAccess = (method != NULL);
-  }
-
 #ifdef ASSERT
   if (UseSharedSpaces) {
     assert(JvmtiExport::is_early_phase(),
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Wed Oct 23 05:48:17 2019 -0700
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Wed Oct 23 15:48:11 2019 +0200
@@ -430,9 +430,6 @@
   }
 
 public:
-  // Tells whether ClassLoader.checkPackageAccess is present
-  static bool has_checkPackageAccess()      { return _has_checkPackageAccess; }
-
   static bool Parameter_klass_loaded()      { return WK_KLASS(reflect_Parameter_klass) != NULL; }
   static bool Class_klass_loaded()          { return WK_KLASS(Class_klass) != NULL; }
   static bool Cloneable_klass_loaded()      { return WK_KLASS(Cloneable_klass) != NULL; }
@@ -667,8 +664,6 @@
   static oop  _java_system_loader;
   static oop  _java_platform_loader;
 
-  static bool _has_checkPackageAccess;
-
 public:
   static TableStatistics placeholders_statistics();
   static TableStatistics loader_constraints_statistics();