--- old/src/hotspot/share/gc/g1/dirtyCardQueue.cpp 2018-11-27 15:44:19.306436501 -0500 +++ new/src/hotspot/share/gc/g1/dirtyCardQueue.cpp 2018-11-27 15:44:18.958417925 -0500 @@ -31,6 +31,7 @@ #include "gc/shared/suspendibleThreadSet.hpp" #include "gc/shared/workgroup.hpp" #include "runtime/atomic.hpp" +#include "runtime/flags/flagSetting.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" @@ -330,12 +331,10 @@ // the global list of logs. Temporarily turn off the limit on the number // of outstanding buffers. assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - size_t save_max_completed_buffers = _max_completed_buffers; - _max_completed_buffers = _max_completed_buffers_unlimited; + SizeTFlagSetting local_max(_max_completed_buffers, + MaxCompletedBuffersUnlimited); for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { concatenate_log(G1ThreadLocalData::dirty_card_queue(t)); } concatenate_log(_shared_dirty_card_queue); - // Restore the completed buffer limit. - _max_completed_buffers = save_max_completed_buffers; } --- old/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp 2018-11-27 15:44:20.562503545 -0500 +++ new/src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp 2018-11-27 15:44:20.278488385 -0500 @@ -386,7 +386,7 @@ // Change the barrier params if (max_num_threads() == 0) { // Disable dcqs notification when there are no threads to notify. - dcqs.set_process_completed_buffers_threshold(DirtyCardQueueSet::_process_completed_buffers_threshold_never); + dcqs.set_process_completed_buffers_threshold(DirtyCardQueueSet::ProcessCompletedBuffersThresholdNever); } else { // Worker 0 is the primary; wakeup is via dcqs notification. STATIC_ASSERT(max_yellow_zone <= INT_MAX); --- old/src/hotspot/share/gc/shared/ptrQueue.cpp 2018-11-27 15:44:21.898574858 -0500 +++ new/src/hotspot/share/gc/shared/ptrQueue.cpp 2018-11-27 15:44:21.578557777 -0500 @@ -164,11 +164,11 @@ _completed_buffers_head(NULL), _completed_buffers_tail(NULL), _n_completed_buffers(0), - _process_completed_buffers_threshold(_process_completed_buffers_threshold_never), + _process_completed_buffers_threshold(ProcessCompletedBuffersThresholdNever), _process_completed(false), _all_active(false), _notify_when_complete(notify_when_complete), - _max_completed_buffers(_max_completed_buffers_unlimited), + _max_completed_buffers(MaxCompletedBuffersUnlimited), _completed_buffers_padding(0) {} --- old/src/hotspot/share/gc/shared/ptrQueue.hpp 2018-11-27 15:44:23.214645104 -0500 +++ new/src/hotspot/share/gc/shared/ptrQueue.hpp 2018-11-27 15:44:22.850625675 -0500 @@ -355,7 +355,7 @@ size_t process_completed_buffers_threshold() const { return _process_completed_buffers_threshold; } - static const size_t _process_completed_buffers_threshold_never = ~size_t(0); + static const size_t ProcessCompletedBuffersThresholdNever = ~size_t(0); size_t completed_buffers_num() const { return _n_completed_buffers; } @@ -367,7 +367,7 @@ size_t max_completed_buffers() const { return _max_completed_buffers; } - static const size_t _max_completed_buffers_unlimited = ~size_t(0); + static const size_t MaxCompletedBuffersUnlimited = ~size_t(0); void set_completed_buffers_padding(size_t padding) { _completed_buffers_padding = padding;