8325671: Shenandoah: Introduce a ShenandoahGenerationType and templatize certain marking closures with it
In support of eventually supporting a generational version of Shenandoah, we introduce a ShenandoahGenerationType enum which currently has a single NON_GEN value for Shenandoah. The generational extension of Shenandoah will introduce additional enum values when GenShen is integrated. These will be used to specialize certain marking closures via templatization, such that suitable variations of the marking (and in the future other) closures can be used for the generational and non-generational variants of the collector while minimizing interference between the two variants while maximizing code-sharing without affecting correctness or performance.
This ticket introduces the new enum type and templatizes certain existing marking closures.
In effect, this should be semantically a no-op for current (non-generational) Shenandoah and ideally completely performance-neutral (to be established via measurements).
**Testing:**
- [x] jtreg hotspot_gc
- [x] github actions
- [ ] codepipeline perf & stress: in progress
**Performance:**
- [ ] specjbb w/shenandoah
- [ ] codepipeline perf: in progress
Reviewed-by: kdnilsen, shade
Author
Y. Srinivas Ramakrishna