RFR: 8310906: Fix -Wconversion warnings in runtime, oops and some code header files.

Frederic Parain fparain at openjdk.org
Mon Jun 26 20:23:08 UTC 2023


On Mon, 26 Jun 2023 17:47:25 GMT, Coleen Phillimore <coleenp 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.

Changes requested by fparain (Reviewer).

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.

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

PR Review: https://git.openjdk.org/jdk/pull/14659#pullrequestreview-1499357905
PR Review Comment: https://git.openjdk.org/jdk/pull/14659#discussion_r1242721648


More information about the hotspot-dev mailing list