src/share/vm/memory/threadLocalAllocBuffer.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7079329 Sdiff src/share/vm/memory

src/share/vm/memory/threadLocalAllocBuffer.hpp

Print this page




 107   static const size_t max_size();
 108 
 109   HeapWord* start() const                        { return _start; }
 110   HeapWord* end() const                          { return _end; }
 111   HeapWord* hard_end() const                     { return _end + alignment_reserve(); }
 112   HeapWord* top() const                          { return _top; }
 113   HeapWord* pf_top() const                       { return _pf_top; }
 114   size_t desired_size() const                    { return _desired_size; }
 115   size_t used() const                            { return pointer_delta(top(), start()); }
 116   size_t used_bytes() const                      { return pointer_delta(top(), start(), 1); }
 117   size_t free() const                            { return pointer_delta(end(), top()); }
 118   // Don't discard tlab if remaining space is larger than this.
 119   size_t refill_waste_limit() const              { return _refill_waste_limit; }
 120 
 121   // Allocate size HeapWords. The memory is NOT initialized to zero.
 122   inline HeapWord* allocate(size_t size);
 123 
 124   // Reserve space at the end of TLAB
 125   static size_t end_reserve() {
 126     int reserve_size = typeArrayOopDesc::header_size(T_INT);
 127     if (AllocatePrefetchStyle == 3) {
 128       // BIS is used to prefetch - we need a space for it.
 129       // +1 for rounding up to next cache line +1 to be safe
 130       int lines = AllocatePrefetchLines + 2;
 131       int step_size = AllocatePrefetchStepSize;
 132       int distance = AllocatePrefetchDistance;
 133       int prefetch_end = (distance + step_size*lines)/(int)HeapWordSize;
 134       reserve_size = MAX2(reserve_size, prefetch_end);
 135     }
 136     return reserve_size;
 137   }
 138   static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
 139   static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
 140 
 141   // Return tlab size or remaining space in eden such that the
 142   // space is large enough to hold obj_size and necessary fill space.
 143   // Otherwise return 0;
 144   inline size_t compute_size(size_t obj_size);
 145 
 146   // Record slow allocation
 147   inline void record_slow_allocation(size_t obj_size);
 148 
 149   // Initialization at startup
 150   static void startup_initialization();
 151 
 152   // Make an in-use tlab parsable, optionally also retiring it.
 153   void make_parsable(bool retire);
 154 
 155   // Retire in-use tlab before allocation of a new tlab
 156   void clear_before_allocation();
 157 




 107   static const size_t max_size();
 108 
 109   HeapWord* start() const                        { return _start; }
 110   HeapWord* end() const                          { return _end; }
 111   HeapWord* hard_end() const                     { return _end + alignment_reserve(); }
 112   HeapWord* top() const                          { return _top; }
 113   HeapWord* pf_top() const                       { return _pf_top; }
 114   size_t desired_size() const                    { return _desired_size; }
 115   size_t used() const                            { return pointer_delta(top(), start()); }
 116   size_t used_bytes() const                      { return pointer_delta(top(), start(), 1); }
 117   size_t free() const                            { return pointer_delta(end(), top()); }
 118   // Don't discard tlab if remaining space is larger than this.
 119   size_t refill_waste_limit() const              { return _refill_waste_limit; }
 120 
 121   // Allocate size HeapWords. The memory is NOT initialized to zero.
 122   inline HeapWord* allocate(size_t size);
 123 
 124   // Reserve space at the end of TLAB
 125   static size_t end_reserve() {
 126     int reserve_size = typeArrayOopDesc::header_size(T_INT);
 127     return MAX2(reserve_size, VM_Version::reserve_for_allocation_prefetch());







 128   }


 129   static size_t alignment_reserve()              { return align_object_size(end_reserve()); }
 130   static size_t alignment_reserve_in_bytes()     { return alignment_reserve() * HeapWordSize; }
 131 
 132   // Return tlab size or remaining space in eden such that the
 133   // space is large enough to hold obj_size and necessary fill space.
 134   // Otherwise return 0;
 135   inline size_t compute_size(size_t obj_size);
 136 
 137   // Record slow allocation
 138   inline void record_slow_allocation(size_t obj_size);
 139 
 140   // Initialization at startup
 141   static void startup_initialization();
 142 
 143   // Make an in-use tlab parsable, optionally also retiring it.
 144   void make_parsable(bool retire);
 145 
 146   // Retire in-use tlab before allocation of a new tlab
 147   void clear_before_allocation();
 148 


src/share/vm/memory/threadLocalAllocBuffer.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File