RFR: JDK-8287061: Support for rematerializing scalar replaced objects participating in allocation merges [v18]

Vladimir Ivanov vlivanov at openjdk.org
Fri Jun 23 21:28:17 UTC 2023


On Fri, 23 Jun 2023 15:00:15 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:

>> src/hotspot/share/opto/c2_globals.hpp line 473:
>> 
>>> 471:           " register allocation.")                                          \
>>> 472:                                                                             \
>>> 473:   product(bool, ReduceAllocationMerges, true,                               \
>> 
>> I suggest to turn the flag into diagnostic one. There are much stricter requirements for product flags, so better to avoid introducing new ones.
>
> @iwanowww - I'm confused by what a "Diagnostic" flag is. According to [this documentation](https://wiki.openjdk.org/display/HotSpot/Hotspot+Command-line+Flags%3A+Kinds%2C+Lifecycle+and+the+CSR+Process) "Diagnostic flags are not meant for VM tuning or for product modes. They are to be used for VM quality assurance or field diagnosis of VM bugs [...]" I believe the patch I'm proposing is a VM tuning optimization, so should it really be a diagnostic flag? Besides, I think we'll try _at a later moment_ to make this a product flag. Do you think an experimental flag is more appropriate? Thank you.

You can look at it in the following way: since the flag is set to true by default, the feature is unconditionally available in product binaries. The only reason to explicitly specify the flag is to turn the optimization off and it may be needed to diagnose VM crashes or performance regressions. 

As an afterthrought, maybe C2 should check a compiler directive (and not a global flag) to be able to control the optimization up to per-method granularity.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12897#discussion_r1240415979



More information about the security-dev mailing list