src/hotspot/share/gc/shared/referenceProcessor.cpp
changeset 58177 4932dce35882
parent 58083 9046db64ca39
child 58679 9c3209ff7550
child 59053 ba6c248cae19
equal deleted inserted replaced
58176:470af058bd5f 58177:4932dce35882
   280   assert(oopDesc::is_oop(_current_discovered), "Dropping a bad reference");
   280   assert(oopDesc::is_oop(_current_discovered), "Dropping a bad reference");
   281   RawAccess<>::oop_store(_current_discovered_addr, oop(NULL));
   281   RawAccess<>::oop_store(_current_discovered_addr, oop(NULL));
   282 
   282 
   283   // First _prev_next ref actually points into DiscoveredList (gross).
   283   // First _prev_next ref actually points into DiscoveredList (gross).
   284   oop new_next;
   284   oop new_next;
   285   if (oopDesc::equals_raw(_next_discovered, _current_discovered)) {
   285   if (_next_discovered == _current_discovered) {
   286     // At the end of the list, we should make _prev point to itself.
   286     // At the end of the list, we should make _prev point to itself.
   287     // If _ref is the first ref, then _prev_next will be in the DiscoveredList,
   287     // If _ref is the first ref, then _prev_next will be in the DiscoveredList,
   288     // and _prev will be NULL.
   288     // and _prev will be NULL.
   289     new_next = _prev_discovered;
   289     new_next = _prev_discovered;
   290   } else {
   290   } else {
   470 
   470 
   471 void
   471 void
   472 ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) {
   472 ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) {
   473   oop obj = NULL;
   473   oop obj = NULL;
   474   oop next = refs_list.head();
   474   oop next = refs_list.head();
   475   while (!oopDesc::equals_raw(next, obj)) {
   475   while (next != obj) {
   476     obj = next;
   476     obj = next;
   477     next = java_lang_ref_Reference::discovered(obj);
   477     next = java_lang_ref_Reference::discovered(obj);
   478     java_lang_ref_Reference::set_discovered_raw(obj, NULL);
   478     java_lang_ref_Reference::set_discovered_raw(obj, NULL);
   479   }
   479   }
   480   refs_list.clear();
   480   refs_list.clear();
   742         }
   742         }
   743         ref_lists[to_idx].set_head(move_head);
   743         ref_lists[to_idx].set_head(move_head);
   744         ref_lists[to_idx].inc_length(refs_to_move);
   744         ref_lists[to_idx].inc_length(refs_to_move);
   745 
   745 
   746         // Remove the chain from the from list.
   746         // Remove the chain from the from list.
   747         if (oopDesc::equals_raw(move_tail, new_head)) {
   747         if (move_tail == new_head) {
   748           // We found the end of the from list.
   748           // We found the end of the from list.
   749           ref_lists[from_idx].set_head(NULL);
   749           ref_lists[from_idx].set_head(NULL);
   750         } else {
   750         } else {
   751           ref_lists[from_idx].set_head(new_head);
   751           ref_lists[from_idx].set_head(new_head);
   752         }
   752         }