RFR: 8336103: Sharper checks for <init> and <clinit> initializers [v2]
Aleksey Shipilev
shade at openjdk.org
Mon Jul 15 09:17:55 UTC 2024
On Mon, 15 Jul 2024 05:26:30 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> No, it is not filtered, we still have `clinit`-s on this path. In the initial version https://github.com/openjdk/jdk/pull/20120/commits/1a0d18f1333866ab2eceb02b30c0fe363473d4e6#diff-a8ed79cab8961103a78187704b7a14fd00b322da06e75518bcfd888d9b940040R3020 I caught the assert in many tests, mostly in stack traces generation.
>>
>> Yes, this changes the behavior: `clinit` would now be recorded as "method", instead of "constructor". Tracing back the uses of `get_flags`: it is used for initializing `java.lang.ClassFrameInfo.flags`. There seem to be no readers for this field in VM. Java side for `j.l.CFI` does not seem to check any method/constructor flags. So I would say this change in behavior is not really visible, and there is no need to try and keep the old (odd) behavior.
>
> Okay, such a change in behaviour was unexpected for a "cleanup" PR. I'm looking into it now. Perhaps @mlchung can comment?
Yeah, this is not really a cleanup (behaviors stay the same) change. For this particular hunk, keeping the old behavior seems to be unnecessary work. Note that we are also changing the behavior in C2: both in `do_exits` we no longer emit the barriers for `static final` stores in `clinits`, plus EA does not care about `clinits` anymore as well. Those are also behavioral changes.
If you prefer, I can turn this PR into a behaviorally similar cleanup, and do the behavior changes separately.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20120#discussion_r1677530301
More information about the graal-dev
mailing list