Mercurial > hg > truffle
diff src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @ 481:7d7a7c599c17
6578152: fill_region_with_object has usability and safety issues
Reviewed-by: apetrusenko, ysr
author | jcoomes |
---|---|
date | Thu, 11 Dec 2008 12:05:08 -0800 |
parents | 85f1b9537f70 |
children | 4e400c36026f |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Wed Dec 10 23:46:10 2008 -0800 +++ b/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp Thu Dec 11 12:05:08 2008 -0800 @@ -76,8 +76,8 @@ MutableSpace *s = ls->space(); if (s->top() < top()) { // For all spaces preceeding the one containing top() if (s->free_in_words() > 0) { - SharedHeap::fill_region_with_object(MemRegion(s->top(), s->end())); size_t area_touched_words = pointer_delta(s->end(), s->top()); + CollectedHeap::fill_with_object(s->top(), area_touched_words); #ifndef ASSERT if (!ZapUnusedHeapArea) { area_touched_words = MIN2((size_t)align_object_size(typeArrayOopDesc::header_size(T_INT)), @@ -686,11 +686,11 @@ // a minimal object; assuming that's not the last chunk in which case we don't care. if (i < lgrp_spaces()->length() - 1) { size_t remainder = pointer_delta(s->end(), value); - const size_t minimal_object_size = oopDesc::header_size(); - if (remainder < minimal_object_size && remainder > 0) { - // Add a filler object of a minimal size, it will cross the chunk boundary. - SharedHeap::fill_region_with_object(MemRegion(value, minimal_object_size)); - value += minimal_object_size; + const size_t min_fill_size = CollectedHeap::min_fill_size(); + if (remainder < min_fill_size && remainder > 0) { + // Add a minimum size filler object; it will cross the chunk boundary. + CollectedHeap::fill_with_object(value, min_fill_size); + value += min_fill_size; assert(!s->contains(value), "Should be in the next chunk"); // Restart the loop from the same chunk, since the value has moved // to the next one.