89 for (int i = 0; i < lgrp_spaces()->length(); i++) { |
89 for (int i = 0; i < lgrp_spaces()->length(); i++) { |
90 LGRPSpace *ls = lgrp_spaces()->at(i); |
90 LGRPSpace *ls = lgrp_spaces()->at(i); |
91 MutableSpace *s = ls->space(); |
91 MutableSpace *s = ls->space(); |
92 if (s->top() < top()) { // For all spaces preceding the one containing top() |
92 if (s->top() < top()) { // For all spaces preceding the one containing top() |
93 if (s->free_in_words() > 0) { |
93 if (s->free_in_words() > 0) { |
94 intptr_t cur_top = (intptr_t)s->top(); |
94 HeapWord* cur_top = s->top(); |
95 size_t words_left_to_fill = pointer_delta(s->end(), s->top());; |
95 size_t words_left_to_fill = pointer_delta(s->end(), s->top());; |
96 while (words_left_to_fill > 0) { |
96 while (words_left_to_fill > 0) { |
97 size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size()); |
97 size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size()); |
98 assert(words_to_fill >= CollectedHeap::min_fill_size(), |
98 assert(words_to_fill >= CollectedHeap::min_fill_size(), |
99 "Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")", |
99 "Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")", |
100 words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size()); |
100 words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size()); |
101 CollectedHeap::fill_with_object((HeapWord*)cur_top, words_to_fill); |
101 CollectedHeap::fill_with_object(cur_top, words_to_fill); |
102 if (!os::numa_has_static_binding()) { |
102 if (!os::numa_has_static_binding()) { |
103 size_t touched_words = words_to_fill; |
103 size_t touched_words = words_to_fill; |
104 #ifndef ASSERT |
104 #ifndef ASSERT |
105 if (!ZapUnusedHeapArea) { |
105 if (!ZapUnusedHeapArea) { |
106 touched_words = MIN2((size_t)align_object_size(typeArrayOopDesc::header_size(T_INT)), |
106 touched_words = MIN2((size_t)align_object_size(typeArrayOopDesc::header_size(T_INT)), |
107 touched_words); |
107 touched_words); |
108 } |
108 } |
109 #endif |
109 #endif |
110 MemRegion invalid; |
110 MemRegion invalid; |
111 HeapWord *crossing_start = align_up((HeapWord*)cur_top, os::vm_page_size()); |
111 HeapWord *crossing_start = align_up(cur_top, os::vm_page_size()); |
112 HeapWord *crossing_end = align_down((HeapWord*)(cur_top + touched_words), os::vm_page_size()); |
112 HeapWord *crossing_end = align_down(cur_top + touched_words, os::vm_page_size()); |
113 if (crossing_start != crossing_end) { |
113 if (crossing_start != crossing_end) { |
114 // If object header crossed a small page boundary we mark the area |
114 // If object header crossed a small page boundary we mark the area |
115 // as invalid rounding it to a page_size(). |
115 // as invalid rounding it to a page_size(). |
116 HeapWord *start = MAX2(align_down((HeapWord*)cur_top, page_size()), s->bottom()); |
116 HeapWord *start = MAX2(align_down(cur_top, page_size()), s->bottom()); |
117 HeapWord *end = MIN2(align_up((HeapWord*)(cur_top + touched_words), page_size()), s->end()); |
117 HeapWord *end = MIN2(align_up(cur_top + touched_words, page_size()), s->end()); |
118 invalid = MemRegion(start, end); |
118 invalid = MemRegion(start, end); |
119 } |
119 } |
120 |
120 |
121 ls->add_invalid_region(invalid); |
121 ls->add_invalid_region(invalid); |
122 } |
122 } |
123 cur_top = cur_top + (words_to_fill * HeapWordSize); |
123 cur_top += words_to_fill; |
124 words_left_to_fill -= words_to_fill; |
124 words_left_to_fill -= words_to_fill; |
125 } |
125 } |
126 } |
126 } |
127 } else { |
127 } else { |
128 if (!os::numa_has_static_binding()) { |
128 if (!os::numa_has_static_binding()) { |