comparison src/share/vm/gc_implementation/g1/g1RemSet.inline.hpp @ 677:96b229c54d1e

6543938: G1: remove the concept of popularity Reviewed-by: iveresov, tonyp
author apetrusenko
date Wed, 25 Mar 2009 13:10:54 -0700
parents 87fa6e083d82
children bd02caa94611 df6caf649ff7
comparison
equal deleted inserted replaced
649:59f139e8a8d1 677:96b229c54d1e
63 assert(from == NULL || from->is_in_reserved(p), 63 assert(from == NULL || from->is_in_reserved(p),
64 "p is not in from"); 64 "p is not in from");
65 HeapRegion* to = _g1->heap_region_containing(obj); 65 HeapRegion* to = _g1->heap_region_containing(obj);
66 // The test below could be optimized by applying a bit op to to and from. 66 // The test below could be optimized by applying a bit op to to and from.
67 if (to != NULL && from != NULL && from != to) { 67 if (to != NULL && from != NULL && from != to) {
68 bool update_delayed = false;
69 // There is a tricky infinite loop if we keep pushing 68 // There is a tricky infinite loop if we keep pushing
70 // self forwarding pointers onto our _new_refs list. 69 // self forwarding pointers onto our _new_refs list.
71 // The _par_traversal_in_progress flag is true during the collection pause, 70 // The _par_traversal_in_progress flag is true during the collection pause,
72 // false during the evacuation failure handing. 71 // false during the evacuation failure handing.
73 if (_par_traversal_in_progress && 72 if (_par_traversal_in_progress &&
75 _new_refs[tid]->push(p); 74 _new_refs[tid]->push(p);
76 // Deferred updates to the Cset are either discarded (in the normal case), 75 // Deferred updates to the Cset are either discarded (in the normal case),
77 // or processed (if an evacuation failure occurs) at the end 76 // or processed (if an evacuation failure occurs) at the end
78 // of the collection. 77 // of the collection.
79 // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do(). 78 // See HRInto_G1RemSet::cleanup_after_oops_into_collection_set_do().
80 update_delayed = true; 79 } else {
81 }
82
83 if (!to->popular() && !update_delayed) {
84 #if G1_REM_SET_LOGGING 80 #if G1_REM_SET_LOGGING
85 gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS" 81 gclog_or_tty->print_cr("Adding " PTR_FORMAT " (" PTR_FORMAT ") to RS"
86 " for region [" PTR_FORMAT ", " PTR_FORMAT ")", 82 " for region [" PTR_FORMAT ", " PTR_FORMAT ")",
87 p, obj, 83 p, obj,
88 to->bottom(), to->end()); 84 to->bottom(), to->end());
89 #endif 85 #endif
90 assert(to->rem_set() != NULL, "Need per-region 'into' remsets."); 86 assert(to->rem_set() != NULL, "Need per-region 'into' remsets.");
91 if (to->rem_set()->add_reference(p, tid)) { 87 to->rem_set()->add_reference(p, tid);
92 _g1->schedule_popular_region_evac(to);
93 }
94 } 88 }
95 } 89 }
96 } 90 }
97 91
98 inline void UpdateRSOopClosure::do_oop(narrowOop* p) { 92 inline void UpdateRSOopClosure::do_oop(narrowOop* p) {