< prev index next >

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

Print this page




  68   // This method should do nothing.
  69 }
  70 void MutableNUMASpace::check_mangled_unused_area_complete() {
  71   // This method should do nothing.
  72 }
  73 #endif  // NOT_PRODUCT
  74 
  75 // There may be unallocated holes in the middle chunks
  76 // that should be filled with dead objects to ensure parsability.
  77 void MutableNUMASpace::ensure_parsability() {
  78   for (int i = 0; i < lgrp_spaces()->length(); i++) {
  79     LGRPSpace *ls = lgrp_spaces()->at(i);
  80     MutableSpace *s = ls->space();
  81     if (s->top() < top()) { // For all spaces preceding the one containing top()
  82       if (s->free_in_words() > 0) {
  83         intptr_t cur_top = (intptr_t)s->top();
  84         size_t words_left_to_fill = pointer_delta(s->end(), s->top());;
  85         while (words_left_to_fill > 0) {
  86           size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size());
  87           assert(words_to_fill >= CollectedHeap::min_fill_size(),
  88             err_msg("Remaining size ("SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")",
  89             words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size()));
  90           CollectedHeap::fill_with_object((HeapWord*)cur_top, words_to_fill);
  91           if (!os::numa_has_static_binding()) {
  92             size_t touched_words = words_to_fill;
  93 #ifndef ASSERT
  94             if (!ZapUnusedHeapArea) {
  95               touched_words = MIN2((size_t)align_object_size(typeArrayOopDesc::header_size(T_INT)),
  96                 touched_words);
  97             }
  98 #endif
  99             MemRegion invalid;
 100             HeapWord *crossing_start = (HeapWord*)round_to(cur_top, os::vm_page_size());
 101             HeapWord *crossing_end = (HeapWord*)round_to(cur_top + touched_words, os::vm_page_size());
 102             if (crossing_start != crossing_end) {
 103               // If object header crossed a small page boundary we mark the area
 104               // as invalid rounding it to a page_size().
 105               HeapWord *start = MAX2((HeapWord*)round_down(cur_top, page_size()), s->bottom());
 106               HeapWord *end = MIN2((HeapWord*)round_to(cur_top + touched_words, page_size()), s->end());
 107               invalid = MemRegion(start, end);
 108             }




  68   // This method should do nothing.
  69 }
  70 void MutableNUMASpace::check_mangled_unused_area_complete() {
  71   // This method should do nothing.
  72 }
  73 #endif  // NOT_PRODUCT
  74 
  75 // There may be unallocated holes in the middle chunks
  76 // that should be filled with dead objects to ensure parsability.
  77 void MutableNUMASpace::ensure_parsability() {
  78   for (int i = 0; i < lgrp_spaces()->length(); i++) {
  79     LGRPSpace *ls = lgrp_spaces()->at(i);
  80     MutableSpace *s = ls->space();
  81     if (s->top() < top()) { // For all spaces preceding the one containing top()
  82       if (s->free_in_words() > 0) {
  83         intptr_t cur_top = (intptr_t)s->top();
  84         size_t words_left_to_fill = pointer_delta(s->end(), s->top());;
  85         while (words_left_to_fill > 0) {
  86           size_t words_to_fill = MIN2(words_left_to_fill, CollectedHeap::filler_array_max_size());
  87           assert(words_to_fill >= CollectedHeap::min_fill_size(),
  88             err_msg("Remaining size (" SIZE_FORMAT ") is too small to fill (based on " SIZE_FORMAT " and " SIZE_FORMAT ")",
  89             words_to_fill, words_left_to_fill, CollectedHeap::filler_array_max_size()));
  90           CollectedHeap::fill_with_object((HeapWord*)cur_top, words_to_fill);
  91           if (!os::numa_has_static_binding()) {
  92             size_t touched_words = words_to_fill;
  93 #ifndef ASSERT
  94             if (!ZapUnusedHeapArea) {
  95               touched_words = MIN2((size_t)align_object_size(typeArrayOopDesc::header_size(T_INT)),
  96                 touched_words);
  97             }
  98 #endif
  99             MemRegion invalid;
 100             HeapWord *crossing_start = (HeapWord*)round_to(cur_top, os::vm_page_size());
 101             HeapWord *crossing_end = (HeapWord*)round_to(cur_top + touched_words, os::vm_page_size());
 102             if (crossing_start != crossing_end) {
 103               // If object header crossed a small page boundary we mark the area
 104               // as invalid rounding it to a page_size().
 105               HeapWord *start = MAX2((HeapWord*)round_down(cur_top, page_size()), s->bottom());
 106               HeapWord *end = MIN2((HeapWord*)round_to(cur_top + touched_words, page_size()), s->end());
 107               invalid = MemRegion(start, end);
 108             }


< prev index next >