changeset 10916:bd1ccfcfc1c5

8262073: assert(allocates2(pc)) failed: not in CodeBuffer memory Summary: increase size for aarch64 itable and vtable stubs Reviewed-by: aph
author fyang
date Mon, 22 Feb 2021 21:10:12 +0800
parents 2048ae231a90
children 39e98bb4e79a
files src/cpu/aarch64/vm/vtableStubs_aarch64.cpp
diffstat 1 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp	Mon Feb 22 06:58:03 2021 +0000
+++ b/src/cpu/aarch64/vm/vtableStubs_aarch64.cpp	Mon Feb 22 21:10:12 2021 +0800
@@ -94,6 +94,7 @@
 
   __ lookup_virtual_method(r16, vtable_index, rmethod);
 
+#ifndef PRODUCT
   if (DebugVtables) {
     Label L;
     __ cbz(rmethod, L);
@@ -102,6 +103,8 @@
     __ stop("Vtable entry is NULL");
     __ bind(L);
   }
+#endif // PRODUCT
+
   // r0: receiver klass
   // rmethod: Method*
   // r2: receiver
@@ -130,6 +133,11 @@
   // returned by pd_code_size_limit!
   const int code_length = VtableStub::pd_code_size_limit(false);
   VtableStub* s = new(code_length) VtableStub(false, itable_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(), code_length);
   MacroAssembler* masm = new MacroAssembler(&cb);
@@ -139,7 +147,7 @@
     __ lea(r10, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
     __ incrementw(Address(r10));
   }
-#endif
+#endif // PRODUCT
 
   // Entry arguments:
   //  rscratch2: CompiledICHolder
@@ -182,7 +190,7 @@
   // method (rmethod): Method*
   // j_rarg0: receiver
 
-#ifdef ASSERT
+#ifndef PRODUCT
   if (DebugVtables) {
     Label L2;
     __ cbz(rmethod, L2);
@@ -191,7 +199,7 @@
     __ stop("compiler entrypoint is null");
     __ bind(L2);
   }
-#endif // ASSERT
+#endif // PRODUCT
 
   // rmethod: Method*
   // j_rarg0: receiver
@@ -218,14 +226,10 @@
 
 
 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
-  int size = DebugVtables ? 216 : 0;
-  if (CountCompiledCalls)
-    size += 6 * 4;
-  // FIXME: vtable stubs only need 36 bytes
-  if (is_vtable_stub)
-    size += 52;
-  else
-    size += 176;
+  if (TraceJumps || DebugVtables || CountCompiledCalls || VerifyOops) {
+    return 1000;
+  }
+  int size = is_vtable_stub ? 60 : 192; // Plain + safety
   return size;
 
   // In order to tune these parameters, run the JVM with VM options