equal
deleted
inserted
replaced
64 }; |
64 }; |
65 static long _traversals; // Stack scan count, also sweep ID. |
65 static long _traversals; // Stack scan count, also sweep ID. |
66 static long _total_nof_code_cache_sweeps; // Total number of full sweeps of the code cache |
66 static long _total_nof_code_cache_sweeps; // Total number of full sweeps of the code cache |
67 static long _time_counter; // Virtual time used to periodically invoke sweeper |
67 static long _time_counter; // Virtual time used to periodically invoke sweeper |
68 static long _last_sweep; // Value of _time_counter when the last sweep happened |
68 static long _last_sweep; // Value of _time_counter when the last sweep happened |
69 static NMethodIterator _current; // Current nmethod |
69 static CompiledMethodIterator _current; // Current compiled method |
70 static int _seen; // Nof. nmethod we have currently processed in current pass of CodeCache |
70 static int _seen; // Nof. nmethod we have currently processed in current pass of CodeCache |
71 |
71 |
72 static volatile int _sweep_started; // Flag to control conc sweeper |
72 static volatile int _sweep_started; // Flag to control conc sweeper |
73 static volatile bool _should_sweep; // Indicates if we should invoke the sweeper |
73 static volatile bool _should_sweep; // Indicates if we should invoke the sweeper |
74 static volatile bool _force_sweep; // Indicates if we should force a sweep |
74 static volatile bool _force_sweep; // Indicates if we should force a sweep |
86 static Tickspan _peak_sweep_time; // Peak time for a full sweep |
86 static Tickspan _peak_sweep_time; // Peak time for a full sweep |
87 static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction |
87 static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction |
88 |
88 |
89 static Monitor* _stat_lock; |
89 static Monitor* _stat_lock; |
90 |
90 |
91 static MethodStateChange process_nmethod(nmethod *nm); |
91 static MethodStateChange process_compiled_method(CompiledMethod *nm); |
92 static void release_nmethod(nmethod* nm); |
92 static void release_compiled_method(CompiledMethod* nm); |
93 |
93 |
94 static void init_sweeper_log() NOT_DEBUG_RETURN; |
94 static void init_sweeper_log() NOT_DEBUG_RETURN; |
95 static bool wait_for_stack_scanning(); |
95 static bool wait_for_stack_scanning(); |
96 static void sweep_code_cache(); |
96 static void sweep_code_cache(); |
97 static void handle_safepoint_request(); |
97 static void handle_safepoint_request(); |
105 static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } |
105 static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; } |
106 static void log_sweep(const char* msg, const char* format = NULL, ...) ATTRIBUTE_PRINTF(2, 3); |
106 static void log_sweep(const char* msg, const char* format = NULL, ...) ATTRIBUTE_PRINTF(2, 3); |
107 |
107 |
108 |
108 |
109 #ifdef ASSERT |
109 #ifdef ASSERT |
110 static bool is_sweeping(nmethod* which) { return _current.method() == which; } |
|
111 // Keep track of sweeper activity in the ring buffer |
110 // Keep track of sweeper activity in the ring buffer |
112 static void record_sweep(nmethod* nm, int line); |
111 static void record_sweep(CompiledMethod* nm, int line); |
113 static void report_events(int id, address entry); |
112 static void report_events(int id, address entry); |
114 static void report_events(); |
113 static void report_events(); |
115 #endif |
114 #endif |
116 |
115 |
117 static void mark_active_nmethods(); // Invoked at the end of each safepoint |
116 static void mark_active_nmethods(); // Invoked at the end of each safepoint |