JDK-8031401 : Remove unused code in the reference processor
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-01-08
  • Updated: 2015-06-03
  • Resolved: 2015-04-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b66Fixed
Related Reports
Relates :  
Description
In JDK 7u2 the way the reference processor manages the pending list was changed. This was done as part of JDK-4965777. The code to support the old behavior is still there, but haven't been used for a long time and could be removed.

This basically means that code using ReferenceProcessor::pending_list_uses_discovered_field() should be cleaned up and ReferenceProcessor::pending_list_uses_discovered_field() should be removed. The following files are affected.

prims/jvm.h
runtime/java.hpp
runtime/java.cpp
oops/instanceRefKlass.cpp
memory/referenceProcessor.hpp
memory/referenceProcessor.cpp

Comments
make_active should have been conditionalized on pending_list_uses_discovered_field; part of the reason for the change to use the discovered field is to avoid semantic contention for the next field. make_active can actually cause problems, and should just not be called in the new world of pending_list_uses_discovered_field being true.
18-03-2015

These two methods in ReferenceProcessor are only used by the old behavior. Remove them too? static void set_next(oop ref, oop value) { ref->obj_field_put(next_offset, value); } static void set_discovered(oop ref, oop value) { ref->obj_field_put(discovered_offset, value); }
28-05-2014

We think that the pre barrier in make_active also can be removed when the old behavior is removed: void DiscoveredListIterator::make_active() { // The pre barrier for G1 is probably just needed for the old // reference processing behavior. Should we guard this with // ReferenceProcessor::pending_list_uses_discovered_field() ? if (UseG1GC) { HeapWord* next_addr = java_lang_ref_Reference::next_addr(_ref); if (UseCompressedOops) { oopDesc::bs()->write_ref_field_pre((narrowOop*)next_addr, NULL); } else { oopDesc::bs()->write_ref_field_pre((oop*)next_addr, NULL); } } java_lang_ref_Reference::set_next_raw(_ref, NULL); }
28-05-2014