8331549: Inline MemAllocator::mem_allocate_slow

Reviewed-by: stefank, gli
This commit is contained in:
Albert Mingkun Yang 2024-05-02 15:03:48 +00:00
parent 3383ad6397
commit 7a41a525de
2 changed files with 9 additions and 16 deletions
src/hotspot/share/gc/shared

@ -318,7 +318,15 @@ HeapWord* MemAllocator::mem_allocate_inside_tlab_slow(Allocation& allocation) co
return mem;
}
HeapWord* MemAllocator::mem_allocate_slow(Allocation& allocation) const {
HeapWord* MemAllocator::mem_allocate(Allocation& allocation) const {
if (UseTLAB) {
// Try allocating from an existing TLAB.
HeapWord* mem = mem_allocate_inside_tlab_fast();
if (mem != nullptr) {
return mem;
}
}
// Allocation of an oop can always invoke a safepoint.
debug_only(allocation._thread->check_for_valid_safepoint_state());
@ -333,18 +341,6 @@ HeapWord* MemAllocator::mem_allocate_slow(Allocation& allocation) const {
return mem_allocate_outside_tlab(allocation);
}
HeapWord* MemAllocator::mem_allocate(Allocation& allocation) const {
if (UseTLAB) {
// Try allocating from an existing TLAB.
HeapWord* mem = mem_allocate_inside_tlab_fast();
if (mem != nullptr) {
return mem;
}
}
return mem_allocate_slow(allocation);
}
oop MemAllocator::allocate() const {
oop obj = nullptr;
{

@ -52,9 +52,6 @@ private:
// Allocate outside a TLAB. Could safepoint.
HeapWord* mem_allocate_outside_tlab(Allocation& allocation) const;
// Fast-path TLAB allocation failed. Takes a slow-path and potentially safepoint.
HeapWord* mem_allocate_slow(Allocation& allocation) const;
protected:
MemAllocator(Klass* klass, size_t word_size, Thread* thread)
: _thread(thread),