OpenJDK / jdk / jdk
changeset 56068:92f994585e25
8229127: Make some methods in the allocation path non-virtual
Reviewed-by: eosterlund
author | pliden |
---|---|
date | Fri, 23 Aug 2019 08:48:27 +0200 |
parents | 6728c41f2a08 |
children | 3029be26f9ea |
files | src/hotspot/share/gc/shared/collectedHeap.hpp src/hotspot/share/gc/shared/memAllocator.hpp |
diffstat | 2 files changed, 5 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp Fri Aug 23 08:48:23 2019 +0200 +++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Fri Aug 23 08:48:27 2019 +0200 @@ -254,9 +254,9 @@ } GCCause::Cause gc_cause() { return _gc_cause; } - virtual oop obj_allocate(Klass* klass, int size, TRAPS); + oop obj_allocate(Klass* klass, int size, TRAPS); virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS); - virtual oop class_allocate(Klass* klass, int size, TRAPS); + oop class_allocate(Klass* klass, int size, TRAPS); // Utilities for turning raw memory into filler objects. //
--- a/src/hotspot/share/gc/shared/memAllocator.hpp Fri Aug 23 08:48:23 2019 +0200 +++ b/src/hotspot/share/gc/shared/memAllocator.hpp Fri Aug 23 08:48:27 2019 +0200 @@ -61,11 +61,9 @@ // that must be parseable as an oop by concurrent collectors. virtual oop finish(HeapWord* mem) const; - // Raw memory allocation. This may or may not use TLAB allocations to satisfy the - // allocation. A GC implementation may override this function to satisfy the allocation - // in any way. But the default is to try a TLAB allocation, and otherwise perform - // mem_allocate. - virtual HeapWord* mem_allocate(Allocation& allocation) const; + // Raw memory allocation. This will try to do a TLAB allocation, and otherwise fall + // back to calling CollectedHeap::mem_allocate(). + HeapWord* mem_allocate(Allocation& allocation) const; virtual MemRegion obj_memory_range(oop obj) const { return MemRegion((HeapWord*)obj, _word_size);