Skip to content

Split Compiler.phases into smaller logical groups #3671

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 1 commit into from
Dec 21, 2017

Conversation

nicolasstucki
Copy link
Contributor

This change aims to simplify overriding of phases in classes that extend Compiler. It also splits the macro phases into groups that share a same logical purpose.

new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
frontendPhases ::: picklerPhases ::: transformPhases ::: backendPhases

/** Phases dealing with the the frontend up to trees ready for TASTY pickling */
Copy link
Member

Choose a reason for hiding this comment

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

typo: the the

List(new LinkAll) :: // Reload compilation units from TASTY for library code (if needed)
Nil

/** Phases dealing transforming from pickled trees to backend trees */
Copy link
Member

Choose a reason for hiding this comment

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

"dealing transforming" is not correct grammar

protected def transformPhases: List[List[Phase]] =
List(new FirstTransform, // Some transformations to put trees into a canonical form
new CheckReentrant, // Internal use only: Check that compiled program has no data races involving global vars
new ElimJavaPackages) :: // Eliminate syntactic references to Java packages
Copy link
Member

Choose a reason for hiding this comment

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

Why use :: instead of List(List(...), ...) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer List(List(...), ...) 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it would make a better distinction between micro and macro phases and it is a little bit more efficient.

@nicolasstucki nicolasstucki force-pushed the split-compiler-phases branch 2 times, most recently from 10aa8cb to 0fe84d4 Compare December 19, 2017 09:22
@nicolasstucki
Copy link
Contributor Author

Rebased after addition of ReifyQuotes phase

@nicolasstucki nicolasstucki merged commit b61a193 into scala:master Dec 21, 2017
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.

4 participants