diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/jvm/opt')
8 files changed, 14 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala index a4cd8fce1e..78fc7e1ecf 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/BoxUnbox.scala @@ -69,7 +69,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { * E1: M1 only works if there's a single boxing operation. * def e1(b: Boolean) = { * val i: Integer = box(10) // 10 is stored into a new local, box operation and i removed - * val j: Integer = box(20) // 20 is stored into a new local, box operation adn j removed + * val j: Integer = box(20) // 20 is stored into a new local, box operation and j removed * val r = if (b) i else j // loads and stores of the box are eliminated, r no longer exists * unbox(r) // cannot rewrite: we don't know which local to load * } @@ -138,7 +138,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { * - note that the MatchError creation is dead code: local2 is never null. However, our nullness * analysis cannot identify this: it does not track nullness through tuple stores and loads. * - if we re-write the non-escaping consumers of the outer tuple, but keep the tuple allocation - * and the escaping consumer, we get the follwoing: + * and the escaping consumer, we get the following: * * load 1, load 2 * val newLocal1 = new Tuple2; load newLocal1 // stack: Tuple2 @@ -188,7 +188,7 @@ class BoxUnbox[BT <: BTypes](val btypes: BT) { var maxStackGrowth = 0 - /** Mehtod M1 for eliminating box-unbox pairs (see doc comment in the beginning of this file) */ + /** Method M1 for eliminating box-unbox pairs (see doc comment in the beginning of this file) */ def replaceBoxOperationsSingleCreation(creation: BoxCreation, finalCons: Set[BoxConsumer], boxKind: BoxKind, keepBox: Boolean): Unit = { /** * If the box is eliminated, all copy operations (loads, stores, others) of the box need to diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala index 78acd72dba..f2ff73c44d 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala @@ -167,7 +167,7 @@ class ByteCodeRepository[BT <: BTypes](val classPath: ClassPath, val btypes: BT) * the users (e.g. the inliner) have to be aware of method selection. * * Note that the returned method may be abstract (ACC_ABSTRACT), native (ACC_NATIVE) or signature - * polymorphic (methods `invoke` and `invokeExact` in class `MehtodHandles`). + * polymorphic (methods `invoke` and `invokeExact` in class `MethodHandles`). * * @return The [[MethodNode]] of the requested method and the [[InternalName]] of its declaring * class, or an error message if the method could not be found. An error message is also @@ -204,8 +204,8 @@ class ByteCodeRepository[BT <: BTypes](val classPath: ClassPath, val btypes: BT) visited += i // abstract and static methods are excluded, see jvms-5.4.3.3 for (m <- findMethod(c) if !isPrivateMethod(m) && !isStaticMethod(m)) found += ((m, c)) - val recusionResult = findIn(c) - if (recusionResult.isDefined) return recusionResult + val recursionResult = findIn(c) + if (recursionResult.isDefined) return recursionResult } None } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala index 9c0dfb0ee2..a740ca525c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala @@ -285,7 +285,7 @@ class CallGraph[BT <: BTypes](val btypes: BT) { // final case class :: / final case object Nil // (l: List).map // can be inlined // we need to know that - // - the recevier is sealed + // - the receiver is sealed // - what are the children of the receiver // - all children are final // - none of the children overrides map diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala index b05669ce89..518646812e 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala @@ -273,7 +273,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) { } /** - * Eliminate the `numArgs` inputs of the instruction `prod` (which was eliminated). Fo + * Eliminate the `numArgs` inputs of the instruction `prod` (which was eliminated). For * each input value * - if the `prod` instruction is the single consumer, enqueue the producers of the input * - otherwise, insert a POP instruction to POP the input value @@ -465,7 +465,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) { } /** - * Remove `xSTORE n; xLOAD n` paris if + * Remove `xSTORE n; xLOAD n` pairs if * - the local variable n is not used anywhere else in the method (1), and * - there are no executable instructions and no live labels (jump targets) between the two (2) * diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala index 16ed9da0e4..7bc4ea2392 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlineInfoAttribute.scala @@ -82,7 +82,7 @@ case class InlineInfoAttribute(inlineInfo: InlineInfo) extends Attribute(InlineI } /** - * De-serialize the attribute into an InlineInfo. The attribute starts at cr.b(off), but we don't + * Deserialize the attribute into an InlineInfo. The attribute starts at cr.b(off), but we don't * need to access that array directly, we can use the `read` methods provided by the ClassReader. * * `buf` is a pre-allocated character array that is guaranteed to be long enough to hold any diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala index b9f593a4d8..0ae8347dc5 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala @@ -683,7 +683,7 @@ class Inliner[BT <: BTypes](val btypes: BT) { * (A2) C and D are members of the same run-time package */ def classIsAccessible(accessed: BType, from: ClassBType): Either[OptimizerWarning, Boolean] = (accessed: @unchecked) match { - // TODO: A2 requires "same run-time package", which seems to be package + classloader (JMVS 5.3.). is the below ok? + // TODO: A2 requires "same run-time package", which seems to be package + classloader (JVMS 5.3.). is the below ok? case c: ClassBType => c.isPublic.map(_ || c.packageInternalName == from.packageInternalName) case a: ArrayBType => classIsAccessible(a.elementType, from) case _: PrimitiveBType => Right(true) @@ -725,7 +725,7 @@ class Inliner[BT <: BTypes](val btypes: BT) { * type from there (https://github.com/scala-opt/scala/issues/13). */ def memberIsAccessible(memberFlags: Int, memberDeclClass: ClassBType, memberRefClass: ClassBType, from: ClassBType): Either[OptimizerWarning, Boolean] = { - // TODO: B3 requires "same run-time package", which seems to be package + classloader (JMVS 5.3.). is the below ok? + // TODO: B3 requires "same run-time package", which seems to be package + classloader (JVMS 5.3.). is the below ok? def samePackageAsDestination = memberDeclClass.packageInternalName == from.packageInternalName def targetObjectConformsToDestinationClass = false // needs type propagation analysis, see above diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala index 4744cb9ab1..63360e17ff 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/InlinerHeuristics.scala @@ -125,7 +125,7 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) { if (callsite.isInlineAnnotated && callee.canInlineFromSource) { // By default, we only emit inliner warnings for methods annotated @inline. However, we don't // want to be unnecessarily noisy with `-opt-warnings:_`: for example, the inliner heuristic - // would attempty to inline `Function1.apply$sp$II`, as it's higher-order (the receiver is + // would attempt to inline `Function1.apply$sp$II`, as it's higher-order (the receiver is // a function), and it's concrete (forwards to `apply`). But because it's non-final, it cannot // be inlined. So we only create warnings here for methods annotated @inline. Some(Left(CalleeNotFinal( diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala index 65d1e20d69..9c22b09cdd 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala @@ -61,7 +61,7 @@ import scala.tools.nsc.backend.jvm.opt.BytecodeUtils._ * - empty local variable descriptors (local variables that were holding the box may become unused) * * copy propagation (replaces LOAD n to the LOAD m for the smallest m that is an alias of n) - * + enables downstrem: + * + enables downstream: * - stale stores (a stored value may not be loaded anymore) * - store-load pairs (a load n may now be right after a store n) * + NOTE: copy propagation is only executed once, in the first fixpoint loop iteration. none of |