Skip to content

Commit

Permalink
8318489: Remove unused alignment_unit and alignment_offset
Browse files Browse the repository at this point in the history
Reviewed-by: thartmann
  • Loading branch information
albertnetymk committed Oct 20, 2023
1 parent 138437f commit 8099261
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 24 deletions.
8 changes: 0 additions & 8 deletions src/hotspot/share/code/codeCache.cpp
Expand Up @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/code/codeCache.hpp
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/hotspot/share/memory/heap.cpp
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/memory/heap.hpp
Expand Up @@ -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
Expand Down

1 comment on commit 8099261

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.