< prev index next >

src/share/vm/gc/g1/g1ConcurrentMark.cpp

Print this page

        

*** 69,79 **** } HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr, const HeapWord* limit) const { // First we must round addr *up* to a possible object boundary. ! addr = align_ptr_up(addr, HeapWordSize << _shifter); size_t addrOffset = heapWordToOffset(addr); assert(limit != NULL, "limit must not be NULL"); size_t limitOffset = heapWordToOffset(limit); size_t nextOffset = _bm.get_next_one_offset(addrOffset, limitOffset); HeapWord* nextAddr = offsetToHeapWord(nextOffset); --- 69,79 ---- } HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr, const HeapWord* limit) const { // First we must round addr *up* to a possible object boundary. ! addr = align_up(addr, HeapWordSize << _shifter); size_t addrOffset = heapWordToOffset(addr); assert(limit != NULL, "limit must not be NULL"); size_t limitOffset = heapWordToOffset(limit); size_t nextOffset = _bm.get_next_one_offset(addrOffset, limitOffset); HeapWord* nextAddr = offsetToHeapWord(nextOffset);
*** 96,106 **** void G1CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const { _bm.print_on_error(st, prefix); } size_t G1CMBitMap::compute_size(size_t heap_size) { ! return ReservedSpace::allocation_align_size_up(heap_size / mark_distance()); } size_t G1CMBitMap::mark_distance() { return MinObjAlignmentInBytes * BitsPerByte; } --- 96,106 ---- void G1CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const { _bm.print_on_error(st, prefix); } size_t G1CMBitMap::compute_size(size_t heap_size) { ! return ReservedSpace::allocation_align_up(heap_size / mark_distance()); } size_t G1CMBitMap::mark_distance() { return MinObjAlignmentInBytes * BitsPerByte; }
*** 168,179 **** bool G1CMMarkStack::initialize(size_t initial_capacity, size_t max_capacity) { guarantee(_max_chunk_capacity == 0, "G1CMMarkStack already initialized."); size_t const TaskEntryChunkSizeInVoidStar = sizeof(TaskQueueEntryChunk) / sizeof(G1TaskQueueEntry); ! _max_chunk_capacity = align_size_up(max_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar; ! size_t initial_chunk_capacity = align_size_up(initial_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar; guarantee(initial_chunk_capacity <= _max_chunk_capacity, "Maximum chunk capacity " SIZE_FORMAT " smaller than initial capacity " SIZE_FORMAT, _max_chunk_capacity, initial_chunk_capacity); --- 168,179 ---- bool G1CMMarkStack::initialize(size_t initial_capacity, size_t max_capacity) { guarantee(_max_chunk_capacity == 0, "G1CMMarkStack already initialized."); size_t const TaskEntryChunkSizeInVoidStar = sizeof(TaskQueueEntryChunk) / sizeof(G1TaskQueueEntry); ! _max_chunk_capacity = align_up(max_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar; ! size_t initial_chunk_capacity = align_up(initial_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar; guarantee(initial_chunk_capacity <= _max_chunk_capacity, "Maximum chunk capacity " SIZE_FORMAT " smaller than initial capacity " SIZE_FORMAT, _max_chunk_capacity, initial_chunk_capacity);
*** 712,722 **** void G1ConcurrentMark::clear_bitmap(G1CMBitMap* bitmap, WorkGang* workers, bool may_yield) { assert(may_yield || SafepointSynchronize::is_at_safepoint(), "Non-yielding bitmap clear only allowed at safepoint."); size_t const num_bytes_to_clear = (HeapRegion::GrainBytes * _g1h->num_regions()) / G1CMBitMap::heap_map_factor(); ! size_t const num_chunks = align_size_up(num_bytes_to_clear, G1ClearBitMapTask::chunk_size()) / G1ClearBitMapTask::chunk_size(); uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers()); G1ClearBitMapTask cl(bitmap, this, num_workers, may_yield); --- 712,722 ---- void G1ConcurrentMark::clear_bitmap(G1CMBitMap* bitmap, WorkGang* workers, bool may_yield) { assert(may_yield || SafepointSynchronize::is_at_safepoint(), "Non-yielding bitmap clear only allowed at safepoint."); size_t const num_bytes_to_clear = (HeapRegion::GrainBytes * _g1h->num_regions()) / G1CMBitMap::heap_map_factor(); ! size_t const num_chunks = align_up(num_bytes_to_clear, G1ClearBitMapTask::chunk_size()) / G1ClearBitMapTask::chunk_size(); uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers()); G1ClearBitMapTask cl(bitmap, this, num_workers, may_yield);
< prev index next >