29
29
#include " memory/universe.hpp"
30
30
#include " oops/oop.inline.hpp"
31
31
32
- size_t PSPromotionLAB::filler_header_size;
33
-
34
32
// This is the shared initialization code. It sets up the basic pointers,
35
33
// and allows enough extra space for a filler object. We call a virtual
36
34
// method, "lab_is_valid()" to handle the different asserts the old/young
@@ -45,19 +43,15 @@ void PSPromotionLAB::initialize(MemRegion lab) {
45
43
set_end (end);
46
44
set_top (bottom);
47
45
48
- // Initialize after VM starts up because header_size depends on compressed
49
- // oops.
50
- filler_header_size = align_object_size (typeArrayOopDesc::header_size (T_INT));
51
-
52
46
// We can be initialized to a zero size!
53
47
if (free () > 0 ) {
54
48
if (ZapUnusedHeapArea) {
55
49
debug_only (Copy::fill_to_words (top (), free ()/HeapWordSize, badHeapWord));
56
50
}
57
51
58
52
// NOTE! We need to allow space for a filler object.
59
- assert (lab.word_size () >= filler_header_size , " lab is too small" );
60
- end = end - filler_header_size ;
53
+ assert (lab.word_size () >= CollectedHeap::min_dummy_object_size () , " lab is too small" );
54
+ end = end - CollectedHeap::min_dummy_object_size () ;
61
55
set_end (end);
62
56
63
57
_state = needs_flush;
@@ -81,20 +75,8 @@ void PSPromotionLAB::flush() {
81
75
82
76
// PLAB's never allocate the last aligned_header_size
83
77
// so they can always fill with an array.
84
- HeapWord* tlab_end = end () + filler_header_size;
85
- typeArrayOop filler_oop = (typeArrayOop) cast_to_oop (top ());
86
- filler_oop->set_mark (markWord::prototype ());
87
- filler_oop->set_klass (Universe::intArrayKlassObj ());
88
- const size_t array_length =
89
- pointer_delta (tlab_end, top ()) - typeArrayOopDesc::header_size (T_INT);
90
- assert ( (array_length * (HeapWordSize/sizeof (jint))) < (size_t )max_jint, " array too big in PSPromotionLAB" );
91
- filler_oop->set_length ((int )(array_length * (HeapWordSize/sizeof (jint))));
92
-
93
- #ifdef ASSERT
94
- // Note that we actually DO NOT want to use the aligned header size!
95
- HeapWord* elt_words = cast_from_oop<HeapWord*>(filler_oop) + typeArrayOopDesc::header_size (T_INT);
96
- Copy::fill_to_words (elt_words, array_length, 0xDEAABABE );
97
- #endif
78
+ HeapWord* tlab_end = end () + CollectedHeap::min_dummy_object_size ();
79
+ CollectedHeap::fill_with_object (top (), tlab_end, trueInDebug);
98
80
99
81
set_bottom (NULL );
100
82
set_end (NULL );
1 commit comments
openjdk-notifier[bot] commentedon Dec 17, 2021
Review
Issues