src/share/vm/runtime/sweeper.cpp

changeset 1435
a1423fe86a18
parent 1383
89e0543e1737
parent 1428
54b3b351d6f9
child 1637
5f24d0319e54
     1.1 --- a/src/share/vm/runtime/sweeper.cpp	Fri Oct 02 11:26:25 2009 -0700
     1.2 +++ b/src/share/vm/runtime/sweeper.cpp	Fri Oct 09 15:18:52 2009 -0700
     1.3 @@ -34,6 +34,17 @@
     1.4  jint      NMethodSweeper::_not_entrant_seen_on_stack = 0;
     1.5  bool      NMethodSweeper::_rescan = false;
     1.6  
     1.7 +class MarkActivationClosure: public CodeBlobClosure {
     1.8 +public:
     1.9 +  virtual void do_code_blob(CodeBlob* cb) {
    1.10 +    // If we see an activation belonging to a non_entrant nmethod, we mark it.
    1.11 +    if (cb->is_nmethod() && ((nmethod*)cb)->is_not_entrant()) {
    1.12 +      ((nmethod*)cb)->mark_as_seen_on_stack();
    1.13 +    }
    1.14 +  }
    1.15 +};
    1.16 +static MarkActivationClosure mark_activation_closure;
    1.17 +
    1.18  void NMethodSweeper::sweep() {
    1.19    assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint");
    1.20    if (!MethodFlushing) return;
    1.21 @@ -57,7 +68,7 @@
    1.22      if (PrintMethodFlushing) {
    1.23        tty->print_cr("### Sweep: stack traversal %d", _traversals);
    1.24      }
    1.25 -    Threads::nmethods_do();
    1.26 +    Threads::nmethods_do(&mark_activation_closure);
    1.27  
    1.28      // reset the flags since we started a scan from the beginning.
    1.29      _rescan = false;

mercurial