RFR: 8316967: Remove unnecessary vmtimer from UnregisteredClasses::load_class
Calvin Cheung
ccheung at openjdk.org
Thu Oct 5 19:33:08 UTC 2023
On Thu, 5 Oct 2023 03:10:35 GMT, David Holmes <dholmes at openjdk.org> wrote:
> As it stands this timer doesn't measure anything, but presumably the intent was to measure the execution time of this method? So why not just fix the scope of the timer rather than removing it?
Based on the file history, the `unregisterClasses.cpp` was created for 826194 (Use ClassLoader for unregistered classes during -Xshare:dump). The `UnregisteredClasses::load_class` function was originally in `ClassLoaderExt::load_class` where it used the vmtimer to measure the following:
{
PerfClassTraceTime vmtimer(perf_sys_class_lookup_time(),
THREAD->get_thread_stat()->perf_timers_addr(),
PerfClassTraceTime::CLASS_LOAD);
stream = e->open_stream(THREAD, file_name);
}
After the fix for 8261914, the open_stream call is not needed and thus we left with the code in the current state.
I think it's reasonable to have the vmtimer to measure the entire `UnregisteredClasses::load_class`. This means the fix would just remove the braces around the constructor call.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16046#issuecomment-1749521869
More information about the hotspot-runtime-dev
mailing list