Skip to content

Commit a59c06d

Browse files
committed
Fall back to previous implementation scheme for MegaPhase
The new implementation is essentially a slightly cleaned-up version of the old one from TreeTransformers, which seemed to performed better. The main difference (besides renaming things) is that prepare operations still return contexts instead of TreeTransforms.
1 parent 26aba2b commit a59c06d

File tree

3 files changed

+679
-361
lines changed

3 files changed

+679
-361
lines changed

compiler/src/dotty/tools/dotc/Compiler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ class Compiler {
9797
List(new LinkScala2Impls, // Redirect calls to trait methods defined by Scala 2.x, so that they now go to their implementations
9898
new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
9999
// Note: in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here
100-
new ElimStaticThis), // Replace `this` references to static objects by global identifiers
100+
new ElimStaticThis), // Replace `this` references to static objects by global identifiers
101101
List(new Flatten, // Lift all inner classes to package scope
102-
new RestoreScopes, // Repair scopes rendered invalid by moving definitions in prior phases of the group
102+
new RestoreScopes, // Repair scopes rendered invalid by moving definitions in prior phases of the group
103103
new RenameLifted, // Renames lifted classes to local numbering scheme
104104
new TransformWildcards, // Replace wildcards with default values
105105
new MoveStatics, // Move static methods to companion classes

compiler/src/dotty/tools/dotc/transform/LambdaLift.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisPhase =>
491491
val phaseName: String = "lambdaLift"
492492

493493
override def relaxedTypingInGroup = true
494+
// Because it adds free vars as additional proxy parameters
494495

495496
override def runsAfterGroupsOf: Set[Class[_ <: Phase]] = Set(classOf[Constructors], classOf[HoistSuperArgs])
496497
// Constructors has to happen before LambdaLift because the lambda lift logic

0 commit comments

Comments
 (0)