Print this page
rev 3463 : 7114678: G1: various small fixes, code cleanup, and refactoring
Summary: Various cleanups as a prelude to introducing iterators for HeapRegions.
Reviewed-by: johnc
Contributed-by: tonyp

Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
          +++ new/src/share/vm/gc_implementation/g1/g1OopClosures.inline.hpp
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28  #include "gc_implementation/g1/concurrentMark.inline.hpp"
  29   29  #include "gc_implementation/g1/g1CollectedHeap.hpp"
  30   30  #include "gc_implementation/g1/g1OopClosures.hpp"
  31   31  #include "gc_implementation/g1/g1RemSet.hpp"
  32   32  
  33   33  /*
  34   34   * This really ought to be an inline function, but apparently the C++
  35   35   * compiler sometimes sees fit to ignore inline declarations.  Sigh.
  36   36   */
  37   37  
  38      -// This must a ifdef'ed because the counting it controls is in a
  39      -// perf-critical inner loop.
  40      -#define FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT 0
  41      -
  42   38  template <class T>
  43   39  inline void FilterIntoCSClosure::do_oop_nv(T* p) {
  44   40    T heap_oop = oopDesc::load_heap_oop(p);
  45   41    if (!oopDesc::is_null(heap_oop) &&
  46   42        _g1->obj_in_cs(oopDesc::decode_heap_oop_not_null(heap_oop))) {
  47   43      _oc->do_oop(p);
  48      -#if FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT
  49      -    if (_dcto_cl != NULL)
  50      -      _dcto_cl->incr_count();
  51      -#endif
  52   44    }
  53   45  }
  54   46  
  55      -#define FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT 0
  56      -
  57   47  template <class T>
  58   48  inline void FilterOutOfRegionClosure::do_oop_nv(T* p) {
  59   49    T heap_oop = oopDesc::load_heap_oop(p);
  60   50    if (!oopDesc::is_null(heap_oop)) {
  61   51      HeapWord* obj_hw = (HeapWord*)oopDesc::decode_heap_oop_not_null(heap_oop);
  62   52      if (obj_hw < _r_bottom || obj_hw >= _r_end) {
  63   53        _oc->do_oop(p);
  64      -#if FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT
  65      -      _out_of_region++;
  66      -#endif
  67   54      }
  68   55    }
  69   56  }
  70   57  
  71   58  // This closure is applied to the fields of the objects that have just been copied.
  72   59  template <class T>
  73   60  inline void G1ParScanClosure::do_oop_nv(T* p) {
  74   61    T heap_oop = oopDesc::load_heap_oop(p);
  75   62  
  76   63    if (!oopDesc::is_null(heap_oop)) {
↓ open down ↓ 150 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX