hotspot/src/share/vm/gc/g1/g1ConcurrentMark.cpp
changeset 46618 d503911aa948
parent 46573 0f8fae16c5b4
child 46619 a3919f5e8d2b
equal deleted inserted replaced
46617:0330c5fc49ce 46618:d503911aa948
    69 }
    69 }
    70 
    70 
    71 HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
    71 HeapWord* G1CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
    72                                                  const HeapWord* limit) const {
    72                                                  const HeapWord* limit) const {
    73   // First we must round addr *up* to a possible object boundary.
    73   // First we must round addr *up* to a possible object boundary.
    74   addr = (HeapWord*)align_size_up((intptr_t)addr,
    74   addr = align_ptr_up(addr, HeapWordSize << _shifter);
    75                                   HeapWordSize << _shifter);
       
    76   size_t addrOffset = heapWordToOffset(addr);
    75   size_t addrOffset = heapWordToOffset(addr);
    77   assert(limit != NULL, "limit must not be NULL");
    76   assert(limit != NULL, "limit must not be NULL");
    78   size_t limitOffset = heapWordToOffset(limit);
    77   size_t limitOffset = heapWordToOffset(limit);
    79   size_t nextOffset = _bm.get_next_one_offset(addrOffset, limitOffset);
    78   size_t nextOffset = _bm.get_next_one_offset(addrOffset, limitOffset);
    80   HeapWord* nextAddr = offsetToHeapWord(nextOffset);
    79   HeapWord* nextAddr = offsetToHeapWord(nextOffset);
   169 bool G1CMMarkStack::initialize(size_t initial_capacity, size_t max_capacity) {
   168 bool G1CMMarkStack::initialize(size_t initial_capacity, size_t max_capacity) {
   170   guarantee(_max_chunk_capacity == 0, "G1CMMarkStack already initialized.");
   169   guarantee(_max_chunk_capacity == 0, "G1CMMarkStack already initialized.");
   171 
   170 
   172   size_t const TaskEntryChunkSizeInVoidStar = sizeof(TaskQueueEntryChunk) / sizeof(G1TaskQueueEntry);
   171   size_t const TaskEntryChunkSizeInVoidStar = sizeof(TaskQueueEntryChunk) / sizeof(G1TaskQueueEntry);
   173 
   172 
   174   _max_chunk_capacity = (size_t)align_size_up(max_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar;
   173   _max_chunk_capacity = align_size_up(max_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar;
   175   size_t initial_chunk_capacity = (size_t)align_size_up(initial_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar;
   174   size_t initial_chunk_capacity = align_size_up(initial_capacity, capacity_alignment()) / TaskEntryChunkSizeInVoidStar;
   176 
   175 
   177   guarantee(initial_chunk_capacity <= _max_chunk_capacity,
   176   guarantee(initial_chunk_capacity <= _max_chunk_capacity,
   178             "Maximum chunk capacity " SIZE_FORMAT " smaller than initial capacity " SIZE_FORMAT,
   177             "Maximum chunk capacity " SIZE_FORMAT " smaller than initial capacity " SIZE_FORMAT,
   179             _max_chunk_capacity,
   178             _max_chunk_capacity,
   180             initial_chunk_capacity);
   179             initial_chunk_capacity);