Mercurial > hg > truffle
comparison src/share/vm/gc_interface/collectedHeap.inline.hpp @ 7176:59c790074993
8003635: NPG: AsynchGetCallTrace broken by Method* virtual call
Summary: Make metaspace::contains be lock free and used to see if something is in metaspace, also compare Method* with vtbl pointer.
Reviewed-by: dholmes, sspitsyn, dcubed, jmasa
author | coleenp |
---|---|
date | Wed, 28 Nov 2012 17:50:21 -0500 |
parents | da91efe96a93 |
children | c24f778e9401 |
comparison
equal
deleted
inserted
replaced
7175:b51dc8df86e5 | 7176:59c790074993 |
---|---|
240 Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); | 240 Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); |
241 #endif | 241 #endif |
242 return (oop)obj; | 242 return (oop)obj; |
243 } | 243 } |
244 | 244 |
245 // Returns "TRUE" if "p" is a method oop in the | |
246 // current heap with high probability. NOTE: The main | |
247 // current consumers of this interface are Forte:: | |
248 // and ThreadProfiler::. In these cases, the | |
249 // interpreter frame from which "p" came, may be | |
250 // under construction when sampled asynchronously, so | |
251 // the clients want to check that it represents a | |
252 // valid method before using it. Nonetheless since | |
253 // the clients do not typically lock out GC, the | |
254 // predicate is_valid_method() is not stable, so | |
255 // it is possible that by the time "p" is used, it | |
256 // is no longer valid. | |
257 inline bool CollectedHeap::is_valid_method(Method* p) const { | |
258 return | |
259 p != NULL && | |
260 | |
261 // Check whether "method" is metadata | |
262 p->is_metadata() && | |
263 | |
264 // See if GC is active; however, there is still an | |
265 // apparently unavoidable window after this call | |
266 // and before the client of this interface uses "p". | |
267 // If the client chooses not to lock out GC, then | |
268 // it's a risk the client must accept. | |
269 !is_gc_active() && | |
270 | |
271 // Check that p is a Method*. | |
272 p->is_method(); | |
273 } | |
274 | |
275 inline void CollectedHeap::oop_iterate_no_header(OopClosure* cl) { | 245 inline void CollectedHeap::oop_iterate_no_header(OopClosure* cl) { |
276 NoHeaderExtendedOopClosure no_header_cl(cl); | 246 NoHeaderExtendedOopClosure no_header_cl(cl); |
277 oop_iterate(&no_header_cl); | 247 oop_iterate(&no_header_cl); |
278 } | 248 } |
279 | 249 |