RFR: 8325467: Support methods with many arguments in C2 [v17]
Emanuel Peter
epeter at openjdk.org
Fri Jun 20 10:26:44 UTC 2025
On Fri, 25 Apr 2025 18:07:54 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:
>> src/hotspot/share/opto/regmask.hpp line 429:
>>
>>> 427: }
>>> 428:
>>> 429: RegMask(const RegMask& rm) : RegMask(rm, nullptr) {}
>>
>> This is the copy constructor, right? Can you add a comment what kind of implementation you chose here, and why?
>
> Yes, it is the copy constructor. Can you elaborate a bit on what type of comment you expect? There are already some comments in the `copy` method.
I think I was wondering if it was shallow or deep copying, but it has been a while since I reviewed.
>> src/hotspot/share/opto/regmask.hpp line 452:
>>
>>> 450: assert(valid_watermarks(), "sanity");
>>> 451: for (unsigned i = _lwm; i <= _hwm; i++) {
>>> 452: if (_rm_up(i)) {
>>
>> Is this an implicit `nullptr` check? If so, you need to make it explicit, the style guide forbids implicit null checks.
>
> This is a bit tricky. It is indeed a pointer type (`uintptr_t`), but it is not used as a pointer. It is used to store the register mask bits. So I guess this is then not an implicit null check? It is an implicit zero check :slightly_smiling_face:
> Do not use ints or pointers as (implicit) booleans with &&, ||, if, while. Instead, compare explicitly, i.e. if (x != 0) or if (ptr != nullptr), etc.
Ok, well no matter what, it would not conform to the style. Maybe you already fixed it though, not sure.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2158596817
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2158606438
More information about the hotspot-compiler-dev
mailing list