Skip to content

Commit fce02ad

Browse files
committed
8326101: [PPC64] Need to bailout cleanly if creation of stubs fails when code cache is out of space
Backport-of: e3ae81eeeee8e2b0063a576a90624dd927b512f0
1 parent b0e3386 commit fce02ad

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
475475
__ extsw(R7_ARG5, length()->as_register());
476476

477477
ce->emit_static_call_stub();
478+
if (ce->compilation()->bailed_out()) {
479+
return; // CodeCache is full
480+
}
478481

479482
bool success = ce->emit_trampoline_stub_for_call(SharedRuntime::get_resolve_static_call_stub());
480483
if (!success) { return; }

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,10 @@ int HandlerImpl::emit_exception_handler(CodeBuffer &cbuf) {
20642064
C2_MacroAssembler _masm(&cbuf);
20652065

20662066
address base = __ start_a_stub(size_exception_handler());
2067-
if (base == NULL) return 0; // CodeBuffer::expand failed
2067+
if (base == nullptr) {
2068+
ciEnv::current()->record_failure("CodeCache is full");
2069+
return 0; // CodeBuffer::expand failed
2070+
}
20682071

20692072
int offset = __ offset();
20702073
__ b64_patchable((address)OptoRuntime::exception_blob()->content_begin(),
@@ -2081,7 +2084,10 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
20812084
C2_MacroAssembler _masm(&cbuf);
20822085

20832086
address base = __ start_a_stub(size_deopt_handler());
2084-
if (base == NULL) return 0; // CodeBuffer::expand failed
2087+
if (base == nullptr) {
2088+
ciEnv::current()->record_failure("CodeCache is full");
2089+
return 0; // CodeBuffer::expand failed
2090+
}
20852091

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

0 commit comments

Comments
 (0)