< prev index next >

src/share/vm/runtime/sweeper.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -144,11 +144,10 @@
 volatile bool NMethodSweeper::_should_sweep            = true; // Indicates if we should invoke the sweeper
 volatile bool NMethodSweeper::_force_sweep             = false;// Indicates if we should force a sweep
 volatile int  NMethodSweeper::_bytes_changed           = 0;    // Counts the total nmethod size if the nmethod changed from:
                                                                //   1) alive       -> not_entrant
                                                                //   2) not_entrant -> zombie
-                                                               //   3) zombie      -> marked_for_reclamation
 int    NMethodSweeper::_hotness_counter_reset_val       = 0;
 
 long   NMethodSweeper::_total_nof_methods_reclaimed     = 0;   // Accumulated nof methods flushed
 long   NMethodSweeper::_total_nof_c2_methods_reclaimed  = 0;   // Accumulated nof methods flushed
 size_t NMethodSweeper::_total_flushed_size              = 0;   // Total number of bytes flushed from the code cache

@@ -395,11 +394,10 @@
   ResourceMark rm;
   Ticks sweep_start_counter = Ticks::now();
 
   int flushed_count                = 0;
   int zombified_count              = 0;
-  int marked_for_reclamation_count = 0;
   int flushed_c2_count     = 0;
 
   if (PrintMethodFlushing && Verbose) {
     tty->print_cr("### Sweep at %d out of %d", _seen, CodeCache::nmethod_count());
   }

@@ -440,14 +438,10 @@
             ++flushed_count;
             if (is_c2_method) {
               ++flushed_c2_count;
             }
             break;
-          case MarkedForReclamation:
-            state_after = "marked for reclamation";
-            ++marked_for_reclamation_count;
-            break;
           case MadeZombie:
             state_after = "made zombie";
             ++zombified_count;
             break;
           case None:

@@ -484,11 +478,10 @@
     event.set_starttime(sweep_start_counter);
     event.set_endtime(sweep_end_counter);
     event.set_sweepIndex(_traversals);
     event.set_sweptCount(swept_count);
     event.set_flushedCount(flushed_count);
-    event.set_markedCount(marked_for_reclamation_count);
     event.set_zombifiedCount(zombified_count);
     event.commit();
   }
 
 #ifdef ASSERT

@@ -599,27 +592,16 @@
     }
     return result;
   }
 
   if (nm->is_zombie()) {
-    // If it is the first time we see nmethod then we mark it. Otherwise,
-    // we reclaim it. When we have seen a zombie method twice, we know that
-    // there are no inline caches that refer to it.
-    if (nm->is_marked_for_reclamation()) {
+    // All inline caches that referred to this nmethod were cleaned in the
+    // previous sweeper cycle. Now flush the nmethod from the code cache.
       assert(!nm->is_locked_by_vm(), "must not flush locked nmethods");
       release_nmethod(nm);
       assert(result == None, "sanity");
       result = Flushed;
-    } else {
-      nm->mark_for_reclamation();
-      // Keep track of code cache state change
-      _bytes_changed += nm->total_size();
-      SWEEP(nm);
-      assert(result == None, "sanity");
-      result = MarkedForReclamation;
-      assert(nm->is_marked_for_reclamation(), "nmethod must be marked for reclamation");
-    }
   } else if (nm->is_not_entrant()) {
     // If there are no current activations of this method on the
     // stack we can safely convert it to a zombie method
     if (nm->can_convert_to_zombie()) {
       // Clear ICStubs to prevent back patching stubs of zombie or flushed
< prev index next >