RFR: 8280003: C1: Reconsider uses of logical_and immediates in LIRGenerator::do_getObjectSize [v5]

Igor Veresov iveresov at openjdk.java.net
Thu Feb 10 00:03:10 UTC 2022


On Wed, 9 Feb 2022 23:13:59 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revert ARM32 checks
>
> src/hotspot/share/c1/c1_LIRGenerator.cpp line 1418:
> 
>> 1416:   __ add(length, header_size_long, length);
>> 1417:   if (round_mask != 0) {
>> 1418:     LIR_Opr round_mask_opr = load_immediate(~(jlong)round_mask, T_LONG);
> 
> Explicitly casting to jlong here seems unnecessary.  We don't do that at line 1425.

It's going to work for the current value of `round_mask` either way, but I think in general I would cast to an `unsigned long` and then flip the bits. A signed cast will fill the upper bits with ones if the original value was negative. It's usually not what you want with masking.

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

PR: https://git.openjdk.java.net/jdk/pull/7080


More information about the hotspot-compiler-dev mailing list