On Mon, 4 May 2026 06:54:30 GMT, Christian Hagedorn <[email protected]>
wrote:
>> Tobias Hartmann has updated the pull request incrementally with three
>> additional commits since the last revision:
>>
>> - Whitespace
>> - Merge branch 'JDK-8383628' of github.com:TobiHartmann/valhalla into
>> JDK-8383628
>> - Christian's comments
>
> 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?
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2380#discussion_r3180052392