8318489: Remove unused alignment_unit and alignment_offset

Reviewed-by: thartmann
This commit is contained in:
Albert Mingkun Yang 2023-10-20 08:38:05 +00:00
parent 138437f2cf
commit 8099261050
4 changed files with 0 additions and 24 deletions

@ -702,14 +702,6 @@ void CodeCache::metadata_do(MetadataClosure* f) {
}
}
int CodeCache::alignment_unit() {
return (int)_heaps->first()->alignment_unit();
}
int CodeCache::alignment_offset() {
return (int)_heaps->first()->alignment_offset();
}
// Calculate the number of GCs after which an nmethod is expected to have been
// used in order to not be classed as cold.
void CodeCache::update_cold_gc_count() {

@ -151,8 +151,6 @@ class CodeCache : AllStatic {
// Allocation/administration
static CodeBlob* allocate(int size, CodeBlobType code_blob_type, bool handle_alloc_failure = true, CodeBlobType orig_code_blob_type = CodeBlobType::All); // allocates a new CodeBlob
static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled
static int alignment_unit(); // guaranteed alignment of all CodeBlobs
static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
static void free(CodeBlob* cb); // frees a CodeBlob
static void free_unused_tail(CodeBlob* cb, size_t used); // frees the unused tail of a CodeBlob (only used by TemplateInterpreter::initialize())
static bool contains(void *p); // returns whether p is included

@ -488,18 +488,6 @@ CodeBlob* CodeHeap::find_blob(void* start) const {
return (result != nullptr && result->blob_contains((address)start)) ? result : nullptr;
}
size_t CodeHeap::alignment_unit() const {
// this will be a power of two
return _segment_size;
}
size_t CodeHeap::alignment_offset() const {
// The lowest address in any allocated block will be
// equal to alignment_offset (mod alignment_unit).
return sizeof(HeapBlock) & (_segment_size - 1);
}
// Returns the current block if available and used.
// If not, it returns the subsequent block (if available), null otherwise.
// Free blocks are merged, therefore there is at most one free block

@ -174,8 +174,6 @@ class CodeHeap : public CHeapObj<mtCode> {
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
size_t segment_size() const { return _segment_size; } // for CodeHeapState