< prev index next >

src/cpu/aarch64/vm/vtableStubs_aarch64.cpp

Print this page
rev 13093 : 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

@@ -49,10 +49,15 @@
 #endif
 
 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);
 
 #ifndef PRODUCT
< prev index next >