52 53 void GCTimer::register_gc_phase_start(const char* name, const Ticks& time) { 54 _time_partitions.report_gc_phase_start(name, time); 55 } 56 57 void GCTimer::register_gc_phase_end(const Ticks& time) { 58 _time_partitions.report_gc_phase_end(time); 59 } 60 61 void STWGCTimer::register_gc_start(const Ticks& time) { 62 GCTimer::register_gc_start(time); 63 register_gc_pause_start("GC Pause", time); 64 } 65 66 void STWGCTimer::register_gc_end(const Ticks& time) { 67 register_gc_pause_end(time); 68 GCTimer::register_gc_end(time); 69 } 70 71 void ConcurrentGCTimer::register_gc_pause_start(const char* name) { 72 GCTimer::register_gc_pause_start(name); 73 } 74 75 void ConcurrentGCTimer::register_gc_pause_end() { 76 GCTimer::register_gc_pause_end(); 77 } 78 79 void PhasesStack::clear() { 80 _next_phase_level = 0; 81 } 82 83 void PhasesStack::push(int phase_index) { 84 assert(_next_phase_level < PHASE_LEVELS, "Overflow"); 85 86 _phase_indices[_next_phase_level] = phase_index; 87 88 _next_phase_level++; 89 } 90 91 int PhasesStack::pop() { 92 assert(_next_phase_level > 0, "Underflow"); 93 94 _next_phase_level--; 95 96 return _phase_indices[_next_phase_level]; 97 } 98 99 int PhasesStack::count() const { 100 return _next_phase_level; 101 } 102 103 104 TimePartitions::TimePartitions() { 105 _phases = new (ResourceObj::C_HEAP, mtGC) GrowableArray<PausePhase>(INITIAL_CAPACITY, true, mtGC); 106 clear(); 107 } 108 109 TimePartitions::~TimePartitions() { 110 delete _phases; 111 _phases = NULL; 112 } 113 114 void TimePartitions::clear() { 115 _phases->clear(); 116 _active_phases.clear(); 117 _sum_of_pauses = Tickspan(); 118 _longest_pause = Tickspan(); 119 } 120 121 void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time) { 122 assert(_phases->length() <= 1000, "Too many recored phases?"); 123 124 int level = _active_phases.count(); 125 126 PausePhase phase; 127 phase.set_level(level); 128 phase.set_name(name); 129 phase.set_start(time); 130 131 int index = _phases->append(phase); 132 133 _active_phases.push(index); 134 } 135 136 void TimePartitions::update_statistics(GCPhase* phase) { 137 // FIXME: This should only be done for pause phases 138 if (phase->level() == 0) { 139 const Tickspan pause = phase->end() - phase->start(); 140 _sum_of_pauses += pause; 141 _longest_pause = MAX2(pause, _longest_pause); 142 } 143 } 144 145 void TimePartitions::report_gc_phase_end(const Ticks& time) { 146 int phase_index = _active_phases.pop(); 147 GCPhase* phase = _phases->adr_at(phase_index); 148 phase->set_end(time); 149 update_statistics(phase); 150 } 151 152 int TimePartitions::num_phases() const { 153 return _phases->length(); 154 } 155 156 GCPhase* TimePartitions::phase_at(int index) const { 157 assert(index >= 0, "Out of bounds"); 158 assert(index < _phases->length(), "Out of bounds"); 159 160 return _phases->adr_at(index); 161 } 162 163 bool TimePartitions::has_active_phases() { 164 return _active_phases.count() > 0; 165 } 170 171 GCPhase* TimePartitionPhasesIterator::next() { 172 assert(has_next(), "Must have phases left"); 173 return _time_partitions->phase_at(_next++); 174 } 175 176 177 /////////////// Unit tests /////////////// 178 179 #ifndef PRODUCT 180 181 class TimePartitionPhasesIteratorTest { 182 public: 183 static void all() { 184 one_pause(); 185 two_pauses(); 186 one_sub_pause_phase(); 187 many_sub_pause_phases(); 188 many_sub_pause_phases2(); 189 max_nested_pause_phases(); 190 } 191 192 static void validate_pause_phase(GCPhase* phase, int level, const char* name, const Ticks& start, const Ticks& end) { 193 assert(phase->level() == level, "Incorrect level"); 194 assert(strcmp(phase->name(), name) == 0, "Incorrect name"); 195 assert(phase->start() == start, "Incorrect start"); 196 assert(phase->end() == end, "Incorrect end"); 197 } 198 199 static void one_pause() { 200 TimePartitions time_partitions; 201 time_partitions.report_gc_phase_start("PausePhase", 2); 202 time_partitions.report_gc_phase_end(8); 203 204 TimePartitionPhasesIterator iter(&time_partitions); 205 206 validate_pause_phase(iter.next(), 0, "PausePhase", 2, 8); 207 assert(time_partitions.sum_of_pauses() == Ticks(8) - Ticks(2), "Incorrect"); 208 assert(time_partitions.longest_pause() == Ticks(8) - Ticks(2), "Incorrect"); 209 210 assert(!iter.has_next(), "Too many elements"); 211 } 212 213 static void two_pauses() { 214 TimePartitions time_partitions; 215 time_partitions.report_gc_phase_start("PausePhase1", 2); 216 time_partitions.report_gc_phase_end(3); 217 time_partitions.report_gc_phase_start("PausePhase2", 4); 218 time_partitions.report_gc_phase_end(6); 219 220 TimePartitionPhasesIterator iter(&time_partitions); 221 222 validate_pause_phase(iter.next(), 0, "PausePhase1", 2, 3); 223 validate_pause_phase(iter.next(), 0, "PausePhase2", 4, 6); 224 225 assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); 226 assert(time_partitions.longest_pause() == Ticks(2) - Ticks(0), "Incorrect"); 227 228 assert(!iter.has_next(), "Too many elements"); 229 } 230 231 static void one_sub_pause_phase() { 232 TimePartitions time_partitions; 233 time_partitions.report_gc_phase_start("PausePhase", 2); 234 time_partitions.report_gc_phase_start("SubPhase", 3); 235 time_partitions.report_gc_phase_end(4); 236 time_partitions.report_gc_phase_end(5); 237 238 TimePartitionPhasesIterator iter(&time_partitions); 239 240 validate_pause_phase(iter.next(), 0, "PausePhase", 2, 5); 241 validate_pause_phase(iter.next(), 1, "SubPhase", 3, 4); 242 243 assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); 244 assert(time_partitions.longest_pause() == Ticks(3) - Ticks(0), "Incorrect"); 245 246 assert(!iter.has_next(), "Too many elements"); 247 } 248 249 static void max_nested_pause_phases() { 250 TimePartitions time_partitions; 251 time_partitions.report_gc_phase_start("PausePhase", 2); 252 time_partitions.report_gc_phase_start("SubPhase1", 3); 253 time_partitions.report_gc_phase_start("SubPhase2", 4); 254 time_partitions.report_gc_phase_start("SubPhase3", 5); 255 time_partitions.report_gc_phase_end(6); 256 time_partitions.report_gc_phase_end(7); 257 time_partitions.report_gc_phase_end(8); 258 time_partitions.report_gc_phase_end(9); 259 260 TimePartitionPhasesIterator iter(&time_partitions); 261 262 validate_pause_phase(iter.next(), 0, "PausePhase", 2, 9); 263 validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 8); 264 validate_pause_phase(iter.next(), 2, "SubPhase2", 4, 7); 265 validate_pause_phase(iter.next(), 3, "SubPhase3", 5, 6); 266 267 assert(time_partitions.sum_of_pauses() == Ticks(7) - Ticks(0), "Incorrect"); 268 assert(time_partitions.longest_pause() == Ticks(7) - Ticks(0), "Incorrect"); 269 270 assert(!iter.has_next(), "Too many elements"); 271 } 272 273 static void many_sub_pause_phases() { 274 TimePartitions time_partitions; 275 time_partitions.report_gc_phase_start("PausePhase", 2); 276 277 time_partitions.report_gc_phase_start("SubPhase1", 3); 278 time_partitions.report_gc_phase_end(4); 279 time_partitions.report_gc_phase_start("SubPhase2", 5); 280 time_partitions.report_gc_phase_end(6); 281 time_partitions.report_gc_phase_start("SubPhase3", 7); 282 time_partitions.report_gc_phase_end(8); 283 time_partitions.report_gc_phase_start("SubPhase4", 9); 284 time_partitions.report_gc_phase_end(10); 285 286 time_partitions.report_gc_phase_end(11); 287 288 TimePartitionPhasesIterator iter(&time_partitions); 289 290 validate_pause_phase(iter.next(), 0, "PausePhase", 2, 11); 291 validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 4); 292 validate_pause_phase(iter.next(), 1, "SubPhase2", 5, 6); 293 validate_pause_phase(iter.next(), 1, "SubPhase3", 7, 8); 294 validate_pause_phase(iter.next(), 1, "SubPhase4", 9, 10); 295 296 assert(time_partitions.sum_of_pauses() == Ticks(9) - Ticks(0), "Incorrect"); 297 assert(time_partitions.longest_pause() == Ticks(9) - Ticks(0), "Incorrect"); 298 299 assert(!iter.has_next(), "Too many elements"); 300 } 301 302 static void many_sub_pause_phases2() { 303 TimePartitions time_partitions; 304 time_partitions.report_gc_phase_start("PausePhase", 2); 305 306 time_partitions.report_gc_phase_start("SubPhase1", 3); 307 time_partitions.report_gc_phase_start("SubPhase11", 4); 308 time_partitions.report_gc_phase_end(5); 309 time_partitions.report_gc_phase_start("SubPhase12", 6); 310 time_partitions.report_gc_phase_end(7); 311 time_partitions.report_gc_phase_end(8); 312 time_partitions.report_gc_phase_start("SubPhase2", 9); 313 time_partitions.report_gc_phase_start("SubPhase21", 10); 314 time_partitions.report_gc_phase_end(11); 315 time_partitions.report_gc_phase_start("SubPhase22", 12); 316 time_partitions.report_gc_phase_end(13); 317 time_partitions.report_gc_phase_end(14); 318 time_partitions.report_gc_phase_start("SubPhase3", 15); 319 time_partitions.report_gc_phase_end(16); 320 321 time_partitions.report_gc_phase_end(17); 322 323 TimePartitionPhasesIterator iter(&time_partitions); 324 325 validate_pause_phase(iter.next(), 0, "PausePhase", 2, 17); 326 validate_pause_phase(iter.next(), 1, "SubPhase1", 3, 8); 327 validate_pause_phase(iter.next(), 2, "SubPhase11", 4, 5); 328 validate_pause_phase(iter.next(), 2, "SubPhase12", 6, 7); 329 validate_pause_phase(iter.next(), 1, "SubPhase2", 9, 14); 330 validate_pause_phase(iter.next(), 2, "SubPhase21", 10, 11); 331 validate_pause_phase(iter.next(), 2, "SubPhase22", 12, 13); 332 validate_pause_phase(iter.next(), 1, "SubPhase3", 15, 16); 333 334 assert(time_partitions.sum_of_pauses() == Ticks(15) - Ticks(0), "Incorrect"); 335 assert(time_partitions.longest_pause() == Ticks(15) - Ticks(0), "Incorrect"); 336 337 assert(!iter.has_next(), "Too many elements"); 338 } 339 }; 340 341 class GCTimerTest { 342 public: 343 static void all() { 344 gc_start(); 345 gc_end(); 346 } 347 348 static void gc_start() { 349 GCTimer gc_timer; 350 gc_timer.register_gc_start(1); 351 352 assert(gc_timer.gc_start() == 1, "Incorrect"); 353 } 354 355 static void gc_end() { | 52 53 void GCTimer::register_gc_phase_start(const char* name, const Ticks& time) { 54 _time_partitions.report_gc_phase_start(name, time); 55 } 56 57 void GCTimer::register_gc_phase_end(const Ticks& time) { 58 _time_partitions.report_gc_phase_end(time); 59 } 60 61 void STWGCTimer::register_gc_start(const Ticks& time) { 62 GCTimer::register_gc_start(time); 63 register_gc_pause_start("GC Pause", time); 64 } 65 66 void STWGCTimer::register_gc_end(const Ticks& time) { 67 register_gc_pause_end(time); 68 GCTimer::register_gc_end(time); 69 } 70 71 void ConcurrentGCTimer::register_gc_pause_start(const char* name) { 72 assert(!_is_concurrent_phase_active, "A pause phase can't be started while a concurrent phase is active."); 73 GCTimer::register_gc_pause_start(name); 74 } 75 76 void ConcurrentGCTimer::register_gc_pause_end() { 77 assert(!_is_concurrent_phase_active, "A pause phase can't be ended while a concurrent phase is active."); 78 GCTimer::register_gc_pause_end(); 79 } 80 81 void ConcurrentGCTimer::register_gc_concurrent_start(const char* name, const Ticks& time) { 82 assert(!_is_concurrent_phase_active, "A concurrent phase is already active."); 83 _time_partitions.report_gc_phase_start(name, time, GCPhase::ConcurrentPhaseType); 84 NOT_PRODUCT(_is_concurrent_phase_active = true;) 85 } 86 87 void ConcurrentGCTimer::register_gc_concurrent_end(const Ticks& time) { 88 assert(_is_concurrent_phase_active, "A concurrent phase is not active."); 89 _time_partitions.report_gc_phase_end(time, GCPhase::ConcurrentPhaseType); 90 NOT_PRODUCT(_is_concurrent_phase_active = false;) 91 } 92 93 void PhasesStack::clear() { 94 _next_phase_level = 0; 95 } 96 97 void PhasesStack::push(int phase_index) { 98 assert(_next_phase_level < PHASE_LEVELS, "Overflow"); 99 100 _phase_indices[_next_phase_level] = phase_index; 101 _next_phase_level++; 102 } 103 104 int PhasesStack::pop() { 105 assert(_next_phase_level > 0, "Underflow"); 106 107 _next_phase_level--; 108 return _phase_indices[_next_phase_level]; 109 } 110 111 int PhasesStack::count() const { 112 return _next_phase_level; 113 } 114 115 TimePartitions::TimePartitions() { 116 _phases = new (ResourceObj::C_HEAP, mtGC) GrowableArray<GCPhase>(INITIAL_CAPACITY, true, mtGC); 117 clear(); 118 } 119 120 TimePartitions::~TimePartitions() { 121 delete _phases; 122 _phases = NULL; 123 } 124 125 void TimePartitions::clear() { 126 _phases->clear(); 127 _active_phases.clear(); 128 _sum_of_pauses = Tickspan(); 129 _longest_pause = Tickspan(); 130 } 131 132 void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type) { 133 assert(_phases->length() <= 1000, "Too many recored phases?"); 134 135 int level = _active_phases.count(); 136 137 GCPhase phase; 138 phase.set_type(type); 139 phase.set_level(level); 140 phase.set_name(name); 141 phase.set_start(time); 142 143 int index = _phases->append(phase); 144 145 _active_phases.push(index); 146 } 147 148 void TimePartitions::update_statistics(GCPhase* phase) { 149 if ((phase->type() == GCPhase::PausePhaseType) && (phase->level() == 0)) { 150 const Tickspan pause = phase->end() - phase->start(); 151 _sum_of_pauses += pause; 152 _longest_pause = MAX2(pause, _longest_pause); 153 } 154 } 155 156 void TimePartitions::report_gc_phase_end(const Ticks& time, GCPhase::PhaseType type) { 157 int phase_index = _active_phases.pop(); 158 GCPhase* phase = _phases->adr_at(phase_index); 159 phase->set_end(time); 160 update_statistics(phase); 161 } 162 163 int TimePartitions::num_phases() const { 164 return _phases->length(); 165 } 166 167 GCPhase* TimePartitions::phase_at(int index) const { 168 assert(index >= 0, "Out of bounds"); 169 assert(index < _phases->length(), "Out of bounds"); 170 171 return _phases->adr_at(index); 172 } 173 174 bool TimePartitions::has_active_phases() { 175 return _active_phases.count() > 0; 176 } 181 182 GCPhase* TimePartitionPhasesIterator::next() { 183 assert(has_next(), "Must have phases left"); 184 return _time_partitions->phase_at(_next++); 185 } 186 187 188 /////////////// Unit tests /////////////// 189 190 #ifndef PRODUCT 191 192 class TimePartitionPhasesIteratorTest { 193 public: 194 static void all() { 195 one_pause(); 196 two_pauses(); 197 one_sub_pause_phase(); 198 many_sub_pause_phases(); 199 many_sub_pause_phases2(); 200 max_nested_pause_phases(); 201 one_concurrent(); 202 } 203 204 static void validate_gc_phase(GCPhase* phase, int level, const char* name, const Ticks& start, const Ticks& end) { 205 assert(phase->level() == level, "Incorrect level"); 206 assert(strcmp(phase->name(), name) == 0, "Incorrect name"); 207 assert(phase->start() == start, "Incorrect start"); 208 assert(phase->end() == end, "Incorrect end"); 209 } 210 211 static void one_pause() { 212 TimePartitions time_partitions; 213 time_partitions.report_gc_phase_start("PausePhase", 2); 214 time_partitions.report_gc_phase_end(8); 215 216 TimePartitionPhasesIterator iter(&time_partitions); 217 218 validate_gc_phase(iter.next(), 0, "PausePhase", 2, 8); 219 assert(time_partitions.sum_of_pauses() == Ticks(8) - Ticks(2), "Incorrect"); 220 assert(time_partitions.longest_pause() == Ticks(8) - Ticks(2), "Incorrect"); 221 222 assert(!iter.has_next(), "Too many elements"); 223 } 224 225 static void two_pauses() { 226 TimePartitions time_partitions; 227 time_partitions.report_gc_phase_start("PausePhase1", 2); 228 time_partitions.report_gc_phase_end(3); 229 time_partitions.report_gc_phase_start("PausePhase2", 4); 230 time_partitions.report_gc_phase_end(6); 231 232 TimePartitionPhasesIterator iter(&time_partitions); 233 234 validate_gc_phase(iter.next(), 0, "PausePhase1", 2, 3); 235 validate_gc_phase(iter.next(), 0, "PausePhase2", 4, 6); 236 237 assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); 238 assert(time_partitions.longest_pause() == Ticks(2) - Ticks(0), "Incorrect"); 239 240 assert(!iter.has_next(), "Too many elements"); 241 } 242 243 static void one_sub_pause_phase() { 244 TimePartitions time_partitions; 245 time_partitions.report_gc_phase_start("PausePhase", 2); 246 time_partitions.report_gc_phase_start("SubPhase", 3); 247 time_partitions.report_gc_phase_end(4); 248 time_partitions.report_gc_phase_end(5); 249 250 TimePartitionPhasesIterator iter(&time_partitions); 251 252 validate_gc_phase(iter.next(), 0, "PausePhase", 2, 5); 253 validate_gc_phase(iter.next(), 1, "SubPhase", 3, 4); 254 255 assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect"); 256 assert(time_partitions.longest_pause() == Ticks(3) - Ticks(0), "Incorrect"); 257 258 assert(!iter.has_next(), "Too many elements"); 259 } 260 261 static void max_nested_pause_phases() { 262 TimePartitions time_partitions; 263 time_partitions.report_gc_phase_start("PausePhase", 2); 264 time_partitions.report_gc_phase_start("SubPhase1", 3); 265 time_partitions.report_gc_phase_start("SubPhase2", 4); 266 time_partitions.report_gc_phase_start("SubPhase3", 5); 267 time_partitions.report_gc_phase_end(6); 268 time_partitions.report_gc_phase_end(7); 269 time_partitions.report_gc_phase_end(8); 270 time_partitions.report_gc_phase_end(9); 271 272 TimePartitionPhasesIterator iter(&time_partitions); 273 274 validate_gc_phase(iter.next(), 0, "PausePhase", 2, 9); 275 validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 8); 276 validate_gc_phase(iter.next(), 2, "SubPhase2", 4, 7); 277 validate_gc_phase(iter.next(), 3, "SubPhase3", 5, 6); 278 279 assert(time_partitions.sum_of_pauses() == Ticks(7) - Ticks(0), "Incorrect"); 280 assert(time_partitions.longest_pause() == Ticks(7) - Ticks(0), "Incorrect"); 281 282 assert(!iter.has_next(), "Too many elements"); 283 } 284 285 static void many_sub_pause_phases() { 286 TimePartitions time_partitions; 287 time_partitions.report_gc_phase_start("PausePhase", 2); 288 289 time_partitions.report_gc_phase_start("SubPhase1", 3); 290 time_partitions.report_gc_phase_end(4); 291 time_partitions.report_gc_phase_start("SubPhase2", 5); 292 time_partitions.report_gc_phase_end(6); 293 time_partitions.report_gc_phase_start("SubPhase3", 7); 294 time_partitions.report_gc_phase_end(8); 295 time_partitions.report_gc_phase_start("SubPhase4", 9); 296 time_partitions.report_gc_phase_end(10); 297 298 time_partitions.report_gc_phase_end(11); 299 300 TimePartitionPhasesIterator iter(&time_partitions); 301 302 validate_gc_phase(iter.next(), 0, "PausePhase", 2, 11); 303 validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 4); 304 validate_gc_phase(iter.next(), 1, "SubPhase2", 5, 6); 305 validate_gc_phase(iter.next(), 1, "SubPhase3", 7, 8); 306 validate_gc_phase(iter.next(), 1, "SubPhase4", 9, 10); 307 308 assert(time_partitions.sum_of_pauses() == Ticks(9) - Ticks(0), "Incorrect"); 309 assert(time_partitions.longest_pause() == Ticks(9) - Ticks(0), "Incorrect"); 310 311 assert(!iter.has_next(), "Too many elements"); 312 } 313 314 static void many_sub_pause_phases2() { 315 TimePartitions time_partitions; 316 time_partitions.report_gc_phase_start("PausePhase", 2); 317 318 time_partitions.report_gc_phase_start("SubPhase1", 3); 319 time_partitions.report_gc_phase_start("SubPhase11", 4); 320 time_partitions.report_gc_phase_end(5); 321 time_partitions.report_gc_phase_start("SubPhase12", 6); 322 time_partitions.report_gc_phase_end(7); 323 time_partitions.report_gc_phase_end(8); 324 time_partitions.report_gc_phase_start("SubPhase2", 9); 325 time_partitions.report_gc_phase_start("SubPhase21", 10); 326 time_partitions.report_gc_phase_end(11); 327 time_partitions.report_gc_phase_start("SubPhase22", 12); 328 time_partitions.report_gc_phase_end(13); 329 time_partitions.report_gc_phase_end(14); 330 time_partitions.report_gc_phase_start("SubPhase3", 15); 331 time_partitions.report_gc_phase_end(16); 332 333 time_partitions.report_gc_phase_end(17); 334 335 TimePartitionPhasesIterator iter(&time_partitions); 336 337 validate_gc_phase(iter.next(), 0, "PausePhase", 2, 17); 338 validate_gc_phase(iter.next(), 1, "SubPhase1", 3, 8); 339 validate_gc_phase(iter.next(), 2, "SubPhase11", 4, 5); 340 validate_gc_phase(iter.next(), 2, "SubPhase12", 6, 7); 341 validate_gc_phase(iter.next(), 1, "SubPhase2", 9, 14); 342 validate_gc_phase(iter.next(), 2, "SubPhase21", 10, 11); 343 validate_gc_phase(iter.next(), 2, "SubPhase22", 12, 13); 344 validate_gc_phase(iter.next(), 1, "SubPhase3", 15, 16); 345 346 assert(time_partitions.sum_of_pauses() == Ticks(15) - Ticks(0), "Incorrect"); 347 assert(time_partitions.longest_pause() == Ticks(15) - Ticks(0), "Incorrect"); 348 349 assert(!iter.has_next(), "Too many elements"); 350 } 351 352 static void one_concurrent() { 353 TimePartitions time_partitions; 354 time_partitions.report_gc_phase_start("ConcurrentPhase", 2, GCPhase::ConcurrentPhaseType); 355 time_partitions.report_gc_phase_end(8, GCPhase::ConcurrentPhaseType); 356 357 TimePartitionPhasesIterator iter(&time_partitions); 358 359 validate_gc_phase(iter.next(), 0, "ConcurrentPhase", 2, 8); 360 // ConcurrentPhaseType should not affect to both 'sum_of_pauses()' and 'longest_pause()'. 361 assert(time_partitions.sum_of_pauses() == Tickspan(), "Incorrect"); 362 assert(time_partitions.longest_pause() == Tickspan(), "Incorrect"); 363 364 assert(!iter.has_next(), "Too many elements"); 365 } 366 }; 367 368 class GCTimerTest { 369 public: 370 static void all() { 371 gc_start(); 372 gc_end(); 373 } 374 375 static void gc_start() { 376 GCTimer gc_timer; 377 gc_timer.register_gc_start(1); 378 379 assert(gc_timer.gc_start() == 1, "Incorrect"); 380 } 381 382 static void gc_end() { |