< prev index next >

src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp

Print this page
rev 49665 : 8201326: Renaming ThreadLocalAllocationBuffer end to current_end
Summary: Rename the TLAB end field to a better name
Contributed-by: jcbeyler@google.com
rev 49666 : [mq]: renaming2
rev 49667 : [mq]: rename3

*** 42,52 **** friend class JVMCIVMStructs; private: HeapWord* _start; // address of TLAB HeapWord* _top; // address after last allocation HeapWord* _pf_top; // allocation prefetch watermark ! HeapWord* _end; // allocation end (excluding alignment_reserve) size_t _desired_size; // desired size (including alignment_reserve) size_t _refill_waste_limit; // hold onto tlab if free() is larger than this size_t _allocated_before_last_gc; // total bytes allocated up until the last gc static size_t _max_size; // maximum size of any TLAB --- 42,52 ---- friend class JVMCIVMStructs; private: HeapWord* _start; // address of TLAB HeapWord* _top; // address after last allocation HeapWord* _pf_top; // allocation prefetch watermark ! HeapWord* _fast_path_end; // allocation end (excluding alignment_reserve) size_t _desired_size; // desired size (including alignment_reserve) size_t _refill_waste_limit; // hold onto tlab if free() is larger than this size_t _allocated_before_last_gc; // total bytes allocated up until the last gc static size_t _max_size; // maximum size of any TLAB
*** 63,92 **** void accumulate_statistics(); void initialize_statistics(); void set_start(HeapWord* start) { _start = start; } ! void set_end(HeapWord* end) { _end = end; } void set_top(HeapWord* top) { _top = top; } void set_pf_top(HeapWord* pf_top) { _pf_top = pf_top; } void set_desired_size(size_t desired_size) { _desired_size = desired_size; } void set_refill_waste_limit(size_t waste) { _refill_waste_limit = waste; } size_t initial_refill_waste_limit() { return desired_size() / TLABRefillWasteFraction; } static int target_refills() { return _target_refills; } size_t initial_desired_size(); ! size_t remaining() const { return end() == NULL ? 0 : pointer_delta(hard_end(), top()); } // Make parsable and release it. void reset(); // Resize based on amount of allocation, etc. void resize(); ! void invariants() const { assert(top() >= start() && top() <= end(), "invalid tlab"); } void initialize(HeapWord* start, HeapWord* top, HeapWord* end); void print_stats(const char* tag); --- 63,92 ---- void accumulate_statistics(); void initialize_statistics(); void set_start(HeapWord* start) { _start = start; } ! void set_fast_path_end(HeapWord* fast_path_end){ _fast_path_end = fast_path_end; } void set_top(HeapWord* top) { _top = top; } void set_pf_top(HeapWord* pf_top) { _pf_top = pf_top; } void set_desired_size(size_t desired_size) { _desired_size = desired_size; } void set_refill_waste_limit(size_t waste) { _refill_waste_limit = waste; } size_t initial_refill_waste_limit() { return desired_size() / TLABRefillWasteFraction; } static int target_refills() { return _target_refills; } size_t initial_desired_size(); ! size_t remaining() const { return fast_path_end() == NULL ? 0 : pointer_delta(hard_end(), top()); } // Make parsable and release it. void reset(); // Resize based on amount of allocation, etc. void resize(); ! void invariants() const { assert(top() >= start() && top() <= fast_path_end(), "invalid tlab"); } void initialize(HeapWord* start, HeapWord* top, HeapWord* end); void print_stats(const char* tag);
*** 112,129 **** static size_t max_size() { assert(_max_size != 0, "max_size not set up"); return _max_size; } static size_t max_size_in_bytes() { return max_size() * BytesPerWord; } static void set_max_size(size_t max_size) { _max_size = max_size; } HeapWord* start() const { return _start; } ! HeapWord* end() const { return _end; } ! HeapWord* hard_end() const { return _end + alignment_reserve(); } HeapWord* top() const { return _top; } HeapWord* pf_top() const { return _pf_top; } size_t desired_size() const { return _desired_size; } size_t used() const { return pointer_delta(top(), start()); } size_t used_bytes() const { return pointer_delta(top(), start(), 1); } ! size_t free() const { return pointer_delta(end(), top()); } // Don't discard tlab if remaining space is larger than this. size_t refill_waste_limit() const { return _refill_waste_limit; } // Allocate size HeapWords. The memory is NOT initialized to zero. inline HeapWord* allocate(size_t size); --- 112,129 ---- static size_t max_size() { assert(_max_size != 0, "max_size not set up"); return _max_size; } static size_t max_size_in_bytes() { return max_size() * BytesPerWord; } static void set_max_size(size_t max_size) { _max_size = max_size; } HeapWord* start() const { return _start; } ! HeapWord* fast_path_end() const { return _fast_path_end; } ! HeapWord* hard_end() const { return _fast_path_end + alignment_reserve(); } HeapWord* top() const { return _top; } HeapWord* pf_top() const { return _pf_top; } size_t desired_size() const { return _desired_size; } size_t used() const { return pointer_delta(top(), start()); } size_t used_bytes() const { return pointer_delta(top(), start(), 1); } ! size_t free() const { return pointer_delta(fast_path_end(), top()); } // Don't discard tlab if remaining space is larger than this. size_t refill_waste_limit() const { return _refill_waste_limit; } // Allocate size HeapWords. The memory is NOT initialized to zero. inline HeapWord* allocate(size_t size);
*** 164,174 **** static size_t refill_waste_limit_increment() { return TLABWasteIncrement; } // Code generation support static ByteSize start_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _start); } ! static ByteSize end_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _end ); } static ByteSize top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _top ); } static ByteSize pf_top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _pf_top ); } static ByteSize size_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _desired_size ); } static ByteSize refill_waste_limit_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _refill_waste_limit ); } --- 164,174 ---- static size_t refill_waste_limit_increment() { return TLABWasteIncrement; } // Code generation support static ByteSize start_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _start); } ! static ByteSize fast_path_end_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _fast_path_end); } static ByteSize top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _top ); } static ByteSize pf_top_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _pf_top ); } static ByteSize size_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _desired_size ); } static ByteSize refill_waste_limit_offset() { return byte_offset_of(ThreadLocalAllocBuffer, _refill_waste_limit ); }
< prev index next >