aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/CapturedVars.scala
Commit message (Collapse)AuthorAgeFilesLines
* Avoid overhead of generating symbol sets on each accessMartin Odersky2015-11-091-1/+1
| | | | | | 1) Have symbol sets cached per run 2) Use methods Denotation#isPrimitiveValueClass, Denotation#isNumericValueClass instead of calling contains directly on symbol sets.
* Move refType/Class maps from Definitions to CapturedVarsMartin Odersky2015-11-091-8/+27
| | | | | | | Maps should not have TypeRefs as keys, yet symbols are not stable for recompilation. Solution: Construct these maps over symbols but move them to CapturedVars#Transform where they will be re-built on each run.
* First versions of Definitions based on TypeRefs not Symbols.Martin Odersky2015-11-091-5/+10
| | | | | | | | | | | | | | | Symbols are not stable between runs, so if some symbol referred to from Definitions gets recompiled, there are then two Symbols that are both visible, one referenced from Definitions, the other the one that got compiled. Thos led to a crash when e.g. compiling scala.Short, because the newly compiled symbol was not recognized as a primitive value class. The present commit tries to make systematic changes without regard to simplicity or aesthetics. This will be polished in future commits. // ### comments signal areas that need further attention.
* Fix CaputuredVars/LiftTry interaction.Martin Odersky2015-08-151-6/+26
| | | | | | CapturedVars introduced an assignment that could cause a try to be executed with a non-empty stack, even after LiftTry had already run. We now avoid this by introducing a temporary variable.
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Avoid capturing context in lazy treesMartin Odersky2015-03-181-1/+1
| | | | | | | | | | | | | | | | | | Lazy trees can live longer than runs, so it is important that they capture as little as possible. In particular they should not capture contexts. This change led with a ripple through effect to many changes where operations now have to parameterzied with contexts, in particular in what concerns tree folding. The changes in turn uncovered some areas where dotc was incompatible with scalac, and flagged correct things as errors. These will be fixed in the next commits. Another small twist: EmptyTrees will not be read in delayed mode, so that one can check for lacking definitions without deserializing the rhs.
* After boxing its value, a captured var should become a val.Martin Odersky2015-02-101-6/+2
| | | | As noted by @sjrd.
* Remove fruitless overrides of treeTransformPhaseMartin Odersky2014-12-141-1/+0
| | | | | Now the default phase of treeTransformPhase is phase.next, we can remove all overrides that specify the same phase.
* Make CapturedVars a functional transform.Martin Odersky2014-11-121-69/+72
| | | | No global side effect on capturedVars anymore.
* Make CaptguredVars use prepareForUnit instead of init.Martin Odersky2014-11-121-10/+15
| | | | | | | | Required some refactoring. Instead of transformSym we now transform ValDefs as we prepare for them. The previous scheme could not control directly whetrher transformSym or collectCaptured would run first. Turns out that init ran before collectCaptured but prepareForUnit did not, leading to test failures in pos/capturedvars.
* Combine captured vars and constructors into one macro phase.Martin Odersky2014-10-111-1/+1
| | | | Needed to fix a problem in CapturedVars to make this work.
* Replace tree.withName with {tpd|untpd}.rename.treeMartin Odersky2014-10-111-4/+4
| | | | Advantage: Can rename typed as well as untyped trees.
* Facturing out EnclosingMethodTraverser from CapturedVarsMartin Odersky2014-10-111-15/+10
| | | | | The idea to traverse with currently enclosing methid is also used in LambdaLift and could be used elsewhere.
* New phase: CapturedVarsMartin Odersky2014-09-121-0/+107
Breaks out boxing functionality of captured vars from lambda lift.