8181906: AArch64: port bugfix for 7009641 to AArch64
Summary: Allocation in the code cache returns NULL instead of failing the entire VM
Reviewed-by: aph
Contributed-by: teng.lu@linaro.org
--- a/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp Thu Jun 08 23:11:00 2017 +0000
+++ b/hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp Sat Jun 10 16:01:29 2017 +0800
@@ -51,6 +51,11 @@
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
const int aarch64_code_length = VtableStub::pd_code_size_limit(true);
VtableStub* s = new(aarch64_code_length) VtableStub(true, vtable_index);
+ // Can be NULL if there is no free space in the code cache.
+ if (s == NULL) {
+ return NULL;
+ }
+
ResourceMark rm;
CodeBuffer cb(s->entry_point(), aarch64_code_length);
MacroAssembler* masm = new MacroAssembler(&cb);