Mercurial > hg > truffle
diff src/share/vm/memory/iterator.hpp @ 7179:d0aa87f04bd5
8003720: NPG: Method in interpreter stack frame can be deallocated
Summary: Pass down a closure during root scanning to keep the class of the method alive.
Reviewed-by: coleenp, jcoomes
author | stefank |
---|---|
date | Tue, 27 Nov 2012 10:13:20 +0100 |
parents | ec98e58952b2 |
children | 001ec9515f84 |
line wrap: on
line diff
--- a/src/share/vm/memory/iterator.hpp Mon Nov 26 12:31:03 2012 -0500 +++ b/src/share/vm/memory/iterator.hpp Tue Nov 27 10:13:20 2012 +0100 @@ -135,6 +135,20 @@ virtual void do_klass(Klass* k); }; +class CLDToOopClosure { + OopClosure* _oop_closure; + KlassToOopClosure _klass_closure; + bool _must_claim_cld; + + public: + CLDToOopClosure(OopClosure* oop_closure, bool must_claim_cld = true) : + _oop_closure(oop_closure), + _klass_closure(oop_closure), + _must_claim_cld(must_claim_cld) {} + + void do_cld(ClassLoaderData* cld); +}; + // ObjectClosure is used for iterating through an object space class ObjectClosure : public Closure {