Skip to content

Commit 2520992

Browse files
authored
Merge pull request #2647 from dotty-staging/localopt-continued
Local optimisations round two
2 parents 91cf397 + 4be324e commit 2520992

27 files changed

+1830
-1493
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
173173

174174
val primitives: Primitives = new Primitives {
175175
val primitives = new DottyPrimitives(ctx)
176-
def getPrimitive(app: Apply, reciever: Type): Int = primitives.getPrimitive(app, reciever)
176+
def getPrimitive(app: Apply, receiver: Type): Int = primitives.getPrimitive(app, receiver)
177177

178178
def getPrimitive(sym: Symbol): Int = primitives.getPrimitive(sym)
179179

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import core.DenotTransformers.DenotTransformer
1717
import core.Denotations.SingleDenotation
1818

1919
import dotty.tools.backend.jvm.{LabelDefs, GenBCode, CollectSuperCalls}
20-
import dotty.tools.dotc.transform.linker.Simplify
20+
import dotty.tools.dotc.transform.localopt.Simplify
2121

2222
/** The central class of the dotc compiler. The job of a compiler is to create
2323
* runs, which process given `phases` in a given `rootContext`.

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ class ScalaSettings extends Settings.SettingGroup {
107107
val YnoInline = BooleanSetting("-Yno-inline", "Suppress inlining.")
108108

109109
/** Linker specific flags */
110-
val optimise = BooleanSetting("-optimise", "Generates faster bytecode by applying optimisations to the program") withAbbreviation "-optimize"
110+
val YoptPhases = PhasesSetting("-Yopt-phases", "Restrict the optimisation phases to execute under -optimise.")
111+
val YoptFuel = IntSetting("-Yopt-fuel", "Maximum number of optimisations performed under -optimise.", -1)
112+
val optimise = BooleanSetting("-optimise", "Generates faster bytecode by applying local optimisations to the .program") withAbbreviation "-optimize"
111113

112114
/** Dottydoc specific settings */
113115
val siteRoot = StringSetting(

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ class Definitions {
368368

369369
lazy val SeqType: TypeRef = ctx.requiredClassRef("scala.collection.Seq")
370370
def SeqClass(implicit ctx: Context) = SeqType.symbol.asClass
371-
372371
lazy val Seq_applyR = SeqClass.requiredMethodRef(nme.apply)
373372
def Seq_apply(implicit ctx: Context) = Seq_applyR.symbol
374373
lazy val Seq_headR = SeqClass.requiredMethodRef(nme.head)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dotty.tools.dotc
22
package transform
3+
34
import core.Contexts.Context
45

56
/** Utility class for lazy values whose evaluation depends on a context.
@@ -20,4 +21,4 @@ class CtxLazy[T](expr: Context => T) {
2021
}
2122
myValue
2223
}
23-
}
24+
}

compiler/src/dotty/tools/dotc/transform/linker/Analysis.scala

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)