--- old/src/hotspot/share/gc/shared/gcTraceTime.hpp 2020-02-24 07:47:40.429082470 +0000 +++ new/src/hotspot/share/gc/shared/gcTraceTime.hpp 2020-02-24 07:47:40.169081051 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,10 +43,11 @@ class GCTimer; +template class GCTraceTimeImpl : public StackObj { private: - LogTargetHandle _out_start; - LogTargetHandle _out_stop; + Handle1 _out_start; + Handle2 _out_stop; bool _enabled; Ticks _start_ticks; const char* _title; @@ -59,18 +60,25 @@ void time_stamp(Ticks& ticks); public: - GCTraceTimeImpl(LogTargetHandle out_start, LogTargetHandle out_end, const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); + GCTraceTimeImpl(Handle1 out_start, Handle2 out_end, const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); ~GCTraceTimeImpl(); }; template class GCTraceTimeImplWrapper : public StackObj { - GCTraceTimeImpl _impl; + typedef GCTraceTimeImpl handle_t; + const handle_t _impl; public: GCTraceTimeImplWrapper(const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); - ~GCTraceTimeImplWrapper(); }; +template +class GCAsyncTraceTimeImplWrapper : public StackObj { + typedef GCTraceTimeImpl handle_t; + const handle_t _impl; +public: + GCAsyncTraceTimeImplWrapper(const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); +}; // Similar to GCTraceTimeImpl but is intended for concurrent phase logging, // which is a bit simpler and should always print the start line, i.e. not add the "start" tag. template