< prev index next >
src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
Print this page
rev 49680 : imported patch 6672778-partial-queue-trimming
rev 49681 : imported patch 6672778-refactoring
rev 49682 : [mq]: 6672778-stefanj-review
@@ -33,18 +33,18 @@
#include "gc/g1/g1RemSet.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "gc/shared/ageTable.hpp"
#include "memory/allocation.hpp"
#include "oops/oop.hpp"
+#include "utilities/ticks.hpp"
class G1PLABAllocator;
class G1EvacuationRootClosures;
class HeapRegion;
class outputStream;
class G1ParScanThreadState : public CHeapObj<mtGC> {
- private:
G1CollectedHeap* _g1h;
RefToScanQueue* _refs;
DirtyCardQueue _dcq;
G1CardTable* _ct;
G1EvacuationRootClosures* _closures;
@@ -58,10 +58,15 @@
G1ScanEvacuatedObjClosure _scanner;
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;
// this points into the array, as we use the first few entries for padding
size_t* _surviving_young_words;
@@ -81,11 +86,11 @@
assert(_dest[original.value()].is_valid_gen(),
"Dest state is invalid: " CSETSTATE_FORMAT, _dest[original.value()].value());
return _dest[original.value()];
}
- public:
+public:
G1ParScanThreadState(G1CollectedHeap* g1h, uint worker_id, size_t young_cset_length);
virtual ~G1ParScanThreadState();
void set_ref_processor(ReferenceProcessor* rp) { _scanner.set_ref_processor(rp); }
@@ -127,11 +132,11 @@
return _surviving_young_words + 1;
}
void flush(size_t* surviving_young_words);
- private:
+private:
#define G1_PARTIAL_ARRAY_MASK 0x2
inline bool has_partial_array_mask(oop* ref) const {
return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK;
}
@@ -183,15 +188,23 @@
inline InCSetState next_state(InCSetState const state, markOop const m, uint& age);
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 needs_partial_trimming() const;
+ inline bool is_partially_trimmed() const;
+
+ inline void trim_queue_to_threshold(uint threshold);
+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();
+ void reset_trim_ticks();
inline void steal_and_trim_queue(RefToScanQueueSet *task_queues);
// An attempt to evacuate "obj" has failed; take necessary steps.
oop handle_evacuation_failure_par(oop obj, markOop m);
< prev index next >