Print this page
rev 2896 : 7121547: G1: High number mispredicted branches while iterating over the marking bitmap
Summary: There is a high number of mispredicted branches associated with calling BitMap::iteratate() from within CMBitMapRO::iterate(). Implement a version of CMBitMapRO::iterate() directly using inline-able routines.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/concurrentMark.hpp
          +++ new/src/share/vm/gc_implementation/g1/concurrentMark.hpp
↓ open down ↓ 76 lines elided ↑ open up ↑
  77   77  
  78   78    // read marks
  79   79  
  80   80    bool isMarked(HeapWord* addr) const {
  81   81      assert(_bmStartWord <= addr && addr < (_bmStartWord + _bmWordSize),
  82   82             "outside underlying space?");
  83   83      return _bm.at(heapWordToOffset(addr));
  84   84    }
  85   85  
  86   86    // iteration
  87      -  bool iterate(BitMapClosure* cl) { return _bm.iterate(cl); }
  88      -  bool iterate(BitMapClosure* cl, MemRegion mr);
       87 +  inline bool iterate(BitMapClosure* cl, MemRegion mr);
       88 +  inline bool iterate(BitMapClosure* cl);
  89   89  
  90   90    // Return the address corresponding to the next marked bit at or after
  91   91    // "addr", and before "limit", if "limit" is non-NULL.  If there is no
  92   92    // such bit, returns "limit" if that is non-NULL, or else "endWord()".
  93   93    HeapWord* getNextMarkedWordAddress(HeapWord* addr,
  94   94                                       HeapWord* limit = NULL) const;
  95   95    // Return the address corresponding to the next unmarked bit at or after
  96   96    // "addr", and before "limit", if "limit" is non-NULL.  If there is no
  97   97    // such bit, returns "limit" if that is non-NULL, or else "endWord()".
  98   98    HeapWord* getNextUnmarkedWordAddress(HeapWord* addr,
↓ open down ↓ 1148 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX