Skip to content

Сoncrete values for enums #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2022
Merged

Сoncrete values for enums #19

merged 7 commits into from
May 29, 2022

Conversation

Damtev
Copy link
Member

@Damtev Damtev commented May 24, 2022

Closes #18, closes #32

To increase the performance of symbolic analysis for source code that uses enums, we can extract these enums concretely from runtime instead of enum's initializers analysis which can require a lot of time for enums with a lot of constants (because enum's static initializer fills fields for every enum constant, creates $VALUES array, invokes java.lang.Enum initializer for every constant, etc).

But very important thing is that we cannot process concretely every enum but only isolated - enums that do not affect the system state (like other classes' statics) in their initializers and do not use external statics to initialize its own statics. To prevent concrete processing of enum that is not isolated, we need to traverse its static initializer and check that it does not initialize external statics and does not use external statics to initialize its own statics.

@Damtev Damtev added ctg-enhancement New feature, improvement or change request Priority: Medium labels May 24, 2022
@Damtev Damtev requested a review from CaelmBleidd May 24, 2022 14:50
@Damtev Damtev force-pushed the damtev/concrete_enums branch from e677199 to 689f701 Compare May 24, 2022 15:28
Copy link
Member

@CaelmBleidd CaelmBleidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a design doc for concrete processing of enum's clinit sections

@Damtev Damtev force-pushed the damtev/concrete_enums branch from f5aa849 to bf8e294 Compare May 25, 2022 15:27
@Damtev Damtev force-pushed the damtev/concrete_enums branch 3 times, most recently from 9f89429 to 3bd2859 Compare May 26, 2022 20:33
@denis-fokin denis-fokin changed the title Support concrete values for enums Сoncrete values for enums May 27, 2022
@Damtev Damtev force-pushed the damtev/concrete_enums branch 3 times, most recently from 2828472 to 6e9d74b Compare May 28, 2022 08:53
@Damtev Damtev force-pushed the damtev/concrete_enums branch from 6e9d74b to ce6c64f Compare May 29, 2022 16:43
@Damtev Damtev merged commit e6bb7f7 into main May 29, 2022
@Damtev Damtev deleted the damtev/concrete_enums branch March 20, 2023 17:14
@Damtev Damtev restored the damtev/concrete_enums branch March 20, 2023 17:14
@Damtev Damtev deleted the damtev/concrete_enums branch March 20, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-enhancement New feature, improvement or change request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use fully qualified class names in codegen util methods Concrete values for enums
3 participants