< prev index next >
src/share/vm/runtime/sweeper.cpp
Print this page
rev 9019 : [mq]: format.patch
*** 41,52 ****
#include "trace/tracing.hpp"
#include "utilities/events.hpp"
#include "utilities/ticks.inline.hpp"
#include "utilities/xmlstream.hpp"
- PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
-
#ifdef ASSERT
#define SWEEP(nm) record_sweep(nm, __LINE__)
// Sweeper logging code
class SweeperRecord {
--- 41,50 ----
*** 60,75 ****
address uep;
int line;
void print() {
tty->print_cr("traversal = %d compile_id = %d %s uep = " PTR_FORMAT " vep = "
! PTR_FORMAT " state = %d traversal_mark %d line = %d",
traversal,
compile_id,
kind == NULL ? "" : kind,
! uep,
! vep,
state,
traversal_mark,
line);
}
};
--- 58,73 ----
address uep;
int line;
void print() {
tty->print_cr("traversal = %d compile_id = %d %s uep = " PTR_FORMAT " vep = "
! PTR_FORMAT " state = %d traversal_mark %ld line = %d",
traversal,
compile_id,
kind == NULL ? "" : kind,
! p2i(uep),
! p2i(vep),
state,
traversal_mark,
line);
}
};
*** 221,231 ****
_current.next();
_traversals += 1;
_total_time_this_sweep = Tickspan();
if (PrintMethodFlushing) {
! tty->print_cr("### Sweep: stack traversal %d", _traversals);
}
Threads::nmethods_do(&mark_activation_closure);
} else {
// Only set hotness counter
--- 219,229 ----
_current.next();
_traversals += 1;
_total_time_this_sweep = Tickspan();
if (PrintMethodFlushing) {
! tty->print_cr("### Sweep: stack traversal %ld", _traversals);
}
Threads::nmethods_do(&mark_activation_closure);
} else {
// Only set hotness counter
*** 480,490 ****
event.commit();
}
#ifdef ASSERT
if(PrintMethodFlushing) {
! tty->print_cr("### sweeper: sweep time(%d): ", (jlong)sweep_time.value());
}
#endif
log_sweep("finished");
--- 478,488 ----
event.commit();
}
#ifdef ASSERT
if(PrintMethodFlushing) {
! tty->print_cr("### sweeper: sweep time(" INT64_FORMAT "): ", (jlong)sweep_time.value());
}
#endif
log_sweep("finished");
*** 590,607 ****
// 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()) {
assert(!nm->is_locked_by_vm(), "must not flush locked nmethods");
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), nm);
}
release_nmethod(nm);
assert(result == None, "sanity");
result = Flushed;
} else {
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), nm);
}
nm->mark_for_reclamation();
// Keep track of code cache state change
_bytes_changed += nm->total_size();
SWEEP(nm);
--- 588,605 ----
// 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()) {
assert(!nm->is_locked_by_vm(), "must not flush locked nmethods");
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (marked for reclamation) being flushed", nm->compile_id(), p2i(nm));
}
release_nmethod(nm);
assert(result == None, "sanity");
result = Flushed;
} else {
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (zombie) being marked for reclamation", nm->compile_id(), p2i(nm));
}
nm->mark_for_reclamation();
// Keep track of code cache state change
_bytes_changed += nm->total_size();
SWEEP(nm);
*** 617,627 ****
{
MutexLocker cl(CompiledIC_lock);
nm->clear_ic_stubs();
}
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), nm);
}
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
SWEEP(nm);
assert(result == None, "sanity");
--- 615,625 ----
{
MutexLocker cl(CompiledIC_lock);
nm->clear_ic_stubs();
}
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (not entrant) being made zombie", nm->compile_id(), p2i(nm));
}
// Code cache state change is tracked in make_zombie()
nm->make_zombie();
SWEEP(nm);
assert(result == None, "sanity");
*** 634,644 ****
SWEEP(nm);
}
} else if (nm->is_unloaded()) {
// Unloaded code, just make it a zombie
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), nm);
}
if (nm->is_osr_method()) {
SWEEP(nm);
// No inline caches will ever point to osr methods, so we can just remove it
release_nmethod(nm);
--- 632,642 ----
SWEEP(nm);
}
} else if (nm->is_unloaded()) {
// Unloaded code, just make it a zombie
if (PrintMethodFlushing && Verbose) {
! tty->print_cr("### Nmethod %3d/" PTR_FORMAT " (unloaded) being made zombie", nm->compile_id(), p2i(nm));
}
if (nm->is_osr_method()) {
SWEEP(nm);
// No inline caches will ever point to osr methods, so we can just remove it
release_nmethod(nm);
*** 741,751 ****
nm->make_not_entrant();
// Code cache state change is tracked in make_not_entrant()
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %d/" PTR_FORMAT "made not-entrant: hotness counter %d/%d threshold %f",
! nm->compile_id(), nm, nm->hotness_counter(), reset_val, threshold);
}
}
}
}
}
--- 739,749 ----
nm->make_not_entrant();
// Code cache state change is tracked in make_not_entrant()
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Nmethod %d/" PTR_FORMAT "made not-entrant: hotness counter %d/%d threshold %f",
! nm->compile_id(), p2i(nm), nm->hotness_counter(), reset_val, threshold);
}
}
}
}
}
< prev index next >