Skip to content

[K/N] Rework static StaticInitializersLowering#5766

Open
kunyavskiy wants to merge 1 commit intomasterfrom
pkunyavskiy/KT-85168
Open

[K/N] Rework static StaticInitializersLowering#5766
kunyavskiy wants to merge 1 commit intomasterfrom
pkunyavskiy/KT-85168

Conversation

@kunyavskiy
Copy link
Contributor

In before, bodies of static init functions were generated directly in codegen. After this change, the proper IrBody is generated for them, and handled in all cases.

As nice side effect, initializers of such fields stopped being global DCE roots on their own, and becoming reachable only if some function in this file is reachable.

Another tricky part is registering in GC. In before, while generating bodies in codegen it was done automatically, now it's done by checking IrSetField's origin.

^KT-74763 Fixed

@kotlin-safe-merge
Copy link

Code Owners

Rule Owners Approval
/​kotlin-​native/​ kotlin-native

@kunyavskiy
Copy link
Contributor Author

/dry-run

@KotlinBuild
Copy link

THIS IS A DRY RUN

Quality gate is triggered at https://buildserver.labs.intellij.net/build/909203820 — use this link to get full insight.

Quality gate was triggered with the following revisions:

kotlin
Branch: refs/merge/GITHUB-5766/safe-merge
Commit: f78f4af

@KotlinBuild
Copy link

Triggered a retry attempt #1 out of 1.

@KotlinBuild
Copy link

Quality gate failed. See https://buildserver.labs.intellij.net/build/909203820 to get full insight.

@KotlinBuild KotlinBuild force-pushed the pkunyavskiy/KT-85168 branch from 62b072b to f37f3a8 Compare March 24, 2026 10:39
@kunyavskiy
Copy link
Contributor Author

/dry-run

@KotlinBuild
Copy link

THIS IS A DRY RUN

Quality gate is triggered at https://buildserver.labs.intellij.net/build/909898762 — use this link to get full insight.

Quality gate was triggered with the following revisions:

kotlin
Branch: refs/merge/GITHUB-5766/safe-merge
Commit: f37f3a8

@KotlinBuild
Copy link

Triggered a retry attempt #1 out of 1.

@KotlinBuild
Copy link

Quality gate failed. See https://buildserver.labs.intellij.net/build/909898762 to get full insight.

In before, bodies of static init functions were generated directly in
codegen. After this change, the proper IrBody is generated for them,
and handled in all cases.

As nice side effect, initializers of such fields stopped being
global DCE roots on their own, and becoming reachable only if
some function in this file is reachable.

Another tricky part is registering in GC. In before, while generating
bodies in codegen it was done automatically, now it's done by checking
IrSetField's origin.

^KT-74763 Fixed
@KotlinBuild KotlinBuild force-pushed the pkunyavskiy/KT-85168 branch from f37f3a8 to c8b19ab Compare March 24, 2026 14:37
@kunyavskiy
Copy link
Contributor Author

/dry-run

@KotlinBuild
Copy link

THIS IS A DRY RUN

Quality gate is triggered at https://buildserver.labs.intellij.net/build/910205684 — use this link to get full insight.

Quality gate was triggered with the following revisions:

kotlin
Branch: refs/merge/GITHUB-5766/safe-merge
Commit: 33612d0

@KotlinBuild
Copy link

Triggered a retry attempt #1 out of 1.

@KotlinBuild
Copy link

Quality gate failed. See https://buildserver.labs.intellij.net/build/910205684 to get full insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants