126 _keep_alive->do_oop((narrowOop*)_referent_addr); 127 } else { 128 _keep_alive->do_oop((oop*)_referent_addr); 129 } 130 } 131 132 // Do enqueuing work, i.e. notifying the GC about the changed discovered pointers. 133 void enqueue(); 134 135 // Move enqueued references to the reference pending list. 136 void complete_enqueue(); 137 138 // NULL out referent pointer. 139 void clear_referent(); 140 141 // Statistics 142 inline size_t processed() const { return _processed; } 143 inline size_t removed() const { return _removed; } 144 145 inline void move_to_next() { 146 if (oopDesc::safe_equals(_current_discovered, _next_discovered)) { 147 // End of the list. 148 _current_discovered = NULL; 149 } else { 150 _current_discovered = _next_discovered; 151 } 152 assert(! oopDesc::safe_equals(_current_discovered, _first_seen), "cyclic ref_list found"); 153 _processed++; 154 } 155 }; 156 157 // The ReferenceProcessor class encapsulates the per-"collector" processing 158 // of java.lang.Reference objects for GC. The interface is useful for supporting 159 // a generational abstraction, in particular when there are multiple 160 // generations that are being independently collected -- possibly 161 // concurrently and/or incrementally. 162 // ReferenceProcessor class abstracts away from a generational setting 163 // by using a closure that determines whether a given reference or referent are 164 // subject to this ReferenceProcessor's discovery, thus allowing its use in a 165 // straightforward manner in a general, non-generational, non-contiguous generation 166 // (or heap) setting. 167 class ReferenceProcessor : public ReferenceDiscoverer { 168 friend class RefProcPhase1Task; 169 friend class RefProcPhase2Task; 170 friend class RefProcPhase3Task; 171 friend class RefProcPhase4Task; 172 public: | 126 _keep_alive->do_oop((narrowOop*)_referent_addr); 127 } else { 128 _keep_alive->do_oop((oop*)_referent_addr); 129 } 130 } 131 132 // Do enqueuing work, i.e. notifying the GC about the changed discovered pointers. 133 void enqueue(); 134 135 // Move enqueued references to the reference pending list. 136 void complete_enqueue(); 137 138 // NULL out referent pointer. 139 void clear_referent(); 140 141 // Statistics 142 inline size_t processed() const { return _processed; } 143 inline size_t removed() const { return _removed; } 144 145 inline void move_to_next() { 146 if (oopDesc::unsafe_equals(_current_discovered, _next_discovered)) { 147 // End of the list. 148 _current_discovered = NULL; 149 } else { 150 _current_discovered = _next_discovered; 151 } 152 assert(! oopDesc::unsafe_equals(_current_discovered, _first_seen), "cyclic ref_list found"); 153 _processed++; 154 } 155 }; 156 157 // The ReferenceProcessor class encapsulates the per-"collector" processing 158 // of java.lang.Reference objects for GC. The interface is useful for supporting 159 // a generational abstraction, in particular when there are multiple 160 // generations that are being independently collected -- possibly 161 // concurrently and/or incrementally. 162 // ReferenceProcessor class abstracts away from a generational setting 163 // by using a closure that determines whether a given reference or referent are 164 // subject to this ReferenceProcessor's discovery, thus allowing its use in a 165 // straightforward manner in a general, non-generational, non-contiguous generation 166 // (or heap) setting. 167 class ReferenceProcessor : public ReferenceDiscoverer { 168 friend class RefProcPhase1Task; 169 friend class RefProcPhase2Task; 170 friend class RefProcPhase3Task; 171 friend class RefProcPhase4Task; 172 public: |