Skip to content

Commit c5ba4b5

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

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

451451
ce->emit_static_call_stub();
452+
if (ce->compilation()->bailed_out()) {
453+
return; // CodeCache is full
454+
}
452455

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

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,10 @@ int HandlerImpl::emit_exception_handler(CodeBuffer &cbuf) {
21622162
MacroAssembler _masm(&cbuf);
21632163

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

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

21812184
address base = __ start_a_stub(size_deopt_handler());
2182-
if (base == NULL) return 0; // CodeBuffer::expand failed
2185+
if (base == NULL) {
2186+
ciEnv::current()->record_failure("CodeCache is full");
2187+
return 0; // CodeBuffer::expand failed
2188+
}
21832189

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

0 commit comments

Comments
 (0)