src/share/vm/runtime/sweeper.hpp

Print this page
rev 5099 : dummy

@@ -50,14 +50,10 @@
 
   // These are set during a flush, a VM-operation
   static long      _last_flush_traversal_id; // trav number at last flush unloading
   static jlong     _last_full_flush_time;    // timestamp of last emergency unloading
 
-  // These are synchronized by the _sweep_started token
-  static int       _highest_marked;   // highest compile id dumped at last emergency unloading
-  static int       _dead_compile_ids; // number of compile ids that where not in the cache last flush
-
   // Stat counters
   static int       _number_of_flushes;            // Total of full traversals caused by full cache
   static int       _total_nof_methods_reclaimed;  // Accumulated nof methods flushed
   static jlong     _total_time_sweeping;          // Accumulated time sweeping
   static jlong     _total_time_this_sweep;        // Total time this sweep

@@ -69,10 +65,11 @@
   static void process_nmethod(nmethod *nm);
   static void release_nmethod(nmethod* nm);
 
   static void log_sweep(const char* msg, const char* format = NULL, ...);
   static bool sweep_in_progress();
+  static void sweep_code_cache(); // Concurrent part of sweep job
 
  public:
   static long traversal_count()              { return _traversals; }
   static int  number_of_flushes()            { return _number_of_flushes; }
   static int  total_nof_methods_reclaimed()  { return _total_nof_methods_reclaimed; }

@@ -80,21 +77,25 @@
   static jlong peak_sweep_time()             { return _peak_sweep_time; }
   static jlong peak_sweep_fraction_time()    { return _peak_sweep_fraction_time; }
   static jlong total_disconnect_time()       { return _total_disconnect_time; }
   static jlong peak_disconnect_time()        { return _peak_disconnect_time; }
 
+  static const int hc_reset_value = 100; // Value to which _hotness_counter of a method is set during stack scanning
+  static const int hc_dec_value   = 1;   // Value by which the hotness counter is decremented
+
 #ifdef ASSERT
   // Keep track of sweeper activity in the ring buffer
   static void record_sweep(nmethod* nm, int line);
   static void report_events(int id, address entry);
   static void report_events();
 #endif
 
   static void scan_stacks();      // Invoked at the end of each safepoint
-  static void sweep_code_cache(); // Concurrent part of sweep job
   static void possibly_sweep();   // Compiler threads call this to sweep
 
+  static int  sort_nmentod_by_hotness(nmethod** nm1, nmethod** nm2);
+
   static void notify(nmethod* nm) {
     // Request a new sweep of the code cache from the beginning. No
     // need to synchronize the setting of this flag since it only
     // changes to false at safepoint so we can never overwrite it with false.
      _resweep = true;