34 /* |
34 /* |
35 * This really ought to be an inline function, but apparently the C++ |
35 * This really ought to be an inline function, but apparently the C++ |
36 * compiler sometimes sees fit to ignore inline declarations. Sigh. |
36 * compiler sometimes sees fit to ignore inline declarations. Sigh. |
37 */ |
37 */ |
38 |
38 |
39 // This must a ifdef'ed because the counting it controls is in a |
|
40 // perf-critical inner loop. |
|
41 #define FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT 0 |
|
42 |
|
43 template <class T> |
39 template <class T> |
44 inline void FilterIntoCSClosure::do_oop_nv(T* p) { |
40 inline void FilterIntoCSClosure::do_oop_nv(T* p) { |
45 T heap_oop = oopDesc::load_heap_oop(p); |
41 T heap_oop = oopDesc::load_heap_oop(p); |
46 if (!oopDesc::is_null(heap_oop) && |
42 if (!oopDesc::is_null(heap_oop) && |
47 _g1->obj_in_cs(oopDesc::decode_heap_oop_not_null(heap_oop))) { |
43 _g1->obj_in_cs(oopDesc::decode_heap_oop_not_null(heap_oop))) { |
48 _oc->do_oop(p); |
44 _oc->do_oop(p); |
49 #if FILTERINTOCSCLOSURE_DOHISTOGRAMCOUNT |
45 } |
50 if (_dcto_cl != NULL) |
46 } |
51 _dcto_cl->incr_count(); |
|
52 #endif |
|
53 } |
|
54 } |
|
55 |
|
56 #define FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT 0 |
|
57 |
47 |
58 template <class T> |
48 template <class T> |
59 inline void FilterOutOfRegionClosure::do_oop_nv(T* p) { |
49 inline void FilterOutOfRegionClosure::do_oop_nv(T* p) { |
60 T heap_oop = oopDesc::load_heap_oop(p); |
50 T heap_oop = oopDesc::load_heap_oop(p); |
61 if (!oopDesc::is_null(heap_oop)) { |
51 if (!oopDesc::is_null(heap_oop)) { |
62 HeapWord* obj_hw = (HeapWord*)oopDesc::decode_heap_oop_not_null(heap_oop); |
52 HeapWord* obj_hw = (HeapWord*)oopDesc::decode_heap_oop_not_null(heap_oop); |
63 if (obj_hw < _r_bottom || obj_hw >= _r_end) { |
53 if (obj_hw < _r_bottom || obj_hw >= _r_end) { |
64 _oc->do_oop(p); |
54 _oc->do_oop(p); |
65 #if FILTEROUTOFREGIONCLOSURE_DOHISTOGRAMCOUNT |
|
66 _out_of_region++; |
|
67 #endif |
|
68 } |
55 } |
69 } |
56 } |
70 } |
57 } |
71 |
58 |
72 // This closure is applied to the fields of the objects that have just been copied. |
59 // This closure is applied to the fields of the objects that have just been copied. |