8333641: Serial: Remove Generation::supports_tlab_allocation
Reviewed-by: tschatzl
This commit is contained in:
parent
ce5727df44
commit
6ea28fb30c
src/hotspot/share/gc/serial
@ -191,7 +191,6 @@ class DefNewGeneration: public Generation {
|
||||
size_t max_survivor_size() const { return _max_survivor_size; }
|
||||
|
||||
// Thread-local allocation buffers
|
||||
bool supports_tlab_allocation() const { return true; }
|
||||
size_t tlab_capacity() const;
|
||||
size_t tlab_used() const;
|
||||
size_t unsafe_max_tlab_alloc() const;
|
||||
|
@ -114,9 +114,6 @@ class Generation: public CHeapObj<mtGC> {
|
||||
// Like "allocate", but performs any necessary locking internally.
|
||||
virtual HeapWord* par_allocate(size_t word_size, bool is_tlab) = 0;
|
||||
|
||||
// Thread-local allocation buffers
|
||||
virtual bool supports_tlab_allocation() const { return false; }
|
||||
|
||||
// Perform a heap collection, attempting to create (at least) enough
|
||||
// space to support an allocation of the given "word_size". If
|
||||
// successful, perform the allocation and return the resulting
|
||||
|
@ -833,20 +833,15 @@ bool SerialHeap::block_is_obj(const HeapWord* addr) const {
|
||||
}
|
||||
|
||||
size_t SerialHeap::tlab_capacity(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
// Only young-gen supports tlab allocation.
|
||||
return _young_gen->tlab_capacity();
|
||||
}
|
||||
|
||||
size_t SerialHeap::tlab_used(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
return _young_gen->tlab_used();
|
||||
}
|
||||
|
||||
size_t SerialHeap::unsafe_max_tlab_alloc(Thread* thr) const {
|
||||
assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
|
||||
assert(_young_gen->supports_tlab_allocation(), "Young gen doesn't support TLAB allocation?!");
|
||||
return _young_gen->unsafe_max_tlab_alloc();
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ public:
|
||||
bool should_allocate(size_t word_size, bool is_tlab) {
|
||||
bool result = false;
|
||||
size_t overflow_limit = (size_t)1 << (BitsPerSize_t - LogHeapWordSize);
|
||||
if (!is_tlab || supports_tlab_allocation()) {
|
||||
if (!is_tlab) {
|
||||
result = (word_size > 0) && (word_size < overflow_limit);
|
||||
}
|
||||
return result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user