< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahThreadLocalData.hpp

Print this page
*** 43,12 ***
--- 43,23 ---
    char _gc_state;
    // Evacuation OOM state
    uint8_t                 _oom_scope_nesting_level;
    bool                    _oom_during_evac;
    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;
+ 
    uint  _worker_id;
    int  _disarmed_value;
    double _paced_time;
  
    ShenandoahThreadLocalData() :

*** 56,10 ***
--- 67,12 ---
      _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),
      _worker_id(INVALID_WORKER_ID),
      _disarmed_value(0),
      _paced_time(0) {
  
      // At least on x86_64, nmethod entry barrier encodes _disarmed_value offset

*** 69,10 ***
--- 82,13 ---
  
    ~ShenandoahThreadLocalData() {
      if (_gclab != NULL) {
        delete _gclab;
      }
+     if (_plab != NULL) {
+       delete _plab;
+     }
    }
  
    static ShenandoahThreadLocalData* data(Thread* thread) {
      assert(UseShenandoahGC, "Sanity");
      return thread->gc_data<ShenandoahThreadLocalData>();

*** 116,10 ***
--- 132,12 ---
    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;
    }

*** 130,10 ***
--- 148,22 ---
  
    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 add_paced_time(Thread* thread, double v) {
      data(thread)->_paced_time += v;
    }
  
    static double paced_time(Thread* thread) {
< prev index next >