Skip to content

Commit 8099261

Browse files
committedOct 20, 2023
8318489: Remove unused alignment_unit and alignment_offset
Reviewed-by: thartmann
1 parent 138437f commit 8099261

File tree

4 files changed

+0
-24
lines changed

4 files changed

+0
-24
lines changed
 

‎src/hotspot/share/code/codeCache.cpp

-8
Original file line numberDiff line numberDiff line change
@@ -702,14 +702,6 @@ void CodeCache::metadata_do(MetadataClosure* f) {
702702
}
703703
}
704704

705-
int CodeCache::alignment_unit() {
706-
return (int)_heaps->first()->alignment_unit();
707-
}
708-
709-
int CodeCache::alignment_offset() {
710-
return (int)_heaps->first()->alignment_offset();
711-
}
712-
713705
// Calculate the number of GCs after which an nmethod is expected to have been
714706
// used in order to not be classed as cold.
715707
void CodeCache::update_cold_gc_count() {

‎src/hotspot/share/code/codeCache.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ class CodeCache : AllStatic {
151151
// Allocation/administration
152152
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
153153
static void commit(CodeBlob* cb); // called when the allocated CodeBlob has been filled
154-
static int alignment_unit(); // guaranteed alignment of all CodeBlobs
155-
static int alignment_offset(); // guaranteed offset of first CodeBlob byte within alignment unit (i.e., allocation header)
156154
static void free(CodeBlob* cb); // frees a CodeBlob
157155
static void free_unused_tail(CodeBlob* cb, size_t used); // frees the unused tail of a CodeBlob (only used by TemplateInterpreter::initialize())
158156
static bool contains(void *p); // returns whether p is included

‎src/hotspot/share/memory/heap.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -488,18 +488,6 @@ CodeBlob* CodeHeap::find_blob(void* start) const {
488488
return (result != nullptr && result->blob_contains((address)start)) ? result : nullptr;
489489
}
490490

491-
size_t CodeHeap::alignment_unit() const {
492-
// this will be a power of two
493-
return _segment_size;
494-
}
495-
496-
497-
size_t CodeHeap::alignment_offset() const {
498-
// The lowest address in any allocated block will be
499-
// equal to alignment_offset (mod alignment_unit).
500-
return sizeof(HeapBlock) & (_segment_size - 1);
501-
}
502-
503491
// Returns the current block if available and used.
504492
// If not, it returns the subsequent block (if available), null otherwise.
505493
// Free blocks are merged, therefore there is at most one free block

‎src/hotspot/share/memory/heap.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ class CodeHeap : public CHeapObj<mtCode> {
174174

175175
void* find_start(void* p) const; // returns the block containing p or null
176176
CodeBlob* find_blob(void* start) const;
177-
size_t alignment_unit() const; // alignment of any block
178-
size_t alignment_offset() const; // offset of first byte of any block, within the enclosing alignment unit
179177
static size_t header_size() { return sizeof(HeapBlock); } // returns the header size for each heap block
180178

181179
size_t segment_size() const { return _segment_size; } // for CodeHeapState

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Oct 20, 2023

@openjdk-notifier[bot]
Please sign in to comment.