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

Sergey Nazarkin snazarki at openjdk.java.net
Mon Jan 17 19:55:22 UTC 2022


On Fri, 14 Jan 2022 15:36:22 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp line 291:
>> 
>>> 289:   assert(type == T_LONG || type == T_INT, "should be");
>>> 290:   LIR_Opr r = make_constant(type, x);
>>> 291:   bool imm_in_range = AsmOperand::is_rotated_imm(x);
>> 
>> is_rotated_imm accepts unsigned int and may return false positive
>
> Right. The best I can come up with is to check the `x` fits the unsigned int. See new commit. I know it builds (cross-compiles), but not sure if it passes tests.

I still observe test failure. Have you tested on x86_32?
`----------System.err:(15/1051)----------
java.lang.IllegalStateException: Error: expected: 1040 (410), actual: 192 (c0)
        at GetObjectSizeIntrinsicsTest.assertEquals(GetObjectSizeIntrinsicsTest.java:294)
        at GetObjectSizeIntrinsicsTest.testSize_newSmallByteArray(GetObjectSizeIntrinsicsTest.java:357)`

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

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


More information about the hotspot-compiler-dev mailing list