equal
deleted
inserted
replaced
151 bool DictionaryEntry::contains_protection_domain(oop protection_domain) const { |
151 bool DictionaryEntry::contains_protection_domain(oop protection_domain) const { |
152 // Lock the pd_set list. This lock cannot safepoint since the caller holds |
152 // Lock the pd_set list. This lock cannot safepoint since the caller holds |
153 // a Dictionary entry, which can be moved if the Dictionary is resized. |
153 // a Dictionary entry, which can be moved if the Dictionary is resized. |
154 MutexLocker ml(ProtectionDomainSet_lock, Mutex::_no_safepoint_check_flag); |
154 MutexLocker ml(ProtectionDomainSet_lock, Mutex::_no_safepoint_check_flag); |
155 #ifdef ASSERT |
155 #ifdef ASSERT |
156 if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) { |
156 if (protection_domain == instance_klass()->protection_domain()) { |
157 // Ensure this doesn't show up in the pd_set (invariant) |
157 // Ensure this doesn't show up in the pd_set (invariant) |
158 bool in_pd_set = false; |
158 bool in_pd_set = false; |
159 for (ProtectionDomainEntry* current = pd_set(); |
159 for (ProtectionDomainEntry* current = pd_set(); |
160 current != NULL; |
160 current != NULL; |
161 current = current->next()) { |
161 current = current->next()) { |
162 if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) { |
162 if (current->object_no_keepalive() == protection_domain) { |
163 in_pd_set = true; |
163 in_pd_set = true; |
164 break; |
164 break; |
165 } |
165 } |
166 } |
166 } |
167 if (in_pd_set) { |
167 if (in_pd_set) { |
169 "in its sys. dict. PD set"); |
169 "in its sys. dict. PD set"); |
170 } |
170 } |
171 } |
171 } |
172 #endif /* ASSERT */ |
172 #endif /* ASSERT */ |
173 |
173 |
174 if (oopDesc::equals(protection_domain, instance_klass()->protection_domain())) { |
174 if (protection_domain == instance_klass()->protection_domain()) { |
175 // Succeeds trivially |
175 // Succeeds trivially |
176 return true; |
176 return true; |
177 } |
177 } |
178 |
178 |
179 for (ProtectionDomainEntry* current = pd_set(); |
179 for (ProtectionDomainEntry* current = pd_set(); |
180 current != NULL; |
180 current != NULL; |
181 current = current->next()) { |
181 current = current->next()) { |
182 if (oopDesc::equals(current->object_no_keepalive(), protection_domain)) return true; |
182 if (current->object_no_keepalive() == protection_domain) return true; |
183 } |
183 } |
184 return false; |
184 return false; |
185 } |
185 } |
186 |
186 |
187 |
187 |