Skip to content

Commit 88e3106

Browse files
committed
remove _code_end_offset
1 parent 0c70bd2 commit 88e3106

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

src/hotspot/share/code/codeBlob.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
7878
_relocation_size(align_up(cb->total_relocation_size(), oopSize)),
7979
_content_offset(CodeBlob::align_code_offset(header_size)),
8080
_code_offset(_content_offset + cb->total_offset_of(cb->insts())),
81-
_code_end_offset(_content_offset + align_up(cb->total_content_size(), oopSize)),
8281
_frame_size(frame_size),
8382
S390_ONLY(_ctable_offset(0) COMMA)
8483
_header_size(header_size),
@@ -91,7 +90,8 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size
9190
assert(is_aligned(_size, oopSize), "unaligned size");
9291
assert(is_aligned(header_size, oopSize), "unaligned size");
9392
assert(is_aligned(_relocation_size, oopSize), "unaligned size");
94-
assert(_code_end_offset <= _size, "codeBlob is too small: %d > %d", _code_end_offset, _size);
93+
int code_end_offset = _content_offset + align_up(cb->total_content_size(), oopSize);
94+
assert(code_end_offset == _size, "wrong codeBlob size: %d != %d", _size, code_end_offset);
9595
assert(code_end() == content_end(), "must be the same - see code_end()");
9696
#ifdef COMPILER1
9797
// probably wrong for tiered
@@ -119,7 +119,6 @@ CodeBlob::CodeBlob(const char* name, CodeBlobKind kind, int size, uint16_t heade
119119
_relocation_size(0),
120120
_content_offset(CodeBlob::align_code_offset(header_size)),
121121
_code_offset(_content_offset),
122-
_code_end_offset(size),
123122
_frame_size(0),
124123
S390_ONLY(_ctable_offset(0) COMMA)
125124
_header_size(header_size),

src/hotspot/share/code/codeBlob.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class CodeBlob {
108108
int _relocation_size; // size of relocation (could be bigger than 64Kb)
109109
int _content_offset; // offset to where content region begins (this includes consts, insts, stubs)
110110
int _code_offset; // offset to where instructions region begins (this includes insts, stubs)
111-
int _code_end_offset; // offset to where code region ends
112111
int _frame_size; // size of stack frame in words (NOT slots. On x64 these are 64bit words)
113112

114113
S390_ONLY(int _ctable_offset;)
@@ -183,11 +182,10 @@ class CodeBlob {
183182
relocInfo* relocation_begin() const { return (relocInfo*)_mutable_data; }
184183
relocInfo* relocation_end() const { return (relocInfo*)((address)relocation_begin() + _relocation_size); }
185184
address content_begin() const { return (address) header_begin() + _content_offset; }
186-
address content_end() const { return (address) header_begin() + _code_end_offset; }
185+
address content_end() const { return (address) header_begin() + _size; }
187186
address code_begin() const { return (address) header_begin() + _code_offset; }
188-
// code_end == content_end is true for all types of blobs for now, it is also checked in the constructor
189-
address code_end() const { return (address) header_begin() + _code_end_offset; }
190-
address blob_end() const { return (address) header_begin() + _size; }
187+
address code_end() const { return (address) header_begin() + _size; }
188+
address blob_end() const { return (address) header_begin() + _size; }
191189

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

218215
// Containment

src/hotspot/share/runtime/vmStructs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@
556556
nonstatic_field(CodeBlob, _content_offset, int) \
557557
nonstatic_field(CodeBlob, _code_offset, int) \
558558
nonstatic_field(CodeBlob, _frame_complete_offset, int16_t) \
559-
nonstatic_field(CodeBlob, _code_end_offset, int) \
560559
nonstatic_field(CodeBlob, _frame_size, int) \
561560
nonstatic_field(CodeBlob, _oop_maps, ImmutableOopMapSet*) \
562561
nonstatic_field(CodeBlob, _caller_must_gc_arguments, bool) \

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ private static void initialize(TypeDataBase db) {
7070
contentOffsetField = type.getCIntegerField("_content_offset");
7171
codeOffsetField = type.getCIntegerField("_code_offset");
7272
frameCompleteOffsetField = new CIntField(type.getCIntegerField("_frame_complete_offset"), 0);
73-
codeEndOffsetField = type.getCIntegerField("_code_end_offset");
7473
frameSizeField = type.getCIntegerField("_frame_size");
7574
oopMapsField = type.getAddressField("_oop_maps");
7675
mutableDataField = type.getAddressField("_mutable_data");

0 commit comments

Comments
 (0)