Skip to content

Give phases periods, not only id's #100

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 6 commits into from
Mar 27, 2014

Conversation

DarkDimius
Copy link
Contributor

Depends on #97
fixes #95

odersky added 4 commits March 27, 2014 12:37
Aims

1) next/prev should be context-independent. Phase now stores
its ContextBase in a field.

2) More robust handling of phaseNamed and the phase properties
erasedTypes, flattened, refchecked, etc. These were previously
dependent on when the first call to any of these methods was made, which
led to a data race.

There is now an init method in phases which centralizes all necessary intialization.
It is checked that a phase is initialized only once.
Aim: Avoid expensive scanning of definitions in denotations other than the initial one.

Technique:

1. If phase is erased, type params is Nil (except for Array class)
2. Otherwise, type params is the same as it was in initial phase.
Previous version was wrong because every context is a fresh context at runtime,
so the overriding version would always be executed, which means that withPhase
becomes a side-effecting operation!
The logic for dealing with periods in denotation histories did not
correctly take into account the case where the current validity period of
a denotation ends some phases before the next type transformer starts.

And there was an off-by-one error in startPid.

And Types#computeDenot erroneously tried to reload denotations even
the run did not change.
@DarkDimius DarkDimius mentioned this pull request Mar 27, 2014
@odersky
Copy link
Contributor

odersky commented Mar 27, 2014

Once ad81775 is dropped, LGTM.

DarkDimius added a commit that referenced this pull request Mar 27, 2014
Give phases periods, not only id's
@DarkDimius DarkDimius merged commit 6db08e9 into scala:master Mar 27, 2014
@DarkDimius DarkDimius mentioned this pull request Mar 27, 2014
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.

TreeTransformer.next should be next mega-phase
2 participants