comparison src/share/vm/runtime/sweeper.cpp @ 989:148e5441d916

6863023: need non-perm oops in code cache for JSR 292 Summary: Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
author jrose
date Tue, 15 Sep 2009 21:53:47 -0700
parents a61af66fc99e
children 54b3b351d6f9
comparison
equal deleted inserted replaced
987:00977607da34 989:148e5441d916
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;