Skip to content

Commit

Permalink
8294460: CodeSection::alignment checks for CodeBuffer::SECT_STUBS inc…
Browse files Browse the repository at this point in the history
…orrectly

Reviewed-by: phh, kvn
  • Loading branch information
Boris Ulasevich committed Oct 21, 2022
1 parent 8b010e0 commit 5064718
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hotspot/share/asm/codeBuffer.hpp
Expand Up @@ -452,6 +452,10 @@ class CodeBuffer: public StackObj DEBUG_ONLY(COMMA private Scrubber) {
_shared_stub_to_interp_requests = NULL;
_shared_trampoline_requests = NULL;

_consts.initialize_outer(this, SECT_CONSTS);
_insts.initialize_outer(this, SECT_INSTS);
_stubs.initialize_outer(this, SECT_STUBS);

#ifndef PRODUCT
_decode_begin = NULL;
// Collect block comments, but restrict collection to cases where a disassembly is output.
Expand All @@ -466,9 +470,6 @@ class CodeBuffer: public StackObj DEBUG_ONLY(COMMA private Scrubber) {
}

void initialize(address code_start, csize_t code_size) {
_consts.initialize_outer(this, SECT_CONSTS);
_insts.initialize_outer(this, SECT_INSTS);
_stubs.initialize_outer(this, SECT_STUBS);
_total_start = code_start;
_total_size = code_size;
// Initialize the main section:
Expand Down Expand Up @@ -752,7 +753,7 @@ inline int CodeSection::alignment(int section) {
if (section == CodeBuffer::SECT_INSTS) {
return (int) CodeEntryAlignment;
}
if (CodeBuffer::SECT_STUBS) {
if (section == CodeBuffer::SECT_STUBS) {
// CodeBuffer installer expects sections to be HeapWordSize aligned
return HeapWordSize;
}
Expand Down

1 comment on commit 5064718

@openjdk-notifier
Copy link

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.