Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8254744: Clean-up CodeBlob::align_code_offset
Reviewed-by: mdoerr, eosterlund
  • Loading branch information
cl4es committed Oct 14, 2020
1 parent f71e8a6 commit 738effa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/hotspot/share/code/codeBlob.cpp
Expand Up @@ -55,9 +55,8 @@ const char* CodeBlob::compiler_name() const {

unsigned int CodeBlob::align_code_offset(int offset) {
// align the size to CodeEntryAlignment
return
((offset + (int)CodeHeap::header_size() + (CodeEntryAlignment-1)) & ~(CodeEntryAlignment-1))
- (int)CodeHeap::header_size();
int header_size = (int)CodeHeap::header_size();
return align_up(offset + header_size, CodeEntryAlignment) - header_size;
}


Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/memory/heap.cpp
Expand Up @@ -30,11 +30,6 @@
#include "utilities/align.hpp"
#include "utilities/powerOfTwo.hpp"

size_t CodeHeap::header_size() {
return sizeof(HeapBlock);
}


// Implementation of Heap

CodeHeap::CodeHeap(const char* name, const int code_blob_type)
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/memory/heap.hpp
Expand Up @@ -187,7 +187,7 @@ class CodeHeap : public CHeapObj<mtCode> {
virtual CodeBlob* find_blob_unsafe(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(); // 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
HeapBlock* first_block() const; // for CodeHeapState
Expand Down

1 comment on commit 738effa

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 738effa Oct 14, 2020

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.