RFR: 8267532: C2: Profile and prune untaken exception handlers [v5]

Jorn Vernee jvernee at openjdk.org
Wed Nov 15 01:37:32 UTC 2023


On Tue, 14 Nov 2023 17:00:56 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> > ```
> > I don't see much value in 2 separate product flags to control profiling and optimization logic (`ProfileExceptionHandlers` and `PruneDeadExceptionHandlers`); having a single product flag should be enough;
> > ```
> 
> 
> Okay, I can use `PruneDeadExceptionHandlers` everywhere instead.

I gave this a go. However, it looks like the build is failing on some platforms because the profiling code is also included in builds excluding C2, but `PruneDeadExceptionHandlers` is a C2 only flag. The two options I see to work around that are to: 1. make the `PruneDeadExceptionHandlers` flag a global flag, which is a bit strange since it is only used by C2. Or: 2. put all the profiling code in `#ifdef COMPILER2` blocks, which makes the code harder to read. But, if other parts of the VM want to use the profiling data as well (besides C2), we'd also need 2 flags again, since theoretically C2 might be excluded, but profiling would still be needed. I think after all, it's better to have 2 separate flags to avoid these issues (now and in the future). Unless we want to turn on profiling always (without a flag).

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

PR Comment: https://git.openjdk.org/jdk/pull/16416#issuecomment-1811657788


More information about the hotspot-dev mailing list