< prev index next >

src/hotspot/share/gc/shared/referenceProcessor.cpp

Print this page
rev 50108 : [mq]: tschatzl_1


 362 }
 363 
 364 inline void log_dropped_ref(const DiscoveredListIterator& iter, const char* reason) {
 365   log_develop_trace(gc, ref)("Dropping %s reference " PTR_FORMAT ": %s",
 366                              reason, p2i(iter.obj()),
 367                              iter.obj()->klass()->internal_name());
 368 }
 369 
 370 // Traverse the list and remove any Refs whose referents are alive,
 371 // or NULL if discovery is not atomic.
 372 void ReferenceProcessor::process_phase2(DiscoveredList&    refs_list,
 373                                         BoolObjectClosure* is_alive,
 374                                         OopClosure*        keep_alive,
 375                                         VoidClosure*       complete_gc) {
 376   // complete_gc is unused.
 377   DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
 378   while (iter.has_next()) {
 379     iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */));
 380     if (iter.referent() == NULL) {
 381       // Reference has been cleared since discovery; only possible if
 382       // discovery is not atomic.  Remove reference from list.

 383       log_dropped_ref(iter, "cleared");
 384       iter.remove();
 385       iter.move_to_next();
 386     } else if (iter.is_referent_alive()) {
 387       // The referent is reachable after all.
 388       // Remove reference from list.
 389       log_dropped_ref(iter, "reachable");
 390       iter.remove();
 391       // Update the referent pointer as necessary.  Note that this
 392       // should not entail any recursive marking because the
 393       // referent must already have been traversed.
 394       iter.make_referent_alive();
 395       iter.move_to_next();
 396     } else {
 397       iter.next();
 398     }
 399   }
 400   NOT_PRODUCT(
 401     if (iter.processed() > 0) {
 402       log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT




 362 }
 363 
 364 inline void log_dropped_ref(const DiscoveredListIterator& iter, const char* reason) {
 365   log_develop_trace(gc, ref)("Dropping %s reference " PTR_FORMAT ": %s",
 366                              reason, p2i(iter.obj()),
 367                              iter.obj()->klass()->internal_name());
 368 }
 369 
 370 // Traverse the list and remove any Refs whose referents are alive,
 371 // or NULL if discovery is not atomic.
 372 void ReferenceProcessor::process_phase2(DiscoveredList&    refs_list,
 373                                         BoolObjectClosure* is_alive,
 374                                         OopClosure*        keep_alive,
 375                                         VoidClosure*       complete_gc) {
 376   // complete_gc is unused.
 377   DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
 378   while (iter.has_next()) {
 379     iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */));
 380     if (iter.referent() == NULL) {
 381       // Reference has been cleared since discovery; only possible if
 382       // discovery is not atomic (checked by load_ptrs).  Remove
 383       // reference from list.
 384       log_dropped_ref(iter, "cleared");
 385       iter.remove();
 386       iter.move_to_next();
 387     } else if (iter.is_referent_alive()) {
 388       // The referent is reachable after all.
 389       // Remove reference from list.
 390       log_dropped_ref(iter, "reachable");
 391       iter.remove();
 392       // Update the referent pointer as necessary.  Note that this
 393       // should not entail any recursive marking because the
 394       // referent must already have been traversed.
 395       iter.make_referent_alive();
 396       iter.move_to_next();
 397     } else {
 398       iter.next();
 399     }
 400   }
 401   NOT_PRODUCT(
 402     if (iter.processed() > 0) {
 403       log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT


< prev index next >