On Mon, 4 May 2026 07:46:16 GMT, Marc Chevalier <[email protected]> wrote:

>> src/hotspot/share/c1/c1_LIRGenerator.cpp line 1727:
>> 
>>> 1725:   if (index.result()->is_constant()) {
>>> 1726:     jint const_index = index.result()->as_jint();
>>> 1727:     __ move(LIR_OprFact::longConst((jlong)const_index << shift), 
>>> index_op);
>> 
>> You could use a `static_cast` instead:
>> 
>> Suggestion:
>> 
>>     __ move(LIR_OprFact::longConst(static_cast<jlong>(const_index) << 
>> shift), index_op);
>
> It's the C++ way of doing it, but we have a lot of C-style casts everywhere. 
> Should we nevertheless go the C++ way?

Yes, I think we should go with the C++ way for new code.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2380#discussion_r3180077131

Reply via email to