Skip to content

Commit

Permalink
remove _code_end_offset
Browse files Browse the repository at this point in the history
  • Loading branch information
bulasevich committed Nov 18, 2024
1 parent 0c70bd2 commit 88e3106
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/hotspot/share/code/codeBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
_relocation_size(align_up(cb->total_relocation_size(), oopSize)),
_content_offset(CodeBlob::align_code_offset(header_size)),
_code_offset(_content_offset + cb->total_offset_of(cb->insts())),
_code_end_offset(_content_offset + align_up(cb->total_content_size(), oopSize)),
_frame_size(frame_size),
S390_ONLY(_ctable_offset(0) COMMA)
_header_size(header_size),
Expand All @@ -91,7 +90,8 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
assert(is_aligned(_size, oopSize), "unaligned size");
assert(is_aligned(header_size, oopSize), "unaligned size");
assert(is_aligned(_relocation_size, oopSize), "unaligned size");
assert(_code_end_offset <= _size, "codeBlob is too small: %d > %d", _code_end_offset, _size);
int code_end_offset = _content_offset + align_up(cb->total_content_size(), oopSize);
assert(code_end_offset == _size, "wrong codeBlob size: %d != %d", _size, code_end_offset);
assert(code_end() == content_end(), "must be the same - see code_end()");
#ifdef COMPILER1
// probably wrong for tiered
Expand Down Expand Up @@ -119,7 +119,6 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t heade
_relocation_size(0),
_content_offset(CodeBlob::align_code_offset(header_size)),
_code_offset(_content_offset),
_code_end_offset(size),
_frame_size(0),
S390_ONLY(_ctable_offset(0) COMMA)
_header_size(header_size),
Expand Down
9 changes: 3 additions & 6 deletions src/hotspot/share/code/codeBlob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class CodeBlob {
int _relocation_size; // size of relocation (could be bigger than 64Kb)
int _content_offset; // offset to where content region begins (this includes consts, insts, stubs)
int _code_offset; // offset to where instructions region begins (this includes insts, stubs)
int _code_end_offset; // offset to where code region ends
int _frame_size; // size of stack frame in words (NOT slots. On x64 these are 64bit words)

S390_ONLY(int _ctable_offset;)
Expand Down Expand Up @@ -183,11 +182,10 @@ class CodeBlob {
relocInfo* relocation_begin() const { return (relocInfo*)_mutable_data; }
relocInfo* relocation_end() const { return (relocInfo*)((address)relocation_begin() + _relocation_size); }
address content_begin() const { return (address) header_begin() + _content_offset; }
address content_end() const { return (address) header_begin() + _code_end_offset; }
address content_end() const { return (address) header_begin() + _size; }
address code_begin() const { return (address) header_begin() + _code_offset; }
// code_end == content_end is true for all types of blobs for now, it is also checked in the constructor
address code_end() const { return (address) header_begin() + _code_end_offset; }
address blob_end() const { return (address) header_begin() + _size; }
address code_end() const { return (address) header_begin() + _size; }
address blob_end() const { return (address) header_begin() + _size; }

// [relocations, oops, metatada, jvmci_data] stays in _mutable_data
address mdata_begin() const { return mutable_data_begin(); }
Expand All @@ -212,7 +210,6 @@ class CodeBlob {
// Only used from CodeCache::free_unused_tail() after the Interpreter blob was trimmed
void adjust_size(size_t used) {
_size = (int)used;
_code_end_offset = (int)used;
}

// Containment
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/runtime/vmStructs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@
nonstatic_field(CodeBlob, _content_offset, int) \
nonstatic_field(CodeBlob, _code_offset, int) \
nonstatic_field(CodeBlob, _frame_complete_offset, int16_t) \
nonstatic_field(CodeBlob, _code_end_offset, int) \
nonstatic_field(CodeBlob, _frame_size, int) \
nonstatic_field(CodeBlob, _oop_maps, ImmutableOopMapSet*) \
nonstatic_field(CodeBlob, _caller_must_gc_arguments, bool) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ private static void initialize(TypeDataBase db) {
contentOffsetField = type.getCIntegerField("_content_offset");
codeOffsetField = type.getCIntegerField("_code_offset");
frameCompleteOffsetField = new CIntField(type.getCIntegerField("_frame_complete_offset"), 0);
codeEndOffsetField = type.getCIntegerField("_code_end_offset");
frameSizeField = type.getCIntegerField("_frame_size");
oopMapsField = type.getAddressField("_oop_maps");
mutableDataField = type.getAddressField("_mutable_data");
Expand Down

0 comments on commit 88e3106

Please sign in to comment.