JDK-8316212 : G1: Filter code root insertion into collection set during root scanning
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 22
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2023-09-13
  • Updated: 2023-12-01
  • Resolved: 2023-12-01
Related Reports
Blocks :  
Description
During weak root scanning (stacks) we update/add nmethods that have oops to the respective code root remembered set.

When the evacuation for an oop in an nmethod fails, we might still be iterating over that region's code root rem set.

This occurrence is currently being filtered out very late in the process, when actually adding that nmethod to the code root rem set.

This is a bit inconvenient because with the CHT-based code root rem set (with JDK-8315503) it requires use of a pair of contains/add methods to be safe. It would be nicer if we could guarantee that code root rem set addition is never called during iteration, then a single insert() call would be just as fine.
Comments
This is a very minor optimization that makes the code less readable, so dropping it.
01-12-2023