< prev index next >

src/share/vm/classfile/dictionary.hpp

Print this page

        

*** 27,36 **** --- 27,37 ---- #include "classfile/protectionDomainCache.hpp" #include "classfile/systemDictionary.hpp" #include "oops/instanceKlass.hpp" #include "oops/oop.hpp" + #include "runtime/orderAccess.hpp" #include "utilities/hashtable.hpp" #include "utilities/ostream.hpp" class DictionaryEntry; class BoolObjectClosure;
*** 132,142 **** // // The usage of the PD set can be seen in SystemDictionary::validate_protection_domain() // It is essentially a cache to avoid repeated Java up-calls to // ClassLoader.checkPackageAccess(). // ! ProtectionDomainEntry* _pd_set; public: // Tells whether a protection is in the approved set. bool contains_protection_domain(oop protection_domain) const; // Adds a protection domain to the approved set. --- 133,143 ---- // // The usage of the PD set can be seen in SystemDictionary::validate_protection_domain() // It is essentially a cache to avoid repeated Java up-calls to // ClassLoader.checkPackageAccess(). // ! ProtectionDomainEntry* volatile _pd_set; public: // Tells whether a protection is in the approved set. bool contains_protection_domain(oop protection_domain) const; // Adds a protection domain to the approved set.
*** 152,162 **** DictionaryEntry** next_addr() { return (DictionaryEntry**)HashtableEntry<InstanceKlass*, mtClass>::next_addr(); } ProtectionDomainEntry* pd_set() const { return _pd_set; } ! void set_pd_set(ProtectionDomainEntry* pd_set) { _pd_set = pd_set; } // 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; --- 153,170 ---- DictionaryEntry** next_addr() { return (DictionaryEntry**)HashtableEntry<InstanceKlass*, mtClass>::next_addr(); } ProtectionDomainEntry* pd_set() const { return _pd_set; } ! void set_pd_set(ProtectionDomainEntry* new_head) { _pd_set = new_head; } ! ! ProtectionDomainEntry* pd_set_acquire() const { ! return (ProtectionDomainEntry*)OrderAccess::load_ptr_acquire(&_pd_set); ! } ! void release_set_pd_set(ProtectionDomainEntry* new_head) { ! OrderAccess::release_store_ptr(&_pd_set, new_head); ! } // 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;
*** 165,175 **** ? true : contains_protection_domain(protection_domain()); } void verify_protection_domain_set() { ! for (ProtectionDomainEntry* current = _pd_set; current != NULL; current = current->_next) { current->_pd_cache->protection_domain()->verify(); } } --- 173,183 ---- ? true : contains_protection_domain(protection_domain()); } void verify_protection_domain_set() { ! for (ProtectionDomainEntry* current = pd_set(); current != NULL; current = current->_next) { current->_pd_cache->protection_domain()->verify(); } }
*** 179,189 **** return (klass->name() == class_name); } void print_count(outputStream *st) { int count = 0; ! for (ProtectionDomainEntry* current = _pd_set; current != NULL; current = current->_next) { count++; } st->print_cr("pd set count = #%d", count); --- 187,197 ---- return (klass->name() == class_name); } void print_count(outputStream *st) { int count = 0; ! for (ProtectionDomainEntry* current = pd_set(); current != NULL; current = current->_next) { count++; } st->print_cr("pd set count = #%d", count);
< prev index next >