--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2011-12-20 11:11:15.874446676 -0800 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp 2011-12-20 11:11:15.640002377 -0800 @@ -862,7 +862,8 @@ // An attempt to evacuate "obj" has failed; take necessary steps. oop handle_evacuation_failure_par(OopsInHeapRegionClosure* cl, oop obj, - bool should_mark_root); + bool should_mark_root, + int worker_i); void handle_evacuation_failure_common(oop obj, markOop m); // ("Weak") Reference processing support. @@ -1730,6 +1731,7 @@ // enough bits in the bitmap. return bits_in_bitmap + BitsPerWord - 1; } + public: GCLabBitMap(HeapWord* heap_start, size_t gclab_word_size) : BitMap(bitmap_size_in_bits(gclab_word_size)), @@ -1819,30 +1821,7 @@ } #endif // PRODUCT - void retire() { - guarantee(use_local_bitmaps, "invariant"); - assert(fields_well_formed(), "invariant"); - - if (_start_word != NULL) { - CMBitMap* mark_bitmap = _cm->nextMarkBitMap(); - - // this means that the bitmap was set up for the GCLab - assert(_real_start_word != NULL && _real_end_word != NULL, "invariant"); - - mark_bitmap->mostly_disjoint_range_union(this, - 0, // always start from the start of the bitmap - _start_word, - gclab_real_word_size()); - _cm->grayRegionIfNecessary(MemRegion(_real_start_word, _real_end_word)); - -#ifndef PRODUCT - if (use_local_bitmaps && verify_local_bitmaps) - verify(); -#endif // PRODUCT - } else { - assert(_real_start_word == NULL && _real_end_word == NULL, "invariant"); - } - } + void retire(int worker_i); size_t bitmap_size_in_words() const { return (bitmap_size_in_bits(gclab_word_size()) + BitsPerWord - 1) / BitsPerWord; @@ -1855,9 +1834,10 @@ bool _retired; bool _should_mark_objects; GCLabBitMap _bitmap; + int _worker_i; public: - G1ParGCAllocBuffer(size_t gclab_word_size); + G1ParGCAllocBuffer(size_t gclab_word_size, int worker_i); inline bool mark(HeapWord* addr) { guarantee(use_local_bitmaps, "invariant"); @@ -1877,7 +1857,7 @@ if (_retired) return; if (use_local_bitmaps && _should_mark_objects) { - _bitmap.retire(); + _bitmap.retire(_worker_i); } ParGCAllocBuffer::retire(end_of_gc, retain); _retired = true;