< prev index next >

src/share/vm/memory/referenceProcessor.cpp

Print this page
rev 7793 : 8073315: Enable gcc -Wtype-limits and fix upcoming issues.


 970   }
 971 
 972   return total_list_count;
 973 }
 974 
 975 inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) {
 976   uint id = 0;
 977   // Determine the queue index to use for this object.
 978   if (_discovery_is_mt) {
 979     // During a multi-threaded discovery phase,
 980     // each thread saves to its "own" list.
 981     Thread* thr = Thread::current();
 982     id = thr->as_Worker_thread()->id();
 983   } else {
 984     // single-threaded discovery, we save in round-robin
 985     // fashion to each of the lists.
 986     if (_processing_is_mt) {
 987       id = next_id();
 988     }
 989   }
 990   assert(0 <= id && id < _max_num_q, "Id is out-of-bounds (call Freud?)");
 991 
 992   // Get the discovered queue to which we will add
 993   DiscoveredList* list = NULL;
 994   switch (rt) {
 995     case REF_OTHER:
 996       // Unknown reference type, no special treatment
 997       break;
 998     case REF_SOFT:
 999       list = &_discoveredSoftRefs[id];
1000       break;
1001     case REF_WEAK:
1002       list = &_discoveredWeakRefs[id];
1003       break;
1004     case REF_FINAL:
1005       list = &_discoveredFinalRefs[id];
1006       break;
1007     case REF_PHANTOM:
1008       list = &_discoveredPhantomRefs[id];
1009       break;
1010     case REF_CLEANER:


1328         keep_alive->do_oop(next_addr);
1329       }
1330       iter.move_to_next();
1331     } else {
1332       iter.next();
1333     }
1334   }
1335   // Close the reachable set
1336   complete_gc->do_void();
1337 
1338   NOT_PRODUCT(
1339     if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) {
1340       gclog_or_tty->print_cr(" Dropped %d Refs out of %d "
1341         "Refs in discovered list " INTPTR_FORMAT,
1342         iter.removed(), iter.processed(), (address)refs_list.head());
1343     }
1344   )
1345 }
1346 
1347 const char* ReferenceProcessor::list_name(uint i) {
1348    assert(i >= 0 && i <= _max_num_q * number_of_subclasses_of_ref(),
1349           "Out of bounds index");
1350 
1351    int j = i / _max_num_q;
1352    switch (j) {
1353      case 0: return "SoftRef";
1354      case 1: return "WeakRef";
1355      case 2: return "FinalRef";
1356      case 3: return "PhantomRef";
1357      case 4: return "CleanerRef";
1358    }
1359    ShouldNotReachHere();
1360    return NULL;
1361 }
1362 
1363 #ifndef PRODUCT
1364 void ReferenceProcessor::verify_ok_to_handle_reflists() {
1365   // empty for now
1366 }
1367 #endif
1368 


 970   }
 971 
 972   return total_list_count;
 973 }
 974 
 975 inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) {
 976   uint id = 0;
 977   // Determine the queue index to use for this object.
 978   if (_discovery_is_mt) {
 979     // During a multi-threaded discovery phase,
 980     // each thread saves to its "own" list.
 981     Thread* thr = Thread::current();
 982     id = thr->as_Worker_thread()->id();
 983   } else {
 984     // single-threaded discovery, we save in round-robin
 985     // fashion to each of the lists.
 986     if (_processing_is_mt) {
 987       id = next_id();
 988     }
 989   }
 990   assert(id < _max_num_q, "Id is out-of-bounds (call Freud?)");
 991 
 992   // Get the discovered queue to which we will add
 993   DiscoveredList* list = NULL;
 994   switch (rt) {
 995     case REF_OTHER:
 996       // Unknown reference type, no special treatment
 997       break;
 998     case REF_SOFT:
 999       list = &_discoveredSoftRefs[id];
1000       break;
1001     case REF_WEAK:
1002       list = &_discoveredWeakRefs[id];
1003       break;
1004     case REF_FINAL:
1005       list = &_discoveredFinalRefs[id];
1006       break;
1007     case REF_PHANTOM:
1008       list = &_discoveredPhantomRefs[id];
1009       break;
1010     case REF_CLEANER:


1328         keep_alive->do_oop(next_addr);
1329       }
1330       iter.move_to_next();
1331     } else {
1332       iter.next();
1333     }
1334   }
1335   // Close the reachable set
1336   complete_gc->do_void();
1337 
1338   NOT_PRODUCT(
1339     if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) {
1340       gclog_or_tty->print_cr(" Dropped %d Refs out of %d "
1341         "Refs in discovered list " INTPTR_FORMAT,
1342         iter.removed(), iter.processed(), (address)refs_list.head());
1343     }
1344   )
1345 }
1346 
1347 const char* ReferenceProcessor::list_name(uint i) {
1348    assert(i <= _max_num_q * number_of_subclasses_of_ref(),
1349           "Out of bounds index");
1350 
1351    int j = i / _max_num_q;
1352    switch (j) {
1353      case 0: return "SoftRef";
1354      case 1: return "WeakRef";
1355      case 2: return "FinalRef";
1356      case 3: return "PhantomRef";
1357      case 4: return "CleanerRef";
1358    }
1359    ShouldNotReachHere();
1360    return NULL;
1361 }
1362 
1363 #ifndef PRODUCT
1364 void ReferenceProcessor::verify_ok_to_handle_reflists() {
1365   // empty for now
1366 }
1367 #endif
1368 
< prev index next >