comparison src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp @ 8733:9def4075da6d

8008079: G1: Add nextObject routine to CMBitMapRO and replace nextWord Summary: Update the task local finger to the start of the next object when marking aborts, in order to avoid the redundant scanning of all 0's when the marking task restarts, if otherwise updating to the next word. In addition, reuse the routine nextObject() in routine iterate(). Reviewed-by: johnc, ysr Contributed-by: tamao <tao.mao@oracle.com>
author tamao
date Tue, 05 Mar 2013 15:36:56 -0800
parents 8a5ea0a9ccc4
children d55c004e1d4d
comparison
equal deleted inserted replaced
8682:d778bb46a9a5 8733:9def4075da6d
1 /* 1 /*
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
250 BitMap::idx_t start_offset = heapWordToOffset(start_addr); 250 BitMap::idx_t start_offset = heapWordToOffset(start_addr);
251 BitMap::idx_t end_offset = heapWordToOffset(end_addr); 251 BitMap::idx_t end_offset = heapWordToOffset(end_addr);
252 252
253 start_offset = _bm.get_next_one_offset(start_offset, end_offset); 253 start_offset = _bm.get_next_one_offset(start_offset, end_offset);
254 while (start_offset < end_offset) { 254 while (start_offset < end_offset) {
255 HeapWord* obj_addr = offsetToHeapWord(start_offset);
256 oop obj = (oop) obj_addr;
257 if (!cl->do_bit(start_offset)) { 255 if (!cl->do_bit(start_offset)) {
258 return false; 256 return false;
259 } 257 }
260 HeapWord* next_addr = MIN2(obj_addr + obj->size(), end_addr); 258 HeapWord* next_addr = MIN2(nextObject(offsetToHeapWord(start_offset)), end_addr);
261 BitMap::idx_t next_offset = heapWordToOffset(next_addr); 259 BitMap::idx_t next_offset = heapWordToOffset(next_addr);
262 start_offset = _bm.get_next_one_offset(next_offset, end_offset); 260 start_offset = _bm.get_next_one_offset(next_offset, end_offset);
263 } 261 }
264 } 262 }
265 return true; 263 return true;