< prev index next > src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp
Print this page
private:
char _gc_state;
// Evacuation OOM state
uint8_t _oom_scope_nesting_level;
bool _oom_during_evac;
+ bool _plab_allows_promotion; // If false, no more promotion by this thread during this evacuation phase.
SATBMarkQueue _satb_mark_queue;
+
+ // Thread-local allocation buffer for object evacuations.
+ // In generational mode, it is exclusive to the young generation.
PLAB* _gclab;
size_t _gclab_size;
+
+ // Thread-local allocation buffer only used in generational mode.
+ // Used both by mutator threads and by GC worker threads
+ // for evacuations within the old generation and
+ // for promotions from the young generation into the old generation.
+ PLAB* _plab;
+ size_t _plab_size;
+
+ size_t _plab_evacuated;
+ size_t _plab_promoted;
+
+ uint _worker_id;
int _disarmed_value;
double _paced_time;
ShenandoahThreadLocalData() :
_gc_state(0),
_oom_scope_nesting_level(0),
_oom_during_evac(false),
_satb_mark_queue(&ShenandoahBarrierSet::satb_mark_queue_set()),
_gclab(NULL),
_gclab_size(0),
+ _plab(NULL),
+ _plab_size(0),
+ _plab_evacuated(0),
+ _plab_promoted(0),
_disarmed_value(0),
_paced_time(0) {
// At least on x86_64, nmethod entry barrier encodes _disarmed_value offset
// in instruction as disp8 immed
~ShenandoahThreadLocalData() {
if (_gclab != NULL) {
delete _gclab;
}
+ if (_plab != NULL) {
+ ShenandoahHeap::heap()->retire_plab(_plab);
+ delete _plab;
+ }
}
static ShenandoahThreadLocalData* data(Thread* thread) {
assert(UseShenandoahGC, "Sanity");
return thread->gc_data<ShenandoahThreadLocalData>();
static void initialize_gclab(Thread* thread) {
assert (thread->is_Java_thread() || thread->is_Worker_thread(), "Only Java and GC worker threads are allowed to get GCLABs");
assert(data(thread)->_gclab == NULL, "Only initialize once");
data(thread)->_gclab = new PLAB(PLAB::min_size());
data(thread)->_gclab_size = 0;
+ data(thread)->_plab = new PLAB(PLAB::min_size());
+ data(thread)->_plab_size = 0;
}
static PLAB* gclab(Thread* thread) {
return data(thread)->_gclab;
}
static void set_gclab_size(Thread* thread, size_t v) {
data(thread)->_gclab_size = v;
}
+ static PLAB* plab(Thread* thread) {
+ return data(thread)->_plab;
+ }
+
+ static size_t plab_size(Thread* thread) {
+ return data(thread)->_plab_size;
+ }
+
+ static void set_plab_size(Thread* thread, size_t v) {
+ data(thread)->_plab_size = v;
+ }
+
+ static void enable_plab_promotions(Thread* thread) {
+ data(thread)->_plab_allows_promotion = true;
+ }
+
+ static void disable_plab_promotions(Thread* thread) {
+ data(thread)->_plab_allows_promotion = false;
+ }
+
+ static bool allow_plab_promotions(Thread* thread) {
+ return data(thread)->_plab_allows_promotion;
+ }
+
+ static void reset_plab_evacuated(Thread* thread) {
+ data(thread)->_plab_evacuated = 0;
+ }
+
+ static void add_to_plab_evacuated(Thread* thread, size_t increment) {
+ data(thread)->_plab_evacuated += increment;
+ }
+
+ static void subtract_from_plab_evacuated(Thread* thread, size_t increment) {
+ data(thread)->_plab_evacuated -= increment;
+ }
+
+ static size_t get_plab_evacuated(Thread* thread) {
+ return data(thread)->_plab_evacuated;
+ }
+
+ static void reset_plab_promoted(Thread* thread) {
+ data(thread)->_plab_promoted = 0;
+ }
+
+ static void add_to_plab_promoted(Thread* thread, size_t increment) {
+ data(thread)->_plab_promoted += increment;
+ }
+
+ static void subtract_from_plab_promoted(Thread* thread, size_t increment) {
+ data(thread)->_plab_promoted -= increment;
+ }
+
+ static size_t get_plab_promoted(Thread* thread) {
+ return data(thread)->_plab_promoted;
+ }
+
static void add_paced_time(Thread* thread, double v) {
data(thread)->_paced_time += v;
}
static double paced_time(Thread* thread) {
< prev index next >