Mercurial > hg > truffle
diff src/share/vm/runtime/sweeper.cpp @ 1000:a1423fe86a18
Merge
author | trims |
---|---|
date | Fri, 09 Oct 2009 15:18:52 -0700 |
parents | 89e0543e1737 54b3b351d6f9 |
children | 5f24d0319e54 |
line wrap: on
line diff
--- a/src/share/vm/runtime/sweeper.cpp Fri Oct 02 11:26:25 2009 -0700 +++ b/src/share/vm/runtime/sweeper.cpp Fri Oct 09 15:18:52 2009 -0700 @@ -34,6 +34,17 @@ jint NMethodSweeper::_not_entrant_seen_on_stack = 0; bool NMethodSweeper::_rescan = false; +class MarkActivationClosure: public CodeBlobClosure { +public: + virtual void do_code_blob(CodeBlob* cb) { + // If we see an activation belonging to a non_entrant nmethod, we mark it. + if (cb->is_nmethod() && ((nmethod*)cb)->is_not_entrant()) { + ((nmethod*)cb)->mark_as_seen_on_stack(); + } + } +}; +static MarkActivationClosure mark_activation_closure; + void NMethodSweeper::sweep() { assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint"); if (!MethodFlushing) return; @@ -57,7 +68,7 @@ if (PrintMethodFlushing) { tty->print_cr("### Sweep: stack traversal %d", _traversals); } - Threads::nmethods_do(); + Threads::nmethods_do(&mark_activation_closure); // reset the flags since we started a scan from the beginning. _rescan = false;