--- old/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp 2018-04-11 13:44:09.101592917 +0200 +++ new/src/hotspot/share/gc/g1/g1ParScanThreadState.hpp 2018-04-11 13:44:08.812584043 +0200 @@ -35,6 +35,7 @@ #include "gc/shared/ageTable.hpp" #include "memory/allocation.hpp" #include "oops/oop.hpp" +#include "utilities/ticks.hpp" class G1PLABAllocator; class G1EvacuationRootClosures; @@ -42,7 +43,6 @@ class outputStream; class G1ParScanThreadState : public CHeapObj { - private: G1CollectedHeap* _g1h; RefToScanQueue* _refs; DirtyCardQueue _dcq; @@ -60,6 +60,11 @@ int _hash_seed; uint _worker_id; + // Upper and lower threshold to start and end work queue draining. + uint const _stack_drain_upper_threshold; + uint const _stack_drain_lower_threshold; + + Tickspan _trim_ticks; // Map from young-age-index (0 == not young, 1 is youngest) to // surviving words. base is what we get back from the malloc call size_t* _surviving_young_words_base; @@ -83,7 +88,7 @@ return _dest[original.value()]; } - public: +public: G1ParScanThreadState(G1CollectedHeap* g1h, uint worker_id, size_t young_cset_length); virtual ~G1ParScanThreadState(); @@ -129,7 +134,7 @@ void flush(size_t* surviving_young_words); - private: +private: #define G1_PARTIAL_ARRAY_MASK 0x2 inline bool has_partial_array_mask(oop* ref) const { @@ -185,11 +190,18 @@ void report_promotion_event(InCSetState const dest_state, oop const old, size_t word_sz, uint age, HeapWord * const obj_ptr) const; - public: + inline bool should_start_trim_queue_partially() const; + inline bool should_end_trim_queue_partially() const; + + inline void trim_queue_partially_internal(); +public: oop copy_to_survivor_space(InCSetState const state, oop const obj, markOop const old_mark); void trim_queue(); + void trim_queue_partially(); + + Tickspan trim_ticks_and_reset(); inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);