JDK-8138610 : add assert to ThreadLocalAllocBuffer::clear_before_allocation to check the storage above top
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-09-29
  • Updated: 2020-09-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
This is a patch that came out of JVMCI.

--- old/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp	2015-09-24 08:37:21.000000000 -1000
+++ new/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp	2015-09-24 08:37:21.000000000 -1000
@@ -40,6 +40,9 @@
 
 void ThreadLocalAllocBuffer::clear_before_allocation() {
   _slow_refill_waste += (unsigned)remaining();
+  // In debug mode we expect the storage above top to be uninitialized
+  // or filled with a padding object.
+  assert(!ZapUnusedHeapArea || VM_Version::reserve_for_allocation_prefetch() > 0 || top() == NULL || *(intptr_t*)top() != 0, "overzeroing detected");
   make_parsable(true);   // also retire the TLAB
 }
 
Comments
Function renamed to retire_before_allocation.
24-09-2020