Skip to content

Commit 13edfbf

Browse files
Uniformise optimiSation spelling
The flag is called -optimise, lets use that eveywhere :)
1 parent 8b814cf commit 13edfbf

15 files changed

+24
-24
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,16 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
242242
} // end of class BCodePhase.Worker1
243243

244244
/*
245-
* Pipeline that takes ClassNodes from queue-2. The unit of work depends on the optimization level:
245+
* Pipeline that takes ClassNodes from queue-2. The unit of work depends on the optimisation level:
246246
*
247-
* (a) no optimization involves:
247+
* (a) no optimisation involves:
248248
* - converting the plain ClassNode to byte array and placing it on queue-3
249249
*/
250250
class Worker2 {
251251
// lazy val localOpt = new LocalOpt(new Settings())
252252

253-
def localOptimizations(classNode: ClassNode): Unit = {
254-
// BackendStats.timed(BackendStats.methodOptTimer)(localOpt.methodOptimizations(classNode))
253+
def localOptimisations(classNode: ClassNode): Unit = {
254+
// BackendStats.timed(BackendStats.methodOptTimer)(localOpt.methodOptimisations(classNode))
255255
}
256256

257257
def run(): Unit = {
@@ -263,7 +263,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
263263
}
264264
else {
265265
try {
266-
localOptimizations(item.plain)
266+
localOptimisations(item.plain)
267267
addToQ3(item)
268268
} catch {
269269
case ex: Throwable =>
@@ -308,7 +308,7 @@ class GenBCodePipeline(val entryPoints: List[Symbol], val int: DottyBackendInter
308308
* (a) set-up steps (most notably supporting maps in `BCodeTypes`,
309309
* but also "the" writer where class files in byte-array form go)
310310
*
311-
* (b) building of ASM ClassNodes, their optimization and serialization.
311+
* (b) building of ASM ClassNodes, their optimisation and serialization.
312312
*
313313
* (c) tear down (closing the classfile-writer and clearing maps)
314314
*

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ class Compiler {
7676
new ElimByName, // Expand by-name parameter references
7777
new AugmentScala2Traits, // Expand traits defined in Scala 2.11 to simulate old-style rewritings
7878
new ResolveSuper, // Implement super accessors and add forwarders to trait methods
79-
new Simplify, // Perform local optimizations, simplified versions of what linker does.
79+
new Simplify, // Perform local optimisations, simplified versions of what linker does.
8080
new PrimitiveForwarders, // Add forwarders to trait methods that have a mismatch between generic and primitives
8181
new FunctionXXLForwarders, // Add forwarders for FunctionXXL apply method
8282
new ArrayConstructors), // Intercept creation of (non-generic) arrays and intrinsify.
8383
List(new Erasure), // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
8484
List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types
85-
new VCElideAllocations, // Peep-hole optimization to eliminate unnecessary value class allocations
85+
new VCElideAllocations, // Peep-hole optimisation to eliminate unnecessary value class allocations
8686
new Mixin, // Expand trait fields and trait initializers
8787
new LazyVals, // Expand lazy vals
8888
new Memoize, // Add private fields to getters and setters
@@ -93,7 +93,7 @@ class Compiler {
9393
// Note: constructors changes decls in transformTemplate, no InfoTransformers should be added after it
9494
new FunctionalInterfaces, // Rewrites closures to implement @specialized types of Functions.
9595
new GetClass, // Rewrites getClass calls on primitive types.
96-
new Simplify), // Perform local optimizations, simplified versions of what linker does.
96+
new Simplify), // Perform local optimisations, simplified versions of what linker does.
9797
List(new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
9898
// Note: in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here
9999
new ElimStaticThis, // Replace `this` references to static objects by global identifiers

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ object Config {
8282
final val fastPathForRefinedSubtype = true
8383

8484
/** If this flag is set, `TypeOps.normalizeToClassRefs` will insert forwarders
85-
* for type parameters of base classes. This is an optimization, which avoids
86-
* long alias chains. We should not rely on the optimization, though. So changing
85+
* for type parameters of base classes. This is an optimisation, which avoids
86+
* long alias chains. We should not rely on the optimisation, though. So changing
8787
* the flag to false can be used for checking that everything works OK without it.
8888
*/
8989
final val forwardTypeParams = true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait ConstraintHandling {
4343
protected var homogenizeArgs = false
4444

4545
/** We are currently comparing type lambdas. Used as a flag for
46-
* optimization: when `false`, no need to do an expensive `pruneLambdaParams`
46+
* optimisation: when `false`, no need to do an expensive `pruneLambdaParams`
4747
*/
4848
protected var comparedTypeLambdas: Set[TypeLambda] = Set.empty
4949

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ object Denotations {
10791079
// --------------- PreDenotations -------------------------------------------------
10801080

10811081
/** A PreDenotation represents a group of single denotations
1082-
* It is used as an optimization to avoid forming MultiDenotations too eagerly.
1082+
* It is used as an optimisation to avoid forming MultiDenotations too eagerly.
10831083
*/
10841084
trait PreDenotation {
10851085

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dotty.tools.dotc.core.Types.Type
1111
* from the method definitions and calls (implemented in branch implement-phantom-types-part-2).
1212
* - Definitions of `def`, `val`, `lazy val` and `var` returning a phantom type to return a ErasedPhantom. Where fields
1313
* with ErasedPhantom type are not memoized (see transform/Memoize.scala).
14-
* - Calls to Phantom.assume become calls to ErasedPhantom.UNIT. Intended to be optimized away by local optimizations.
14+
* - Calls to Phantom.assume become calls to ErasedPhantom.UNIT. Intended to be optimized away by local optimisations.
1515
*/
1616
object PhantomErasure {
1717

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,7 @@ object Types {
29532953
case tycon: TypeRef =>
29542954
tycon.info match {
29552955
case TypeBounds(lo, hi) =>
2956-
if (lo eq hi) superType // optimization, can profit from caching in this case
2956+
if (lo eq hi) superType // optimisation, can profit from caching in this case
29572957
else lo.applyIfParameterized(args)
29582958
case _ => NoType
29592959
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
171171

172172
// when we know we're targetting Option, do some inlining the optimizer won't do
173173
// for example, `o.flatMap(f)` becomes `if (o == None) None else f(o.get)`, similarly for orElse and guard
174-
// this is a special instance of the advanced inlining optimization that takes a method call on
174+
// this is a special instance of the advanced inlining optimisation that takes a method call on
175175
// an object of a type that only has two concrete subclasses, and inlines both bodies, guarded by an if to distinguish the two cases
176176
object optimizedCodegen extends CommonCodegen {
177177

@@ -976,7 +976,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {
976976
if (casesRebindingPropagated nonEmpty) {
977977
// before optimizing, check casesNoSubstOnly for presence of a default case,
978978
// since DCE will eliminate trivial cases like `case _ =>`, even if they're the last one
979-
// exhaustivity and reachability must be checked before optimization as well
979+
// exhaustivity and reachability must be checked before optimisation as well
980980
// TODO: improve notion of trivial/irrefutable -- a trivial type test before the body still makes for a default case
981981
// ("trivial" depends on whether we're emitting a straight match or an exception, or more generally, any supertype of scrutSym.tpe is a no-op)
982982
// irrefutability checking should use the approximation framework also used for CSE, unreachability and exhaustivity checking

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import TreeTransforms.{MiniPhaseTransform, TransformerInfo}
5858
*
5959
* In scalac, If the method had type parameters, the call must contain same
6060
* parameters as type arguments. This is no longer case in dotc.
61-
* In scalac, this is named tailCall but it does only provide optimization for
61+
* In scalac, this is named tailCall but it does only provide optimisation for
6262
* self recursive functions, that's why it's renamed to tailrec
6363
* </p>
6464
*/

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ trait SpaceLogic {
167167
ss.forall(isSubspace(_, b))
168168
case (Typ(tp1, _), Typ(tp2, _)) =>
169169
isSubType(tp1, tp2)
170-
case (Typ(tp1, _), Or(ss)) => // optimization: don't go to subtraction too early
170+
case (Typ(tp1, _), Or(ss)) => // optimisation: don't go to subtraction too early
171171
ss.exists(isSubspace(a, _)) || tryDecompose1(tp1)
172172
case (_, Or(_)) =>
173173
simplify(minus(a, b)) == Empty

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
12141214
/** Adds inline to final vals with idempotent rhs
12151215
*
12161216
* duplicating scalac behavior: for final vals that have rhs as constant, we do not create a field
1217-
* and instead return the value. This seemingly minor optimization has huge effect on initialization
1217+
* and instead return the value. This seemingly minor optimisation has huge effect on initialization
12181218
* order and the values that can be observed during superconstructor call
12191219
*
12201220
* see remark about idempotency in PostTyper#normalizeTree

compiler/src/dotty/tools/io/PlainFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class PlainFile(val givenPath: Path) extends AbstractFile {
5353

5454
/** Returns all abstract subfiles of this abstract directory. */
5555
def iterator: Iterator[AbstractFile] = {
56-
// Optimization: Assume that the file was not deleted and did not have permissions changed
56+
// Optimisation: Assume that the file was not deleted and did not have permissions changed
5757
// between the call to `list` and the iteration. This saves a call to `exists`.
5858
def existsFast(path: Path) = path match {
5959
case (_: Directory | _: io.File) => true

docs/blog/_posts/2016-12-05-implicit-function-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ boilerplate code and increasing applicability.
3333
**First Step**: My pull request is a first implementation. It solves the
3434
problem in principle, but introduces some run-time overhead. The
3535
next step will be to eliminate the run-time overhead through some
36-
simple optimizations.
36+
simple optimisations.
3737

3838
## Implicit Parameters
3939

docs/docs/internals/backend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ready for serialization to disk.
6262

6363
Currently the queue subsystem is all sequential, but as can be seen in
6464
http://magarciaepfl.github.io/scala/ the above design enables overlapping (a.1)
65-
building of `ClassNodes`, (a.2) intra-method optimizations, and (a.3)
65+
building of `ClassNodes`, (a.2) intra-method optimisations, and (a.3)
6666
serialization to disk.
6767

6868
This subsystem is described in detail in `GenBCode.scala`

docs/docs/internals/overall-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ phases. The current list of phases is specified in class [Compiler] as follows:
126126
new ArrayConstructors), // Intercept creation of (non-generic) arrays and intrinsify.
127127
List(new Erasure), // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
128128
List(new ElimErasedValueType, // Expand erased value types to their underlying implementation types
129-
new VCElideAllocations, // Peep-hole optimization to eliminate unnecessary value class allocations
129+
new VCElideAllocations, // Peep-hole optimisation to eliminate unnecessary value class allocations
130130
new Mixin, // Expand trait fields and trait initializers
131131
new LazyVals, // Expand lazy vals
132132
new Memoize, // Add private fields to getters and setters

0 commit comments

Comments
 (0)