From c0d89b4eebfb427b80e358ff288efdd9da7bdc68 Mon Sep 17 00:00:00 2001 From: Lei Zaakjyu Date: Fri, 15 Dec 2023 23:34:00 +0800 Subject: [PATCH] remove 'supports_vtime' --- src/hotspot/os/posix/os_posix.cpp | 2 -- src/hotspot/os/windows/os_windows.cpp | 2 -- src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp | 6 +----- src/hotspot/share/runtime/os.hpp | 1 - 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/hotspot/os/posix/os_posix.cpp b/src/hotspot/os/posix/os_posix.cpp index 960fb465590cc..22f9f2a0e2d6e 100644 --- a/src/hotspot/os/posix/os_posix.cpp +++ b/src/hotspot/os/posix/os_posix.cpp @@ -1434,8 +1434,6 @@ jlong os::elapsed_frequency() { return NANOSECS_PER_SEC; // nanosecond resolution } -bool os::supports_vtime() { return true; } - // Return the real, user, and system times in seconds from an // arbitrary fixed point in the past. bool os::getTimesSecs(double* process_real_time, diff --git a/src/hotspot/os/windows/os_windows.cpp b/src/hotspot/os/windows/os_windows.cpp index 223bc0bd13514..3fb73422a7ee9 100644 --- a/src/hotspot/os/windows/os_windows.cpp +++ b/src/hotspot/os/windows/os_windows.cpp @@ -1049,8 +1049,6 @@ FILETIME java_to_windows_time(jlong l) { return result; } -bool os::supports_vtime() { return true; } - double os::elapsedVTime() { FILETIME created; FILETIME exited; diff --git a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp index 0711b61b194fb..664944b8aaace 100644 --- a/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp +++ b/src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp @@ -74,11 +74,7 @@ class G1ConcurrentRefineThread: public ConcurrentGCThread { // Update concurrent refine threads stats. // If we are in Primary thread, we additionally update CPU time tracking. virtual void track_usage() { - if (os::supports_vtime()) { - _vtime_accum = (os::elapsedVTime() - _vtime_start); - } else { - _vtime_accum = 0.0; - } + _vtime_accum = (os::elapsedVTime() - _vtime_start); }; // Helper for do_refinement_step implementations. Try to perform some diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp index 094fd2509a05b..780aaadda29ef 100644 --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -281,7 +281,6 @@ class os: AllStatic { // actually run. The first function indicates whether the OS supports // this functionality for the current thread, and if so the second // returns the elapsed virtual time for the current thread. - static bool supports_vtime(); static double elapsedVTime(); // Return current local time in a string (YYYY-MM-DD HH:MM:SS).