RFR: 8347489: RISC-V: Misaligned memory access with COH [v4]
Fei Yang
fyang at openjdk.org
Mon Jan 27 13:47:53 UTC 2025
On Wed, 15 Jan 2025 14:59:27 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> Fei Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
>>
>> - Merge branch 'master' into JDK-8347489
>> - Comment
>> - Fix assertions
>> - Add assertions
>> - Comment
>> - 8347489: RISC-V: Misaligned memory access with COH
>
> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1418:
>
>> 1416: assert((base_offset1 % (UseCompactObjectHeaders ? 4 :
>> 1417: (UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
>> 1418: assert((base_offset2 % (UseCompactObjectHeaders ? 4 :
>
> should it be something like `assert((base_offset1 == base_offset2));` ?
Seems to me that is more than needed. Our code doesn't require that `base_offset1` must equal `base_offset2`. We only care about the alignment of them here, which is reflected on the current two assertions.
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2512:
>
>> 2510: assert((base_offset1 % (UseCompactObjectHeaders ? 4 :
>> 2511: (UseCompressedClassPointers ? 8 : 4))) == 0, "Must be");
>> 2512: assert((base_offset2 % (UseCompactObjectHeaders ? 4 :
>
> should it be something like `assert((base_offset1 == base_offset2));` ?
Please see my comment above. Let me know if you have more comments. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23053#discussion_r1930550354
PR Review Comment: https://git.openjdk.org/jdk/pull/23053#discussion_r1930551680
More information about the hotspot-compiler-dev
mailing list