< prev index next >
src/share/vm/runtime/sweeper.cpp
Print this page
rev 13047 : [mq]: 8180932.patch
@@ -197,15 +197,24 @@
* Scans the stacks of all Java threads and marks activations of not-entrant methods.
* No need to synchronize access, since 'mark_active_nmethods' is always executed at a
* safepoint.
*/
void NMethodSweeper::mark_active_nmethods() {
+ CodeBlobClosure* cl = prepare_mark_active_nmethods();
+ if (cl != NULL) {
+ Threads::nmethods_do(cl);
+ // TODO: Is this really needed?
+ OrderAccess::storestore();
+ }
+}
+
+CodeBlobClosure* NMethodSweeper::prepare_mark_active_nmethods() {
assert(SafepointSynchronize::is_at_safepoint(), "must be executed at a safepoint");
// If we do not want to reclaim not-entrant or zombie methods there is no need
// to scan stacks
if (!MethodFlushing) {
- return;
+ return NULL;
}
// Increase time so that we can estimate when to invoke the sweeper again.
_time_counter++;
@@ -229,18 +238,17 @@
_total_time_this_sweep = Tickspan();
if (PrintMethodFlushing) {
tty->print_cr("### Sweep: stack traversal %ld", _traversals);
}
- Threads::nmethods_do(&mark_activation_closure);
+ return &mark_activation_closure;
} else {
// Only set hotness counter
- Threads::nmethods_do(&set_hotness_closure);
+ return &set_hotness_closure;
}
- OrderAccess::storestore();
}
/**
* This function triggers a VM operation that does stack scanning of active
* methods. Stack scanning is mandatory for the sweeper to make progress.
< prev index next >