JDK-8027746 : Remove do_gen_barrier template parameter in G1ParCopyClosure
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs25,8
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-11-02
  • Updated: 2014-07-29
  • Resolved: 2014-01-20
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 8 JDK 9
8u20Fixed 9 b03Fixed
Description
The do_gen_barrier template parameter is set to false in all closures that are used in G1.

Further, the code added by this template parameter in G1ParCopyClosure::do_oop_work is conceptually flawed anyway: it calls ParScanClosure::par_do_barrier(), which does not work in G1.

In particular, it uses OopsInGenClosure::gen_boundary() which cannot be used in G1.

Also remove the G1ParScanAndMarkClosure typedef which is the only one that sets this do_gen_barrier template parameter to true, but is otherwise unreferenced.

I also think OopsInHeapRegionClosure should inherit from ExtendedOopClosure, not OopsInGenClosure, as G1 does not have such a simple view on generations as other collectors (i.e. a simple address boundary).

This would also decrease memory footprint of closures, possibly increasing locality of access of other members that are actually accessed in the oop closures.
Comments
The use of OopsInGenClosure has been a renmant of the old permanent generation and hence can be removed completely.
07-11-2013