RFR: 8315875: GenShen: Remove heap mode check from ShenandoahInitLogger

Kelvin Nilsen kdnilsen at openjdk.org
Thu Sep 7 21:48:12 UTC 2023


On Thu, 7 Sep 2023 18:45:36 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> There are some additional improvements to the init logger that should be easy to upstream.
>
> src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp line 55:
> 
>> 53:   ShenandoahHeap* heap = ShenandoahHeap::heap();
>> 54:   log_info(gc, init)("Mode: %s", heap->mode()->name());
>> 55:   log_info(gc, init)("Heuristics: %s", heap->global_generation()->heuristics()->name());
> 
> Note - we still reference the `global_generation` abstraction in this file and we won't have that upstream. I wonder if we should push that abstraction back into `ShenandoahHeap` so that this code in `ShenandoahInitLogger` could call `ShenandoahHeap::heuristics` directly, with an implementation like:
> ```C++
> ShenandoahHeuristics* ShenandoahHeap::heuristics() {
>   return global_generation()->heuristics();
> }

Yeah.  Your proposed change might make the abstraction a bit cleaner.

-------------

PR Review Comment: https://git.openjdk.org/shenandoah/pull/320#discussion_r1319146050


More information about the shenandoah-dev mailing list