8181906: AArch64: port bugfix for 7009641 to AArch64
authorfyang
Sat, 10 Jun 2017 16:01:29 +0800
changeset 45620 d66b032663cb
parent 45516 f25253621ba1
child 45621 7c9f1ec5b693
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
hotspot/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
--- 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);