364 assert(valid(), "statistics not valid yet"); 365 return (gc0_promoted() + cms_allocated()) / gc0_period(); 366 } 367 368 inline void ConcurrentMarkSweepGeneration::save_sweep_limit() { 369 cmsSpace()->save_sweep_limit(); 370 } 371 372 inline MemRegion ConcurrentMarkSweepGeneration::used_region_at_save_marks() const { 373 return _cmsSpace->used_region_at_save_marks(); 374 } 375 376 inline void MarkFromRootsClosure::do_yield_check() { 377 if (ConcurrentMarkSweepThread::should_yield() && 378 !_collector->foregroundGCIsActive() && 379 _yield) { 380 do_yield_work(); 381 } 382 } 383 384 inline void Par_MarkFromRootsClosure::do_yield_check() { 385 if (ConcurrentMarkSweepThread::should_yield() && 386 !_collector->foregroundGCIsActive()) { 387 do_yield_work(); 388 } 389 } 390 391 inline void PushOrMarkClosure::do_yield_check() { 392 _parent->do_yield_check(); 393 } 394 395 inline void Par_PushOrMarkClosure::do_yield_check() { 396 _parent->do_yield_check(); 397 } 398 399 // Return value of "true" indicates that the on-going preclean 400 // should be aborted. 401 inline bool ScanMarkedObjectsAgainCarefullyClosure::do_yield_check() { 402 if (ConcurrentMarkSweepThread::should_yield() && 403 !_collector->foregroundGCIsActive() && 404 _yield) { 405 // Sample young gen size before and after yield 406 _collector->sample_eden(); 407 do_yield_work(); 408 _collector->sample_eden(); 409 return _collector->should_abort_preclean(); 410 } 411 return false; 412 } 413 414 inline void SurvivorSpacePrecleanClosure::do_yield_check() { 415 if (ConcurrentMarkSweepThread::should_yield() && | 364 assert(valid(), "statistics not valid yet"); 365 return (gc0_promoted() + cms_allocated()) / gc0_period(); 366 } 367 368 inline void ConcurrentMarkSweepGeneration::save_sweep_limit() { 369 cmsSpace()->save_sweep_limit(); 370 } 371 372 inline MemRegion ConcurrentMarkSweepGeneration::used_region_at_save_marks() const { 373 return _cmsSpace->used_region_at_save_marks(); 374 } 375 376 inline void MarkFromRootsClosure::do_yield_check() { 377 if (ConcurrentMarkSweepThread::should_yield() && 378 !_collector->foregroundGCIsActive() && 379 _yield) { 380 do_yield_work(); 381 } 382 } 383 384 inline void ParMarkFromRootsClosure::do_yield_check() { 385 if (ConcurrentMarkSweepThread::should_yield() && 386 !_collector->foregroundGCIsActive()) { 387 do_yield_work(); 388 } 389 } 390 391 inline void PushOrMarkClosure::do_yield_check() { 392 _parent->do_yield_check(); 393 } 394 395 inline void ParPushOrMarkClosure::do_yield_check() { 396 _parent->do_yield_check(); 397 } 398 399 // Return value of "true" indicates that the on-going preclean 400 // should be aborted. 401 inline bool ScanMarkedObjectsAgainCarefullyClosure::do_yield_check() { 402 if (ConcurrentMarkSweepThread::should_yield() && 403 !_collector->foregroundGCIsActive() && 404 _yield) { 405 // Sample young gen size before and after yield 406 _collector->sample_eden(); 407 do_yield_work(); 408 _collector->sample_eden(); 409 return _collector->should_abort_preclean(); 410 } 411 return false; 412 } 413 414 inline void SurvivorSpacePrecleanClosure::do_yield_check() { 415 if (ConcurrentMarkSweepThread::should_yield() && |