RFR: 8335392: C2 MergeStores: enhanced pointer parsing [v6]
Emanuel Peter
epeter at openjdk.org
Tue Oct 29 14:31:37 UTC 2024
On Mon, 28 Oct 2024 13:29:51 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> changes to NoOverflowInt for Dean
>
> src/hotspot/share/opto/mempointer.hpp line 110:
>
>> 108: //
>> 109: // pointer = ms.heapBase() + ms.address() + i
>> 110: // = 0 + 1 * ms.address() + 1 * i
>
> For variation, do you want to change this to `short` to also have an example with a `scale` other than 1 for `MemorySegment`?
good idea!
> src/hotspot/share/opto/mempointer.hpp line 365:
>
>> 363: {
>> 364: const jint max_distance = 1 << 30;
>> 365: assert(_distance < max_distance && _distance > -max_distance, "safe distance");
>
> The variable name "max_distance" suggests that the assert should use `>=` and `<=`. Would that still be correct? Maybe you should add a comment about the max distance and why it has this value.
Good point. I'll try to remember the reason and add better comments.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19970#discussion_r1820915837
PR Review Comment: https://git.openjdk.org/jdk/pull/19970#discussion_r1820918265
More information about the hotspot-compiler-dev
mailing list