RFR: 8310906: Fix -Wconversion warnings in runtime, oops and some code header files.
Coleen Phillimore
coleenp at openjdk.org
Mon Jun 26 21:31:04 UTC 2023
On Mon, 26 Jun 2023 20:19:47 GMT, Frederic Parain <fparain at openjdk.org> wrote:
>> More casts for size of address differences in same code space, checked_casts<> and type changes to fix -Wconversion warnings. See CR for details.
>> Tested with tier1-4.
>
> src/hotspot/cpu/aarch64/continuationFreezeThaw_aarch64.inline.hpp line 220:
>
>> 218: // If caller is interpreted it already made room for the callee arguments
>> 219: int overlap = caller.is_interpreted_frame() ? ContinuationHelper::InterpretedFrame::stack_argsize(hf) : 0;
>> 220: const int fsize = checked_cast<int>(ContinuationHelper::InterpretedFrame::frame_bottom(hf) - hf.unextended_sp() - overlap);
>
> This line computes the size of the unextended frame minus the overlap that exists if the callee is using arguments in the caller’s frame. So this value is lower or equal to the frame’ size which is encoded with an int. I don't think a checked_cast is required here. This applies to the x86 version too.
I'll make this change in the new PR. I'm going to redo the address calculations to call a function rather than the casts.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14659#discussion_r1242788203
More information about the hotspot-dev
mailing list