8301447: [REDO] CodeHeap has virtual methods that are not overridden

Reviewed-by: kvn, thartmann
This commit is contained in:
Justin King 2023-02-01 13:11:12 +00:00 committed by Tobias Hartmann
parent cae577a710
commit 7c6a8db328
2 changed files with 5 additions and 10 deletions
src
hotspot/share/memory
jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code

@ -175,8 +175,8 @@ class CodeHeap : public CHeapObj<mtCode> {
return contains((void*)blob);
}
virtual void* find_start(void* p) const; // returns the block containing p or null
virtual CodeBlob* find_blob(void* start) const;
void* find_start(void* p) const; // returns the block containing p or null
CodeBlob* find_blob(void* start) const;
size_t alignment_unit() const; // alignment of any block
size_t alignment_offset() const; // offset of first byte of any block, within the enclosing alignment unit
static size_t header_size() { return sizeof(HeapBlock); } // returns the header size for each heap block
@ -192,9 +192,9 @@ class CodeHeap : public CHeapObj<mtCode> {
int freelist_length() const { return _freelist_length; } // number of elements in the freelist
// returns the first block or null
virtual void* first() const { return next_used(first_block()); }
void* first() const { return next_used(first_block()); }
// returns the next block given a block p or null
virtual void* next(void* p) const { return next_used(next_block(block_start(p))); }
void* next(void* p) const { return next_used(next_block(block_start(p))); }
// Statistics
size_t capacity() const;

@ -49,13 +49,8 @@ public class CodeCache {
Type type = db.lookupType("CodeCache");
// Get array of CodeHeaps
// Note: CodeHeap may be subclassed with optional private heap mechanisms.
Type codeHeapType = db.lookupType("CodeHeap");
VirtualBaseConstructor<CodeHeap> heapConstructor =
new VirtualBaseConstructor<>(db, codeHeapType, "sun.jvm.hotspot.memory", CodeHeap.class);
AddressField heapsField = type.getAddressField("_heaps");
heapArray = GrowableArray.create(heapsField.getValue(), heapConstructor);
heapArray = GrowableArray.create(heapsField.getValue(), new StaticBaseConstructor<>(CodeHeap.class));
virtualConstructor = new VirtualConstructor(db);
// Add mappings for all possible CodeBlob subclasses