--- old/src/hotspot/share/gc/shared/referenceProcessor.cpp 2018-09-28 16:47:33.274815153 +0200 +++ new/src/hotspot/share/gc/shared/referenceProcessor.cpp 2018-09-28 16:47:33.132818413 +0200 @@ -284,7 +284,7 @@ // First _prev_next ref actually points into DiscoveredList (gross). oop new_next; - if (_next_discovered == _current_discovered) { + if (oopDesc::unsafe_equals(_next_discovered, _current_discovered)) { // At the end of the list, we should make _prev point to itself. // If _ref is the first ref, then _prev_next will be in the DiscoveredList, // and _prev will be NULL. @@ -474,7 +474,7 @@ ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) { oop obj = NULL; oop next = refs_list.head(); - while (next != obj) { + while (! oopDesc::unsafe_equals(next, obj)) { obj = next; next = java_lang_ref_Reference::discovered(obj); java_lang_ref_Reference::set_discovered_raw(obj, NULL); @@ -746,7 +746,7 @@ ref_lists[to_idx].inc_length(refs_to_move); // Remove the chain from the from list. - if (move_tail == new_head) { + if (oopDesc::unsafe_equals(move_tail, new_head)) { // We found the end of the from list. ref_lists[from_idx].set_head(NULL); } else {