145
146 const Ticks gc_start() const { return _gc_start; }
147 const Ticks gc_end() const { return _gc_end; }
148
149 TimePartitions* time_partitions() { return &_time_partitions; }
150
151 protected:
152 void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
153 void register_gc_pause_end(const Ticks& time = Ticks::now());
154 };
155
156 class STWGCTimer : public GCTimer {
157 public:
158 virtual void register_gc_start(const Ticks& time = Ticks::now());
159 virtual void register_gc_end(const Ticks& time = Ticks::now());
160 };
161
162 class ConcurrentGCTimer : public GCTimer {
163 // ConcurrentGCTimer can't be used if there is an overlap between a pause phase and a concurrent phase.
164 // _is_concurrent_phase_active is used to find above case.
165 NOT_PRODUCT(volatile bool _is_concurrent_phase_active;)
166
167 public:
168 #ifndef PRODUCT
169 ConcurrentGCTimer(): GCTimer(), _is_concurrent_phase_active(false) {};
170 #endif
171
172 void register_gc_pause_start(const char* name);
173 void register_gc_pause_end();
174
175 void register_gc_concurrent_start(const char* name, const Ticks& time = Ticks::now());
176 void register_gc_concurrent_end(const Ticks& time = Ticks::now());
177 };
178
179 class TimePartitionPhasesIterator {
180 TimePartitions* _time_partitions;
181 int _next;
182
183 public:
184 TimePartitionPhasesIterator(TimePartitions* time_partitions) : _time_partitions(time_partitions), _next(0) { }
185
186 virtual bool has_next();
187 virtual GCPhase* next();
188 };
189
190
|
145
146 const Ticks gc_start() const { return _gc_start; }
147 const Ticks gc_end() const { return _gc_end; }
148
149 TimePartitions* time_partitions() { return &_time_partitions; }
150
151 protected:
152 void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
153 void register_gc_pause_end(const Ticks& time = Ticks::now());
154 };
155
156 class STWGCTimer : public GCTimer {
157 public:
158 virtual void register_gc_start(const Ticks& time = Ticks::now());
159 virtual void register_gc_end(const Ticks& time = Ticks::now());
160 };
161
162 class ConcurrentGCTimer : public GCTimer {
163 // ConcurrentGCTimer can't be used if there is an overlap between a pause phase and a concurrent phase.
164 // _is_concurrent_phase_active is used to find above case.
165 bool _is_concurrent_phase_active;
166
167 public:
168 ConcurrentGCTimer(): GCTimer(), _is_concurrent_phase_active(false) {};
169
170 void register_gc_pause_start(const char* name);
171 void register_gc_pause_end();
172
173 void register_gc_concurrent_start(const char* name, const Ticks& time = Ticks::now());
174 void register_gc_concurrent_end(const Ticks& time = Ticks::now());
175 };
176
177 class TimePartitionPhasesIterator {
178 TimePartitions* _time_partitions;
179 int _next;
180
181 public:
182 TimePartitionPhasesIterator(TimePartitions* time_partitions) : _time_partitions(time_partitions), _next(0) { }
183
184 virtual bool has_next();
185 virtual GCPhase* next();
186 };
187
188
|