Skip to content

Commit 65c8dbe

Browse files
author
Thomas Schatzl
committedMay 24, 2023
8171221: Remove -XX:+CheckMemoryInitialization
Reviewed-by: ayang, shade
1 parent 2d4d850 commit 65c8dbe

File tree

6 files changed

+0
-125
lines changed

6 files changed

+0
-125
lines changed
 

‎src/hotspot/share/gc/shared/collectedHeap.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,6 @@ void CollectedHeap::set_gc_cause(GCCause::Cause v) {
400400
_gc_cause = v;
401401
}
402402

403-
#ifndef PRODUCT
404-
void CollectedHeap::check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) {
405-
if (CheckMemoryInitialization && ZapUnusedHeapArea) {
406-
// please note mismatch between size (in 32/64 bit words), and ju_addr that always point to a 32 bit word
407-
for (juint* ju_addr = reinterpret_cast<juint*>(addr); ju_addr < reinterpret_cast<juint*>(addr + size); ++ju_addr) {
408-
assert(*ju_addr == badHeapWordVal, "Found non badHeapWordValue in pre-allocation check");
409-
}
410-
}
411-
}
412-
#endif // PRODUCT
413-
414403
size_t CollectedHeap::max_tlab_size() const {
415404
// TLABs can't be bigger than we can fill with a int[Integer.MAX_VALUE].
416405
// This restriction could be removed by enabling filling with multiple arrays.

‎src/hotspot/share/gc/shared/collectedHeap.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ class CollectedHeap : public CHeapObj<mtGC> {
181181
virtual void trace_heap(GCWhen::Type when, const GCTracer* tracer);
182182

183183
// Verification functions
184-
virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size)
185-
PRODUCT_RETURN;
186184
debug_only(static void check_for_valid_allocation_state();)
187185

188186
public:

‎src/hotspot/share/gc/shared/memAllocator.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class MemAllocator::Allocation: StackObj {
6161
void notify_allocation_low_memory_detector();
6262
void notify_allocation_jfr_sampler();
6363
void notify_allocation_dtrace_sampler(JavaThread* thread);
64-
void check_for_bad_heap_word_value() const;
6564
#ifdef ASSERT
6665
void check_for_valid_allocation_state() const;
6766
#endif
@@ -83,7 +82,6 @@ class MemAllocator::Allocation: StackObj {
8382

8483
~Allocation() {
8584
if (!check_out_of_memory()) {
86-
verify_after();
8785
notify_allocation(_thread);
8886
}
8987
}
@@ -150,22 +148,6 @@ void MemAllocator::Allocation::verify_before() {
150148
assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed");
151149
}
152150

153-
void MemAllocator::Allocation::verify_after() {
154-
NOT_PRODUCT(check_for_bad_heap_word_value();)
155-
}
156-
157-
void MemAllocator::Allocation::check_for_bad_heap_word_value() const {
158-
MemRegion obj_range = _allocator.obj_memory_range(obj());
159-
HeapWord* addr = obj_range.start();
160-
size_t size = obj_range.word_size();
161-
if (CheckMemoryInitialization && ZapUnusedHeapArea) {
162-
for (size_t slot = 0; slot < size; slot += 1) {
163-
assert((*(intptr_t*) (addr + slot)) != ((intptr_t) badHeapWordVal),
164-
"Found badHeapWordValue in post-allocation check");
165-
}
166-
}
167-
}
168-
169151
#ifdef ASSERT
170152
void MemAllocator::Allocation::check_for_valid_allocation_state() const {
171153
// How to choose between a pending exception and a potential
@@ -260,7 +242,6 @@ HeapWord* MemAllocator::mem_allocate_outside_tlab(Allocation& allocation) const
260242
return mem;
261243
}
262244

263-
NOT_PRODUCT(Universe::heap()->check_for_non_bad_heap_word_value(mem, _word_size));
264245
size_t size_in_bytes = _word_size * HeapWordSize;
265246
_thread->incr_allocated_bytes(size_in_bytes);
266247

‎src/hotspot/share/runtime/globals.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -887,10 +887,6 @@ const int ObjectAlignmentInBytes = 8;
887887
develop(bool, FLSVerifyDictionary, false, \
888888
"Do lots of (expensive) FLS dictionary verification") \
889889
\
890-
\
891-
notproduct(bool, CheckMemoryInitialization, false, \
892-
"Check memory initialization") \
893-
\
894890
product(uintx, ProcessDistributionStride, 4, \
895891
"Stride through processors when distributing processes") \
896892
range(0, max_juint) \

‎test/hotspot/jtreg/gc/TestMemoryInitialization.java

-48
This file was deleted.

‎test/hotspot/jtreg/gc/TestMemoryInitializationWithSerial.java

-41
This file was deleted.

0 commit comments

Comments
 (0)