165 ProtectionDomainEntry* pd_set() const { return _pd_set; }
166 void set_pd_set(ProtectionDomainEntry* new_head) { _pd_set = new_head; }
167
168 ProtectionDomainEntry* pd_set_acquire() const;
169 void release_set_pd_set(ProtectionDomainEntry* new_head);
170
171 // Tells whether the initiating class' protection domain can access the klass in this entry
172 bool is_valid_protection_domain(Handle protection_domain) {
173 if (!ProtectionDomainVerification) return true;
174 if (!SystemDictionary::has_checkPackageAccess()) return true;
175
176 return protection_domain() == NULL
177 ? true
178 : contains_protection_domain(protection_domain());
179 }
180
181 void verify_protection_domain_set() {
182 for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
183 current != NULL;
184 current = current->_next) {
185 current->_pd_cache->object_no_keepalive()->verify();
186 }
187 }
188
189 bool equals(const Symbol* class_name) const {
190 InstanceKlass* klass = (InstanceKlass*)literal();
191 return (klass->name() == class_name);
192 }
193
194 void print_count(outputStream *st) {
195 int count = 0;
196 for (ProtectionDomainEntry* current = pd_set(); // accessed inside SD lock
197 current != NULL;
198 current = current->_next) {
199 count++;
200 }
201 st->print_cr("pd set count = #%d", count);
202 }
203
204 void verify();
205 };
|
165 ProtectionDomainEntry* pd_set() const { return _pd_set; }
166 void set_pd_set(ProtectionDomainEntry* new_head) { _pd_set = new_head; }
167
168 ProtectionDomainEntry* pd_set_acquire() const;
169 void release_set_pd_set(ProtectionDomainEntry* new_head);
170
171 // Tells whether the initiating class' protection domain can access the klass in this entry
172 bool is_valid_protection_domain(Handle protection_domain) {
173 if (!ProtectionDomainVerification) return true;
174 if (!SystemDictionary::has_checkPackageAccess()) return true;
175
176 return protection_domain() == NULL
177 ? true
178 : contains_protection_domain(protection_domain());
179 }
180
181 void verify_protection_domain_set() {
182 for (ProtectionDomainEntry* current = pd_set(); // accessed at a safepoint
183 current != NULL;
184 current = current->_next) {
185 oopDesc::verify(current->_pd_cache->object_no_keepalive());
186 }
187 }
188
189 bool equals(const Symbol* class_name) const {
190 InstanceKlass* klass = (InstanceKlass*)literal();
191 return (klass->name() == class_name);
192 }
193
194 void print_count(outputStream *st) {
195 int count = 0;
196 for (ProtectionDomainEntry* current = pd_set(); // accessed inside SD lock
197 current != NULL;
198 current = current->_next) {
199 count++;
200 }
201 st->print_cr("pd set count = #%d", count);
202 }
203
204 void verify();
205 };
|