--- old/src/share/vm/runtime/sweeper.cpp 2013-11-11 18:33:33.300764699 +0100 +++ new/src/share/vm/runtime/sweeper.cpp 2013-11-11 18:33:32.867748257 +0100 @@ -38,6 +38,7 @@ #include "runtime/vm_operations.hpp" #include "trace/tracing.hpp" #include "utilities/events.hpp" +#include "utilities/ticks.inline.hpp" #include "utilities/xmlstream.hpp" #ifdef ASSERT @@ -142,11 +143,11 @@ bool NMethodSweeper::_request_mark_phase = false; int NMethodSweeper::_total_nof_methods_reclaimed = 0; -jlong NMethodSweeper::_total_time_sweeping = 0; -jlong NMethodSweeper::_total_time_this_sweep = 0; -jlong NMethodSweeper::_peak_sweep_time = 0; -jlong NMethodSweeper::_peak_sweep_fraction_time = 0; -int NMethodSweeper::_hotness_counter_reset_val = 0; +Tickspan NMethodSweeper::_total_time_sweeping; +Tickspan NMethodSweeper::_total_time_this_sweep; +Tickspan NMethodSweeper::_peak_sweep_time; +Tickspan NMethodSweeper::_peak_sweep_fraction_time; +int NMethodSweeper::_hotness_counter_reset_val = 0; class MarkActivationClosure: public CodeBlobClosure { @@ -204,7 +205,7 @@ _invocations = NmethodSweepFraction; _current = CodeCache::first_nmethod(); _traversals += 1; - _total_time_this_sweep = 0; + _total_time_this_sweep = Tickspan(); if (PrintMethodFlushing) { tty->print_cr("### Sweep: stack traversal %d", _traversals); @@ -252,7 +253,7 @@ void NMethodSweeper::sweep_code_cache() { - jlong sweep_start_counter = os::elapsed_counter(); + const Ticks sweep_start_counter = Ticks::now(); _flushed_count = 0; _zombified_count = 0; @@ -328,8 +329,8 @@ } } - jlong sweep_end_counter = os::elapsed_counter(); - jlong sweep_time = sweep_end_counter - sweep_start_counter; + const Ticks sweep_end_counter = Ticks::now(); + const Tickspan sweep_time = sweep_end_counter - sweep_start_counter; _total_time_sweeping += sweep_time; _total_time_this_sweep += sweep_time; _peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time); @@ -350,7 +351,7 @@ #ifdef ASSERT if(PrintMethodFlushing) { - tty->print_cr("### sweeper: sweep time(%d): " INT64_FORMAT, _invocations, (jlong)sweep_time); + tty->print_cr("### sweeper: sweep time(%d): " INT64_FORMAT, _invocations, sweep_time.value()); } #endif