Skip to content
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

Refactor class var initialization #8091

Merged
merged 4 commits into from
Aug 17, 2019
Merged

Conversation

waj
Copy link
Member

@waj waj commented Aug 16, 2019

This is a big refactor of the class var codegen and it actually revert changes from #8067 and obtain the same results with a different approach.

Now the class var initializer is decided to be "simple" after trying to generate the code to initialize it. This cover more cases like calls to functions with just a literal in the body, and avoids unnecessary initialization flags and reader methods whenever possible.

@waj waj merged commit c45abe2 into crystal-lang:master Aug 17, 2019
@waj waj deleted the refactor/class_var_init branch August 17, 2019 22:54
@bcardiff bcardiff added this to the 0.31.0 milestone Sep 16, 2019
dnamsons pushed a commit to dnamsons/crystal that referenced this pull request Jan 10, 2020
* Refactor class var initialization

* Simple class vars are not eager initialized anymore

* Simplify code of class var codegen: pass around the MetaTypeVar as much as possible instead of its members

* Cache initialization of simple class vars
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants