summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-7006 Prevent unreachable blocks in GenICodeJames Iry2013-03-064-39/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes GenICode prevent the generation of most unreachable blocks. The new unreachable block prevention code can be disabled with a compiler flag. Because full unreachable analysis is no longer necessary for normal code it makes the unreachable block analysis run only under -optimise. A test is included to make sure unreachable code doesn't cause issues in code gen. A concrete example will help. def foo(): X = { try return something() catch { case e: Throwable => println(e) throw e } unreachableCode() ] Here unreachableCode() is unreachable but GenICode would create ICode for it and then ASM would turn it into a pile of NOPS. A previous commit added a reachability analysis step to eliminate that unreachable code but that added a bit of time to the compilation process even when optimization was turned off. This commit avoids generating most unreachable ICode in the first place so that full reachability analysis is only needed after doing other optimization work. The new code works by extending a mechanism that was already in place. When GenICode encountered a THROW or RETURN it would put the current block into "ignore" mode so that no further instructions would be written into the block. However, that ignore mode flag was itself ignored when it came to figuring out if follow on blocks should be written. So this commit goes through places like try/catch and if/else and uses the ignore mode of the current block to decide whether to create follow on blocks, or if it already has, to kill by putting them into ignore mode and closing them where they'll be removed from the method's list of active blocks. It's not quite as good as full reachability analysis. In particular because a label def can be emitted before anything that jumps to it, this simple logic is forced to leave label defs alone and that means some of them may be unreachable without being removed. However, in practice it gets close the the benefit of reachability analysis at very nearly no cost.
* Add option to disable optimizationJames Iry2013-03-051-0/+2
| | | | | | | | | | | By default we run par test under -optimise. But occasionally we need to test optimizations in isolation. This commit adds a Ynooptimise flag that turns the optimize flags off back off after they've been turned on. A test is included to ensure that -Ynooptimise turns off optimizations and an existing test is modified to show that optimizations coming after -Ynooptimise in command line are enabled.
* Name boolean arguments in src/library.Jason Zaugg2013-03-0524-71/+71
|
* Name boolean arguments in src/reflect.Jason Zaugg2013-03-0511-31/+31
|
* Name boolean arguments in src/compiler.Jason Zaugg2013-03-0570-302/+302
| | | | | | | | | | What would you prefer? adaptToMemberWithArgs(tree, qual, name, mode, false, false) Or: adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
* Merge pull request #2197 from paulp/pr/integrate-range-positionsJames Iry2013-03-0520-419/+370
|\ | | | | Integrate range positions.
| * Eliminated separate RangePositions trait.Paul Phillips2013-03-049-311/+271
| | | | | | | | | | | | | | One of those eternal headaches which probably sounded better on paper. Even before range positions are the default, there's no reason we can't have the range position code available in all globals enabled via settings, just like everything else.
| * Disentangled RangePositions from interactive.Paul Phillips2013-03-0419-408/+399
| | | | | | | | | | | | | | This is a stepping stone to having range positions all the time, as well as to modularizing the presentation compiler. It does not enable range positions by default, only places them smoewhere where they can be.
* | Merge pull request #2183 from mt2309/tailrec-intmapPaul Phillips2013-03-051-0/+3
|\ \ | | | | | | Require firstKey and lastKey on IntMap tail-recursive.
| * | Require firstKey and lastKey on IntMap to be tail recursive.Michael Thorpe2013-03-021-0/+3
| | |
* | | Merge pull request #2195 from vigdorchik/lint_libraryPaul Phillips2013-03-0510-37/+11
|\ \ \ | | | | | | | | Changes around lint
| * | | Remove unused symbols and imports from the library.Eugene Vigdorchik2013-03-057-12/+1
| | | |
| * | | Since the problem in SI-6758 is fixed, it's ok to move checking for unused ↵Eugene Vigdorchik2013-03-053-25/+10
| | | | | | | | | | | | | | | | imports to Analyzer. This allows the check to be used in the IDE.
* | | | Merge pull request #2191 from mergeconflict/SI-7132Paul Phillips2013-03-051-5/+7
|\ \ \ \ | | | | | | | | | | SI-7132 - don't discard Unit type in interpreter
| * | | | SI-7132 - don't discard Unit type in interpreterDan Rosen2013-03-021-5/+7
| | | | |
* | | | | Merge pull request #2187 from JamesIry/master_SI-6816Paul Phillips2013-03-051-1/+2
|\ \ \ \ \ | | | | | | | | | | | | SI-6816 Deprecate -Yeta-expand-keeps-star
| * | | | | SI-6816 Deprecate -Yeta-expand-keeps-starJames Iry2013-03-011-1/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | This commit deprecates the -Yeta-expand-keeps-star flag. It was created in 2.10 to help in the transition from 2.9 but by the time 2.11 comes out it should no longer be necessary.
* | | | | Cleanup in isHKSubType0.Paul Phillips2013-03-041-38/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Making the mechanisms more apparent. Renamed to isHKSubType, because there is no other.
* | | | | Add some logging to sinful typevar methods.Paul Phillips2013-03-043-48/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These super-mutation-oriented methods should enthusiastically communicate what they are doing, especially when they encounter anything unexpected. None of this work should be taken as an endorsement of any of the worked-upon code.
* | | | | Added methods debuglogResult and devWarningResult.Paul Phillips2013-03-041-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Lowering the barriers to sensible logging - these methods are key in avoiding the "too much trouble" syndrome.
* | | | | Always at least log devWarnings.Paul Phillips2013-03-041-0/+2
| |_|_|/ |/| | |
* | | | Merge pull request #2192 from paulp/pr/rename-type-paramAdriaan Moors2013-03-031-5/+5
|\ \ \ \ | | | | | | | | | | Renamed type param to be consistent with convention.
| * | | | Renamed type param to be consistent with convention.Paul Phillips2013-03-031-5/+5
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | It's super confusing to see debugging output showing a type constructor called "Coll". The convention in the collections is that CC[A] takes type parameters and Coll is an alias for the applied type.
* | | | Merge pull request #2163 from paulp/pr/as-seen-fromAdriaan Moors2013-03-032-132/+201
|\ \ \ \ | |/ / / |/| | | Refactors AsSeenFromMap to expose extension point.
| * | | Establishes what's up with widening in asSeenFrom.Paul Phillips2013-03-031-6/+10
| | | | | | | | | | | | | | | | Added explanatory comment.
| * | | Simplified correspondingTypeArgument based on reviewer feedback.Paul Phillips2013-03-021-15/+10
| | | |
| * | | Refactors AsSeenFromMap to expose extension point.Paul Phillips2013-03-012-131/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The extension point was the initial motivation but I also tried to bring some clarity to the internals. This is a setup commit for scaladoc and interactive modularization, and also will be followed by a fix for abstract types losing their prefixes (SI-6161.)
* | | | Merge pull request #2180 from adriaanm/merge-2.10.1-masterAdriaan Moors2013-03-017-26/+74
|\ \ \ \ | |/ / / |/| | | Merge 2.10.1 into master
| * | | Merge branch 2.10.1 into masterAdriaan Moors2013-02-277-26/+74
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/Trees.scala src/library/scala/concurrent/impl/ExecutionContextImpl.scala
| | * \ \ Merge 2.10.1 into 2.10.x.Adriaan Moors2013-02-2719-327/+171
| | |\ \ \
| | | * | | SI-7180 Fix regression in implicit scope of HK type alias.Jason Zaugg2013-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We actually need to call normalize here, otherwise we don't progress through #1 below. [infer implicit] scala.this.Predef.implicitly[Higher[Foo.Bar]] with pt=Higher[Foo.Bar] in object Foo 1. tp=Foo.Bar tp.normalize=[A <: <?>]Foo.Bar[A] tp.dealias=Foo.Bar 2. tp=Foo.Bar[A] tp.normalize=Box[A] tp.dealias=Box[A]
| | | * | | Merge pull request #2152 from retronym/topic/annotatedRetyping-2.10.1Adriaan Moors2013-02-211-9/+5
| | | |\ \ \ | | | | | | | | | | | | | | SI-7163 backport of annotated retyping to 2.10.1
| | | | * | | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-211-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typedAnnotated transforms an Annotated tree into a Typed tree. The original field of the result is set to the Annotated tree. The bug was that typedAnnotated was using the untyped Annotated tree as original, but also set its type. When re-typing later on the same Annotated tree, the typer would consider it as alreadyTyped. This is incorrect, the typer needs to convert Annotated trees to Typed. Also, the Annotated tree only had its type field set, but its children were still untyped. This crashed the compiler lateron, non-typed trees would get out of the typing phase.
| | | * | | | Merge pull request #2138 from retronym/ticket/6576-null-strikes-backJames Iry2013-02-191-2/+6
| | | |\ \ \ \ | | | | | | | | | | | | | | | | SI-6576 Workaround / diagnostic for IDE NPE.
| | | | * | | | SI-6576 Workaround / diagnostic for IDE NPE.Jason Zaugg2013-02-191-2/+6
| | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems like this was too optimistic: > // later by lukas: disabled when fixing SI-5975 > // i think it cannot happen anymore - restored the null check - added logging when we set the namer in this attachment, in the hope of spotting a pattern in the wild. We don't have a test case yet; if we did we could most likely have a more principled fix. But this should suffice for 2.10.1.
| | | * | | | SI-7146 - Fixing checkinit bug in ExecutionContextImpl and adding testViktor Klang2013-02-191-4/+4
| | | | | | |
| | | * | | | SI-7128 Fix regression in copyToArray for empty arraysJason Zaugg2013-02-141-1/+1
| | | |/ / /
| | | * | | [nomaster] Revert "Added a Swing ColorChooser wrapper"Adriaan Moors2013-02-122-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 08ab007c5c97f153902c4ac58f87e30fbf7cf99f. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] Revert "Added a Swing PopupMenu wrapper"Adriaan Moors2013-02-122-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bdff881f8a15d4de0c0ff2aa2427f0d8244d2d42. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] Revert "SI-6548 reflection now correctly enters jinners"Adriaan Moors2013-02-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 54a84a36d5b435a787d93ca48d45399136c7e162. This is necessary to maintain binary compatibility with 2.10.0. run/t6989.check had to be updated as it also (indirectly) tested SI-6548 Conflicts: test/files/lib/javac-artifacts.jar.desired.sha1 test/files/run/t6548.check test/files/run/t6548/Test_2.scala
| | | * | | [nomaster] inline importPrivateWithinFromJavaFlags into SymbolTableAdriaan Moors2013-02-092-24/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks 02ed5fb so that we don't change JavaUniverse's super classes. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] Revert "cosmetic renamings in runtime reflection"Adriaan Moors2013-02-092-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0429f0fd9224499cd8b606490d04b1a8dcffbca8. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] refactor AdaptedForkJoinTask, uncaughtExceptionHandlerAdriaan Moors2013-02-091-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlined AdaptedForkJoinTask, made uncaughtExceptionHandler private[this]. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] can't add new class BatchingExecutorAdriaan Moors2013-02-092-120/+103
| | | | | | | | | | | | | | | | | | | | | | | | This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] bring back SerializeStart from fa3b8040ebAdriaan Moors2013-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] duplicate tailImpl as a private methodAdriaan Moors2013-02-092-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworks d526f8bd74. This is necessary to maintain binary compatibility with 2.10.0. matchName="scala.collection.mutable.MutableList.tailImpl" problemName=MissingMethodProblem
| | | * | | [nomaster] Revert "SI-4664 Make scala.util.Random Serializable"Adriaan Moors2013-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also revert "SI-4664 [Make scala.util.Random Serializable] Add test case" This reverts commit 0b92073a38f9d1823f051ac18173078bfcfafc8a. This reverts commit 2aa66bec86fd464712b0d15251cc400ff9d52821. This is necessary to maintain binary compatibility with 2.10.0.
| | | * | | [nomaster] Revert "Fixes SI-6521, overrides Range#head to be faster"Adriaan Moors2013-02-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a557a973608a75c7a02f251bbcf49fe6f6b6655e. This is necessary to maintain binary compatibility with 2.10.0. Mima says: matchName="scala.collection.immutable.Range.head" problemName=IncompatibleResultTypeProblem The bridge method appeared because result is now Int, whereas the super-method's result type erases to Object
| | * | | | Merge pull request #2134 from scalamacros/topic/resetattrs-thisPaul Phillips2013-02-271-9/+48
| | |\ \ \ \ | | | | | | | | | | | | | | resetAttrs now always erases This.tpe
| | | * | | | adds some comments to resetAttrsEugene Burmako2013-02-261-5/+41
| | | | | | |