comparison 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
comparison
equal deleted inserted replaced
984:6ddec5389232 1000:a1423fe86a18
32 32
33 jint NMethodSweeper::_locked_seen = 0; 33 jint NMethodSweeper::_locked_seen = 0;
34 jint NMethodSweeper::_not_entrant_seen_on_stack = 0; 34 jint NMethodSweeper::_not_entrant_seen_on_stack = 0;
35 bool NMethodSweeper::_rescan = false; 35 bool NMethodSweeper::_rescan = false;
36 36
37 class MarkActivationClosure: public CodeBlobClosure {
38 public:
39 virtual void do_code_blob(CodeBlob* cb) {
40 // If we see an activation belonging to a non_entrant nmethod, we mark it.
41 if (cb->is_nmethod() && ((nmethod*)cb)->is_not_entrant()) {
42 ((nmethod*)cb)->mark_as_seen_on_stack();
43 }
44 }
45 };
46 static MarkActivationClosure mark_activation_closure;
47
37 void NMethodSweeper::sweep() { 48 void NMethodSweeper::sweep() {
38 assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint"); 49 assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint");
39 if (!MethodFlushing) return; 50 if (!MethodFlushing) return;
40 51
41 // No need to synchronize access, since this is always executed at a 52 // No need to synchronize access, since this is always executed at a
55 _current = CodeCache::first(); 66 _current = CodeCache::first();
56 _traversals += 1; 67 _traversals += 1;
57 if (PrintMethodFlushing) { 68 if (PrintMethodFlushing) {
58 tty->print_cr("### Sweep: stack traversal %d", _traversals); 69 tty->print_cr("### Sweep: stack traversal %d", _traversals);
59 } 70 }
60 Threads::nmethods_do(); 71 Threads::nmethods_do(&mark_activation_closure);
61 72
62 // reset the flags since we started a scan from the beginning. 73 // reset the flags since we started a scan from the beginning.
63 _rescan = false; 74 _rescan = false;
64 _locked_seen = 0; 75 _locked_seen = 0;
65 _not_entrant_seen_on_stack = 0; 76 _not_entrant_seen_on_stack = 0;