From 77e7b6d2a135ed46ba405914b4eea7412d887705 Mon Sep 17 00:00:00 2001 From: Gui Cao Date: Fri, 30 Jun 2023 00:16:57 +0000 Subject: [PATCH] 8311074: RISC-V: Fix -Wconversion warnings in some code header files Reviewed-by: fyang, coleenp --- src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/frame_riscv.inline.hpp | 2 +- src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp index 71c22ad263c..5bfa1a8756c 100644 --- a/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/continuationFreezeThaw_riscv.inline.hpp @@ -219,7 +219,7 @@ template frame ThawBase::new_stack_frame(const frame& hf, frame& intptr_t* heap_sp = hf.unextended_sp(); // If caller is interpreted it already made room for the callee arguments int overlap = caller.is_interpreted_frame() ? ContinuationHelper::InterpretedFrame::stack_argsize(hf) : 0; - const int fsize = ContinuationHelper::InterpretedFrame::frame_bottom(hf) - hf.unextended_sp() - overlap; + const int fsize = (int)(ContinuationHelper::InterpretedFrame::frame_bottom(hf) - hf.unextended_sp() - overlap); const int locals = hf.interpreter_frame_method()->max_locals(); intptr_t* frame_sp = caller.unextended_sp() - fsize; intptr_t* fp = frame_sp + (hf.fp() - heap_sp); diff --git a/src/hotspot/cpu/riscv/frame_riscv.inline.hpp b/src/hotspot/cpu/riscv/frame_riscv.inline.hpp index 1ae91bf19e7..40455805984 100644 --- a/src/hotspot/cpu/riscv/frame_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/frame_riscv.inline.hpp @@ -226,7 +226,7 @@ inline intptr_t* frame::real_fp() const { inline int frame::frame_size() const { return is_interpreted_frame() - ? sender_sp() - sp() + ? pointer_delta_as_int(sender_sp(), sp()) : cb()->frame_size(); } diff --git a/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp b/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp index 38ee1de6470..d43b556dad1 100644 --- a/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp +++ b/src/hotspot/cpu/riscv/stackChunkFrameStream_riscv.inline.hpp @@ -114,8 +114,8 @@ inline int StackChunkFrameStream::interpreter_frame_num_oops() const f.interpreted_frame_oop_map(&mask); return mask.num_oops() + 1 // for the mirror oop - + ((intptr_t*)f.interpreter_frame_monitor_begin() - - (intptr_t*)f.interpreter_frame_monitor_end()) / BasicObjectLock::size(); + + pointer_delta_as_int((intptr_t*)f.interpreter_frame_monitor_begin(), + (intptr_t*)f.interpreter_frame_monitor_end()) / BasicObjectLock::size(); } template<>