< prev index next >

src/hotspot/share/gc/parallel/mutableNUMASpace.cpp

Print this page

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

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