Skip to content

Commit

Permalink
8326101: [PPC64] Need to bailout cleanly if creation of stubs fails w…
Browse files Browse the repository at this point in the history
…hen code cache is out of space

Reviewed-by: mbaesken
Backport-of: e3ae81eeeee8e2b0063a576a90624dd927b512f0
  • Loading branch information
TheRealMDoerr committed Mar 20, 2024
1 parent 7482298 commit c5ba4b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
__ extsw(R7_ARG5, length()->as_register());

ce->emit_static_call_stub();
if (ce->compilation()->bailed_out()) {
return; // CodeCache is full
}

bool success = ce->emit_trampoline_stub_for_call(SharedRuntime::get_resolve_static_call_stub());
if (!success) { return; }
Expand Down
10 changes: 8 additions & 2 deletions src/hotspot/cpu/ppc/ppc.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,10 @@ int HandlerImpl::emit_exception_handler(CodeBuffer &cbuf) {
MacroAssembler _masm(&cbuf);

address base = __ start_a_stub(size_exception_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}

int offset = __ offset();
__ b64_patchable((address)OptoRuntime::exception_blob()->content_begin(),
Expand All @@ -2179,7 +2182,10 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
MacroAssembler _masm(&cbuf);

address base = __ start_a_stub(size_deopt_handler());
if (base == NULL) return 0; // CodeBuffer::expand failed
if (base == NULL) {
ciEnv::current()->record_failure("CodeCache is full");
return 0; // CodeBuffer::expand failed
}

int offset = __ offset();
__ bl64_patchable((address)SharedRuntime::deopt_blob()->unpack(),
Expand Down

1 comment on commit c5ba4b5

@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.