RFR: 8359227: Code cache/heap size options should be size_t
Kim Barrett
kbarrett at openjdk.org
Fri Jun 13 07:04:46 UTC 2025
On Fri, 13 Jun 2025 06:57:20 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change that makes the various code cache/heap size options
> consistently be of type size_t.
>
> The shared declarations for these options were all uintx. These options all
> may have platform-defined values. Some of those platform-specific definitions
> were uintx, some were size_t, and some were intx(!). This change makes them
> all consistently size_t.
>
> More details in the first comment.
>
> Testing: mach5 tier1-6
> GHA testing in-progress
In addition to adjusting the types, there are some code changes to deal with
some inconsistencies, benefit from the change (mostly in the form of removal
of some casts), or address issues discovered while examining uses of the
options. The changes in the PR are broken up into a series of commits, mostly
by option or a couple of closely related options. It might be easier to review
parts of the change by looking at some of those individual commits, in order
to more easily see the code changes related to specific options.
One change in particular to note is the change in compilationPolicy.cpp. The
calculation of max_count, depending on explicit option values and such, could
potentially overflow its prior int type, effectively having a random value.
There is still a possibility of a nonsense result if ReservedCodeCacheSize and
CodeCacheMinimumUseSpace are poorly chosen. I'm leaving that pre-existing
issue to the compiler team to deal with.
The reason for my looking at these options in the first place is the incorrect
format strings for error messages in CompilerConfig::check_args_consistency.
They weren't previously noticed because the messages are printed using
jio_fprintf. It might be these should be using UL warnings, but I'm leaving
that to the compiler team to decide.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25791#issuecomment-2969303712
More information about the hotspot-dev
mailing list