RFR: 8310577: Fix -Wconversion warnings in interpreter and oops [v2]

Coleen Phillimore coleenp at openjdk.org
Thu Jun 22 15:56:15 UTC 2023


On Thu, 22 Jun 2023 15:27:45 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fred's suggestion.
>
> src/hotspot/share/interpreter/bytecodeUtils.cpp line 356:
> 
>> 354: StackSlotAnalysisData::StackSlotAnalysisData(BasicType type) : _bci(INVALID), _type(type) {}
>> 355: 
>> 356: StackSlotAnalysisData::StackSlotAnalysisData(int bci, BasicType type) : _bci((u2)bci), _type(type) {
> 
> Looking at this more closely, it seems like bci is meant to be a u2 but it needs one extra bit for the "INVALID" value. Maybe it's possible to represent invalid bci's differently? That way we can just set _bci to be a u2.

If I pass u2 bci, it'll fit in the field.  The INVALID bit is added after bci - ie the bci is never INVALID.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14604#discussion_r1238729553


More information about the hotspot-dev mailing list