diff --git a/src/hotspot/share/gc/serial/defNewGeneration.hpp b/src/hotspot/share/gc/serial/defNewGeneration.hpp index 65ee52cf4ea..baf565e2862 100644 --- a/src/hotspot/share/gc/serial/defNewGeneration.hpp +++ b/src/hotspot/share/gc/serial/defNewGeneration.hpp @@ -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; diff --git a/src/hotspot/share/gc/serial/generation.hpp b/src/hotspot/share/gc/serial/generation.hpp index 9f73caacb19..5e5aad5d0c1 100644 --- a/src/hotspot/share/gc/serial/generation.hpp +++ b/src/hotspot/share/gc/serial/generation.hpp @@ -114,9 +114,6 @@ class Generation: public CHeapObj { // 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 diff --git a/src/hotspot/share/gc/serial/serialHeap.cpp b/src/hotspot/share/gc/serial/serialHeap.cpp index 9e3bd0b81db..8dd8a9c0e67 100644 --- a/src/hotspot/share/gc/serial/serialHeap.cpp +++ b/src/hotspot/share/gc/serial/serialHeap.cpp @@ -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(); } diff --git a/src/hotspot/share/gc/serial/tenuredGeneration.hpp b/src/hotspot/share/gc/serial/tenuredGeneration.hpp index 5d6c19afbfc..dc2730eaf41 100644 --- a/src/hotspot/share/gc/serial/tenuredGeneration.hpp +++ b/src/hotspot/share/gc/serial/tenuredGeneration.hpp @@ -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;