RFR: 8310577: Fix -Wconversion warnings in interpreter and oops
Frederic Parain
fparain at openjdk.org
Thu Jun 22 14:00:09 UTC 2023
On Wed, 21 Jun 2023 19:45:45 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
> Please review this change that's mostly casts and a few int type narrowing changes. The casts are for size calculations between two addresses within the same area so can be int and are never going to be 64 bit.
> I didn't change CompileThreshold to be 'int' because SA and JVMCI code expects it to be intx. Maybe that should change though.
> Tested with tier1 on Oracle platforms, and tier1-4 linux and windows x64.
Overall, looks good. One fix could be better in invocationCounter.hpp.
src/hotspot/share/interpreter/invocationCounter.hpp line 71:
> 69: bool carry() const { return (_counter & carry_mask) != 0; }
> 70: uint count() const { return _counter >> number_of_noncount_bits; }
> 71: uint limit() const { return (uint)CompileThreshold; }
CompileThreshold is an intx, and can be set by users on the command line. Casting it to uint looks wrong. This method seems to be used in only one place (invocationCounter.cpp:69), so changing the return type of the method to intx and fixing the print statement where it is used could be a better fix.
-------------
Changes requested by fparain (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14604#pullrequestreview-1493160843
PR Review Comment: https://git.openjdk.org/jdk/pull/14604#discussion_r1238509941
More information about the hotspot-dev
mailing list