< 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.
*** 151,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;
--- 152,169 ----
DictionaryEntry** next_addr() {
return (DictionaryEntry**)HashtableEntry<InstanceKlass*, mtClass>::next_addr();
}
! ProtectionDomainEntry* pd_set() const { return (ProtectionDomainEntry*)OrderAccess::load_ptr_acquire(&_pd_set); }
! void set_pd_set(ProtectionDomainEntry* new_head) {
! // Warning: Preserve store ordering. The SystemDictionary is read
! // without locks. The new ProtectionDomainEntry must be
! // complete before other threads can be allowed to see it
! // via a store to _pd_set.
! 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;
< prev index next >