Skip to content

Commit 44fdfc7

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 c8e9f1d commit 44fdfc7

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
@@ -456,6 +456,9 @@ void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
456456
__ extsw(R7_ARG5, length()->as_register());
457457

458458
ce->emit_static_call_stub();
459+
if (ce->compilation()->bailed_out()) {
460+
return; // CodeCache is full
461+
}
459462

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

src/hotspot/cpu/ppc/ppc.ad

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

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

20672070
int offset = __ offset();
20682071
__ b64_patchable((address)OptoRuntime::exception_blob()->content_begin(),
@@ -2079,7 +2082,10 @@ int HandlerImpl::emit_deopt_handler(CodeBuffer& cbuf) {
20792082
C2_MacroAssembler _masm(&cbuf);
20802083

20812084
address base = __ start_a_stub(size_deopt_handler());
2082-
if (base == NULL) return 0; // CodeBuffer::expand failed
2085+
if (base == nullptr) {
2086+
ciEnv::current()->record_failure("CodeCache is full");
2087+
return 0; // CodeBuffer::expand failed
2088+
}
20832089

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

0 commit comments

Comments
 (0)