RFR: 8343837: Remove unnecessary reinterpret_cast from C2AccessValuePtr [v2]
Tobias Hartmann
thartmann at openjdk.org
Fri Nov 8 13:45:38 UTC 2024
On Fri, 8 Nov 2024 13:40:09 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> theoweidmannoracle has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
>>
>> Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
>
> src/hotspot/share/gc/shared/c2/barrierSetC2.hpp line 97:
>
>> 95: C2AccessValue(node, type) {}
>> 96:
>> 97: const TypePtr* type() const { return static_cast<const TypePtr*>(_type); }
>
> I think this should be:
>
> Suggestion:
>
> const TypePtr* type() const { return _type->is_ptr(); }
>
>
> Which has the advantage that we assert that the type is as expected.
And yes the name of this method is suboptimal :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21977#discussion_r1834424016
More information about the hotspot-dev
mailing list