8254744: Clean-up CodeBlob::align_code_offset

Reviewed-by: mdoerr, eosterlund
This commit is contained in:
Claes Redestad 2020-10-14 13:21:07 +00:00
parent f71e8a6198
commit 738effade4
3 changed files with 3 additions and 9 deletions

View file

@ -55,9 +55,8 @@ const char* CodeBlob::compiler_name() const {
unsigned int CodeBlob::align_code_offset(int offset) { unsigned int CodeBlob::align_code_offset(int offset) {
// align the size to CodeEntryAlignment // align the size to CodeEntryAlignment
return int header_size = (int)CodeHeap::header_size();
((offset + (int)CodeHeap::header_size() + (CodeEntryAlignment-1)) & ~(CodeEntryAlignment-1)) return align_up(offset + header_size, CodeEntryAlignment) - header_size;
- (int)CodeHeap::header_size();
} }

View file

@ -30,11 +30,6 @@
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/powerOfTwo.hpp" #include "utilities/powerOfTwo.hpp"
size_t CodeHeap::header_size() {
return sizeof(HeapBlock);
}
// Implementation of Heap // Implementation of Heap
CodeHeap::CodeHeap(const char* name, const int code_blob_type) CodeHeap::CodeHeap(const char* name, const int code_blob_type)

View file

@ -187,7 +187,7 @@ class CodeHeap : public CHeapObj<mtCode> {
virtual CodeBlob* find_blob_unsafe(void* start) const; virtual CodeBlob* find_blob_unsafe(void* start) const;
size_t alignment_unit() const; // alignment of any block 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 size_t alignment_offset() const; // offset of first byte of any block, within the enclosing alignment unit
static size_t header_size(); // returns the header size for each heap block 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 size_t segment_size() const { return _segment_size; } // for CodeHeapState
HeapBlock* first_block() const; // for CodeHeapState HeapBlock* first_block() const; // for CodeHeapState