--- old/src/share/vm/runtime/timer.hpp 2015-02-18 13:24:54.125923090 +0100 +++ new/src/share/vm/runtime/timer.hpp 2015-02-18 13:24:54.061921191 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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 @@ -103,6 +103,23 @@ void resume() { if (_active) _t.start(); } }; +class PhaseTimeData : public StackObj { +public: + virtual bool active() const = 0; + virtual void set_value(uint phase, double value) = 0; +}; + +class TrackPhaseTime : public StackObj { + private: + PhaseTimeData* _data; + uint _phase; + jlong _last; + public: + // Constructors + TrackPhaseTime(PhaseTimeData *data, uint phase); + ~TrackPhaseTime(); +}; + class TraceCPUTime: public StackObj { private: bool _active; // true if times will be measured and printed