--- a/src/hotspot/share/gc/shared/collectedHeap.cpp Wed Jun 13 10:01:53 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp Wed Jun 13 10:15:35 2018 +0200
@@ -526,6 +526,10 @@
fill_with_object_impl(start, words, zap);
}
+void CollectedHeap::fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap) {
+ CollectedHeap::fill_with_object(start, end, zap);
+}
+
HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
size_t requested_size,
size_t* actual_size) {
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp Wed Jun 13 10:01:53 2018 +0200
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Wed Jun 13 10:15:35 2018 +0200
@@ -350,6 +350,8 @@
fill_with_object(start, pointer_delta(end, start), zap);
}
+ virtual void fill_with_dummy_object(HeapWord* start, HeapWord* end, bool zap);
+
// Return the address "addr" aligned by "alignment_in_bytes" if such
// an address is below "end". Return NULL otherwise.
inline static HeapWord* align_allocation_or_fail(HeapWord* addr,
--- a/src/hotspot/share/gc/shared/plab.cpp Wed Jun 13 10:01:53 2018 +0200
+++ b/src/hotspot/share/gc/shared/plab.cpp Wed Jun 13 10:15:35 2018 +0200
@@ -82,14 +82,14 @@
size_t PLAB::retire_internal() {
size_t result = 0;
if (_top < _hard_end) {
- CollectedHeap::fill_with_object(_top, _hard_end);
+ Universe::heap()->fill_with_dummy_object(_top, _hard_end, true);
result += invalidate();
}
return result;
}
void PLAB::add_undo_waste(HeapWord* obj, size_t word_sz) {
- CollectedHeap::fill_with_object(obj, word_sz);
+ Universe::heap()->fill_with_dummy_object(obj, obj + word_sz, true);
_undo_wasted += word_sz;
}
--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Wed Jun 13 10:01:53 2018 +0200
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Wed Jun 13 10:15:35 2018 +0200
@@ -114,7 +114,7 @@
myThread()->incr_allocated_bytes(used_bytes());
}
- CollectedHeap::fill_with_object(top(), hard_end(), retire && zap);
+ Universe::heap()->fill_with_dummy_object(top(), hard_end(), retire && zap);
if (retire || ZeroTLAB) { // "Reset" the TLAB
set_start(NULL);