8253594: Remove CollectedHeap::supports_tlab_allocation
Reviewed-by: sjohanss, pliden
This commit is contained in:
parent
cfa3f74931
commit
e12d94af0b
@ -95,7 +95,6 @@ public:
|
||||
size_t* actual_size);
|
||||
|
||||
// TLAB allocation
|
||||
virtual bool supports_tlab_allocation() const { return true; }
|
||||
virtual size_t tlab_capacity(Thread* thr) const { return capacity(); }
|
||||
virtual size_t tlab_used(Thread* thr) const { return used(); }
|
||||
virtual size_t max_tlab_size() const { return _max_tlab_size; }
|
||||
|
@ -2369,10 +2369,6 @@ bool G1CollectedHeap::block_is_obj(const HeapWord* addr) const {
|
||||
return hr->block_is_obj(addr);
|
||||
}
|
||||
|
||||
bool G1CollectedHeap::supports_tlab_allocation() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t G1CollectedHeap::tlab_capacity(Thread* ignored) const {
|
||||
return (_policy->young_list_target_length() - _survivor.length()) * HeapRegion::GrainBytes;
|
||||
}
|
||||
|
@ -1252,7 +1252,6 @@ public:
|
||||
// Section on thread-local allocation buffers (TLABs)
|
||||
// See CollectedHeap for semantics.
|
||||
|
||||
bool supports_tlab_allocation() const;
|
||||
size_t tlab_capacity(Thread* ignored) const;
|
||||
size_t tlab_used(Thread* ignored) const;
|
||||
size_t max_tlab_size() const;
|
||||
|
@ -202,8 +202,6 @@ class ParallelScavengeHeap : public CollectedHeap {
|
||||
void ensure_parsability(bool retire_tlabs);
|
||||
void resize_all_tlabs();
|
||||
|
||||
bool supports_tlab_allocation() const { return true; }
|
||||
|
||||
size_t tlab_capacity(Thread* thr) const;
|
||||
size_t tlab_used(Thread* thr) const;
|
||||
size_t unsafe_max_tlab_alloc(Thread* thr) const;
|
||||
|
@ -353,13 +353,6 @@ class CollectedHeap : public CHeapObj<mtInternal> {
|
||||
// allocation from them and necessitating allocation of new TLABs.
|
||||
virtual void ensure_parsability(bool retire_tlabs);
|
||||
|
||||
// Section on thread-local allocation buffers (TLABs)
|
||||
// If the heap supports thread-local allocation buffers, it should override
|
||||
// the following methods:
|
||||
// Returns "true" iff the heap supports thread-local allocation buffers.
|
||||
// The default is "no".
|
||||
virtual bool supports_tlab_allocation() const = 0;
|
||||
|
||||
// The amount of space available for thread-local allocation buffers.
|
||||
virtual size_t tlab_capacity(Thread *thr) const = 0;
|
||||
|
||||
|
@ -1029,33 +1029,22 @@ bool GenCollectedHeap::block_is_obj(const HeapWord* addr) const {
|
||||
return _old_gen->block_is_obj(addr);
|
||||
}
|
||||
|
||||
bool GenCollectedHeap::supports_tlab_allocation() const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
return _young_gen->supports_tlab_allocation();
|
||||
}
|
||||
|
||||
size_t GenCollectedHeap::tlab_capacity(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
if (_young_gen->supports_tlab_allocation()) {
|
||||
return _young_gen->tlab_capacity();
|
||||
}
|
||||
return 0;
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
return _young_gen->tlab_capacity();
|
||||
}
|
||||
|
||||
size_t GenCollectedHeap::tlab_used(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
if (_young_gen->supports_tlab_allocation()) {
|
||||
return _young_gen->tlab_used();
|
||||
}
|
||||
return 0;
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
return _young_gen->tlab_used();
|
||||
}
|
||||
|
||||
size_t GenCollectedHeap::unsafe_max_tlab_alloc(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
if (_young_gen->supports_tlab_allocation()) {
|
||||
return _young_gen->unsafe_max_tlab_alloc();
|
||||
}
|
||||
return 0;
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
return _young_gen->unsafe_max_tlab_alloc();
|
||||
}
|
||||
|
||||
HeapWord* GenCollectedHeap::allocate_new_tlab(size_t min_size,
|
||||
|
@ -266,7 +266,6 @@ public:
|
||||
bool block_is_obj(const HeapWord* addr) const;
|
||||
|
||||
// Section on TLAB's.
|
||||
virtual bool supports_tlab_allocation() const;
|
||||
virtual size_t tlab_capacity(Thread* thr) const;
|
||||
virtual size_t tlab_used(Thread* thr) const;
|
||||
virtual size_t unsafe_max_tlab_alloc(Thread* thr) const;
|
||||
|
@ -606,9 +606,6 @@ public:
|
||||
|
||||
void notify_mutator_alloc_words(size_t words, bool waste);
|
||||
|
||||
// Shenandoah supports TLAB allocation
|
||||
bool supports_tlab_allocation() const { return true; }
|
||||
|
||||
HeapWord* allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size);
|
||||
size_t tlab_capacity(Thread *thr) const;
|
||||
size_t unsafe_max_tlab_alloc(Thread *thread) const;
|
||||
|
@ -205,10 +205,6 @@ void ZCollectedHeap::do_full_collection(bool clear_all_soft_refs) {
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
bool ZCollectedHeap::supports_tlab_allocation() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t ZCollectedHeap::tlab_capacity(Thread* ignored) const {
|
||||
return _heap.tlab_capacity();
|
||||
}
|
||||
|
@ -83,7 +83,6 @@ public:
|
||||
virtual void collect_as_vm_thread(GCCause::Cause cause);
|
||||
virtual void do_full_collection(bool clear_all_soft_refs);
|
||||
|
||||
virtual bool supports_tlab_allocation() const;
|
||||
virtual size_t tlab_capacity(Thread* thr) const;
|
||||
virtual size_t tlab_used(Thread* thr) const;
|
||||
virtual size_t max_tlab_size() const;
|
||||
|
@ -806,8 +806,6 @@ jint Universe::initialize_heap() {
|
||||
void Universe::initialize_tlab() {
|
||||
ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size());
|
||||
if (UseTLAB) {
|
||||
assert(Universe::heap()->supports_tlab_allocation(),
|
||||
"Should support thread-local allocation buffers");
|
||||
ThreadLocalAllocBuffer::startup_initialization();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user