8204685: Abstraction for TLAB dummy object

Reviewed-by: tschatzl, shade
This commit is contained in:
Roman Kennke 2018-06-13 10:15:35 +02:00
parent 74e093f058
commit cc206eaca5
4 changed files with 9 additions and 3 deletions

View File

@ -526,6 +526,10 @@ void CollectedHeap::fill_with_objects(HeapWord* start, size_t words, bool zap)
fill_with_object_impl(start, words, zap); 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, HeapWord* CollectedHeap::allocate_new_tlab(size_t min_size,
size_t requested_size, size_t requested_size,
size_t* actual_size) { size_t* actual_size) {

View File

@ -350,6 +350,8 @@ class CollectedHeap : public CHeapObj<mtInternal> {
fill_with_object(start, pointer_delta(end, start), zap); 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 // Return the address "addr" aligned by "alignment_in_bytes" if such
// an address is below "end". Return NULL otherwise. // an address is below "end". Return NULL otherwise.
inline static HeapWord* align_allocation_or_fail(HeapWord* addr, inline static HeapWord* align_allocation_or_fail(HeapWord* addr,

View File

@ -82,14 +82,14 @@ void PLAB::retire() {
size_t PLAB::retire_internal() { size_t PLAB::retire_internal() {
size_t result = 0; size_t result = 0;
if (_top < _hard_end) { if (_top < _hard_end) {
CollectedHeap::fill_with_object(_top, _hard_end); Universe::heap()->fill_with_dummy_object(_top, _hard_end, true);
result += invalidate(); result += invalidate();
} }
return result; return result;
} }
void PLAB::add_undo_waste(HeapWord* obj, size_t word_sz) { 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; _undo_wasted += word_sz;
} }

View File

@ -114,7 +114,7 @@ void ThreadLocalAllocBuffer::make_parsable(bool retire, bool zap) {
myThread()->incr_allocated_bytes(used_bytes()); 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 if (retire || ZeroTLAB) { // "Reset" the TLAB
set_start(NULL); set_start(NULL);