< prev index next >

src/hotspot/share/gc/shared/collectedHeap.inline.hpp

Print this page

        

*** 297,337 **** } else { return NULL; } } - #ifndef PRODUCT - - inline bool - CollectedHeap::promotion_should_fail(volatile size_t* count) { - // Access to count is not atomic; the value does not have to be exact. - if (PromotionFailureALot) { - const size_t gc_num = total_collections(); - const size_t elapsed_gcs = gc_num - _promotion_failure_alot_gc_number; - if (elapsed_gcs >= PromotionFailureALotInterval) { - // Test for unsigned arithmetic wrap-around. - if (++*count >= PromotionFailureALotCount) { - *count = 0; - return true; - } - } - } - return false; - } - - inline bool CollectedHeap::promotion_should_fail() { - return promotion_should_fail(&_promotion_failure_alot_count); - } - - inline void CollectedHeap::reset_promotion_should_fail(volatile size_t* count) { - if (PromotionFailureALot) { - _promotion_failure_alot_gc_number = total_collections(); - *count = 0; - } - } - - inline void CollectedHeap::reset_promotion_should_fail() { - reset_promotion_should_fail(&_promotion_failure_alot_count); - } - #endif // #ifndef PRODUCT - #endif // SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP --- 297,302 ----
< prev index next >