summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/settings
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2015-12-11 10:47:00 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2015-12-15 15:12:42 +0100
commit1265e19de8073da2691fac4d52bc763091ad7b9c (patch)
tree74f7183a2e41ed2f1daf28751b75025d0fe1574b /src/compiler/scala/tools/nsc/settings
parent60ac9ecdbd9584007d70003bf8e00c4702bbd401 (diff)
downloadscala-1265e19de8073da2691fac4d52bc763091ad7b9c.tar.gz
scala-1265e19de8073da2691fac4d52bc763091ad7b9c.tar.bz2
scala-1265e19de8073da2691fac4d52bc763091ad7b9c.zip
Eliminate non-escaping boxes, tuples and refs
Eliminate boxes, tuples and refs that are created and used within a single method without escaping. For details on the implementation see the doc comment in class BoxUnbox. This commit also cleans up the logic of inter-dependent method-level optimizations that run until reaching a fixpoint.
Diffstat (limited to 'src/compiler/scala/tools/nsc/settings')
-rw-r--r--src/compiler/scala/tools/nsc/settings/ScalaSettings.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
index 794c0ba324..42ed9ef935 100644
--- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@@ -229,6 +229,7 @@ trait ScalaSettings extends AbsScalaSettings
val simplifyJumps = Choice("simplify-jumps", "Simplify branching instructions, eliminate unnecessary ones.")
val compactLocals = Choice("compact-locals", "Eliminate empty slots in the sequence of local variables.")
val copyPropagation = Choice("copy-propagation", "Eliminate redundant local variables and unused values (including closures). Enables unreachable-code.")
+ val boxUnbox = Choice("box-unbox", "Eliminate box-unbox pairs within the same method (also tuples, xRefs, value class instances). Enables unreachable-code.")
val nullnessTracking = Choice("nullness-tracking", "Track nullness / non-nullness of local variables and apply optimizations.")
val closureInvocations = Choice("closure-invocations" , "Rewrite closure invocations to the implementation method.")
val inlineProject = Choice("inline-project", "Inline only methods defined in the files being compiled. Enables unreachable-code.")
@@ -239,7 +240,7 @@ trait ScalaSettings extends AbsScalaSettings
private val defaultChoices = List(unreachableCode)
val lDefault = Choice("l:default", "Enable default optimizations: "+ defaultChoices.mkString(","), expandsTo = defaultChoices)
- private val methodChoices = List(unreachableCode, simplifyJumps, compactLocals, copyPropagation, nullnessTracking, closureInvocations)
+ private val methodChoices = List(unreachableCode, simplifyJumps, compactLocals, copyPropagation, boxUnbox, nullnessTracking, closureInvocations)
val lMethod = Choice("l:method", "Enable intra-method optimizations: "+ methodChoices.mkString(","), expandsTo = methodChoices)
private val projectChoices = List(lMethod, inlineProject)
@@ -260,6 +261,7 @@ trait ScalaSettings extends AbsScalaSettings
def YoptSimplifyJumps = Yopt.contains(YoptChoices.simplifyJumps)
def YoptCompactLocals = Yopt.contains(YoptChoices.compactLocals)
def YoptCopyPropagation = Yopt.contains(YoptChoices.copyPropagation)
+ def YoptBoxUnbox = Yopt.contains(YoptChoices.boxUnbox)
def YoptNullnessTracking = Yopt.contains(YoptChoices.nullnessTracking)
def YoptClosureInvocations = Yopt.contains(YoptChoices.closureInvocations)