summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* SI-7102 Specialize isEmpty for bitsetsEugene Vigdorchik2013-03-211-0/+13
| | | | | | | | | | | | Currently bitsets use default isEmpty implementation inherited from Set, which tests for "size == 0". Calculating the size of a word in a bitmap requires summing through all bits set, whereas testing for emptyness needs only one comparison with zero. This commit overrides the default implementation with the specialized one looking for a non-zero word in this bitmap.
* Merge pull request #2235 from vigdorchik/si_5513James Iry2013-03-202-0/+27
|\ | | | | SI-5513: add inplace set-theoretic operations for mutable bitsets.
| * SI-5513: add inplace set-theoretic operations for mutable bitsets.Eugene Vigdorchik2013-03-112-0/+27
| |
* | Merge pull request #2244 from paulp/pr/notNullAdriaan Moors2013-03-172-4/+4
|\ \ | | | | | | SI-7247, deprecate NotNull.
| * | SI-7247, deprecated NotNull.Paul Phillips2013-03-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Removed NotNull from tests and the parentage of AnyVal. Removed the tests which were actually testing anything to do with NotNull; massaged the others to forget NotNull and/or not to name local things NotNull.
* | | Merge pull request #2214 from JamesIry/master_constant_optimizationJames Iry2013-03-157-3/+142
|\ \ \ | |/ / |/| | Analyze constants to remove unnecessary branches
| * | Cleanup of constant optimizationJames Iry2013-03-146-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit cleans up constant optimization from the review of https://github.com/scala/scala/pull/2214 . * drops are done using the instruction's consumed count rather than a numeric literal * drops are moved into one common method in the main instruction interpreter * One instance of x.length > y.length is replaced with x.lengthCompare(y.length) > 0 * NaN is dealt with by treating it as an UNKNOWN * A test is added to make sure NaN semantics aren't broken. * The constant-optmization test is improved with tests for switch statements
| * | Analyze constants to remove unnecessary branchesJames Iry2013-03-073-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds analysis and optimization of constants to remove unnecessary branches. It uses abstract interpretation to determine what constant(s) a particular stack slot or variable might or might not hold at a given spot and uses that knowledge to eliminate branches that cannot be taken. Its primary goal is null check removal, but it also works for other constants. Several tests are modified to include the new optimization phase. Two new tests are added. One verifies that branching still works as expected. The other verifies that branches are removed.
* | | Merge pull request #2242 from adriaanm/merge-2.10.xPaul Phillips2013-03-136-0/+50
|\ \ \ | | | | | | | | Merge 2.10.x into master
| * \ \ Merge 2.10.x into masterAdriaan Moors2013-03-126-0/+50
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/reify/Errors.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| | * \ \ Merge pull request #2221 from scalamacros/ticket/5710Adriaan Moors2013-03-114-0/+32
| | |\ \ \ | | | | | | | | | | | | SI-5710 has fixed itself
| | | * | | SI-5710 has fixed itselfEugene Burmako2013-03-094-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | My job here is only to submit tests.
| | * | | | Merge pull request #2223 from scalamacros/ticket/7235Adriaan Moors2013-03-112-0/+18
| | |\ \ \ \ | | | | | | | | | | | | | | reifier is now aware of SI-7235
| | | * | | | reifier is now aware of SI-7235Eugene Burmako2013-03-092-0/+18
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7235 is caused by a long-standing todo in typedRefinement, which leads to originals of compound type trees swallowing their stats. I'm not sure how exactly to fix SI-7235, but what I am sure about is that we shouldn't silently discard stats during reification. This patch introduces a new implementation restrictions, which now reports that reify of compound type trees with non-empty stats isn't going to work.
| | * | | | Merge pull request #2199 from retronym/ticket/7214Adriaan Moors2013-03-051-0/+57
| | |\ \ \ \ | | | | | | | | | | | | | | SI-7214 outer check based on dealiased pattern type.
* | | | | | | SI-6601 Close access loophole for value class constructorsJason Zaugg2013-03-112-0/+17
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExtensionMethods marks private constructors of value classes as notPRIVATE before pickling. When the pickler reads the flags of this symbol, the anti-shift mechanism folds this into the regular PRIVATE flag, so the class is pickled as though it was public all along. A seprately compiled client can then call this constructor. To remedy this, we must: - pickle `rawFlags`, rather than `flags`. This is symmetric with unpickling, which sets `rawFlags` with the value it reads. - Add `notPRIVATE` to the flagset `PickledFlags`. We cannot make this change in a minor version, as the pickler and unpickler must agree on `PickledFlags`. I believe that this won't change the size of pickled flags for the majority of symbols (ie, those without the notPRIVATE flag) due to the variable length encoding in `writeLongNat`. This also improves the situation for SI-6608. Reflection and scalap (and, by extension, IntelliJ), no longer will see as public methods that have had their access widened in SuperAccessors (which is done selectively to support inlining under separate compilation.)
* | | | | / Moved scaladoc sources into separate directory.Paul Phillips2013-03-092-206/+0
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is not externally visible. It moves the scaladoc sources into src/scaladoc and adds an ant target for building them. The compilation products are still packaged into scala-compiler.jar as before, but with a small change to build.xml a separate jar can be created instead.
* | | | | SI-7006 Fix the unreachable testJames Iry2013-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The unreachable test was missing the cases when Random.nextInt returned a negative number. This commit fixes that.
* | | | | Merge pull request #2216 from JamesIry/master_7231James Iry2013-03-082-0/+13
|\ \ \ \ \ | | | | | | | | | | | | SI-7231 Fix assertion when adapting Null type to Array type
| * | | | | SI-7231 Fix assertion when adapting Null type to Array typeJames Iry2013-03-082-0/+13
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenICode was doing a sanity check when adapting an expression of type Null to something else. It was just doing the wrong one. Instead of checking whether the result expression type was a reference type it was checking to see if it was an class reference type. This commit fixes that and adds a test to make sure both forms of adaptation work as expected.
* | | | | Merge pull request #2185 from JamesIry/master_unreachableGrzegorz Kossakowski2013-03-082-75/+202
|\ \ \ \ \ | |/ / / / |/| | | | SI-7006 Prevent unreachable blocks in GenICode
| * | | | SI-7006 Prevent unreachable blocks in GenICodeJames Iry2013-03-062-75/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge 2.10.x into master.Adriaan Moors2013-03-051-0/+6
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | Conflicts: src/library/scala/collection/mutable/ArrayOps.scala
| * | | | Merge pull request #2198 from retronym/ticket/7215Paul Phillips2013-03-051-0/+6
| |\ \ \ \ | | | | | | | | | | | | SI-7215 Fix transpose of an empty Array[Array[T]].
| | * | | | SI-7215 Fix transpose of an empty Array[Array[T]].Jason Zaugg2013-03-051-0/+6
| | | | | |
| * | | | | Merge pull request #2175 from retronym/ticket/7185Paul Phillips2013-03-052-0/+46
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
| | | | | |
| \ \ \ \ \
| \ \ \ \ \
| \ \ \ \ \
| \ \ \ \ \
| \ \ \ \ \
*-----. \ \ \ \ \ Merge 2.10.x into master.Adriaan Moors2013-03-053-0/+103
|\ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / | |/| | | / / / / | | | |_|/ / / / | | |/| | | / / | |_|_|_|_|/ / |/| | | | | / | | | | | |/ | | | | |/| Fix check file for run/t7185.
| | | | * | SI-7214 outer check based on dealiased pattern type.Jason Zaugg2013-03-051-0/+57
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a path dependent type, the scrutinee's $outer reference is also compared against the prefix of `T`. The code that synthesises this is split into two places. `needsOuterCheck` determines whether to add this check, based on the type `T`, and the type of the scrutinee. If it gives the go-ahead, `treeCondStrategy.outerCheck` synthesizes the check. The new test case demonstrates the problems caused by the failure to dealias in `needsOuterCheck`: it could either wrongly lead to synthesis of an outer test (which would crash), or wrongly omit the outer test (meaning overly liberal matching.) A simple `dealias` remedies this. `dealiasWiden` is *not* appropriate here; we need to keep hold of singleton types. I'll also note that there is already a little slack between these methods, as commented: > ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` > by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix` > if there's an outer accessor, otherwise the condition becomes `true` > TODO: can we improve needsOuterTest so there's always an outerAccessor? So this is probably a fragile area that warrants a careful review with a view to design improvements.
| | * | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInlineJason Zaugg2013-03-022-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got there typechecking code with a redundant layer of Block. We can't express that in source code, so we test this with manual tree construction and with XML literals, which as reported produce such trees.
| * | | | Merge pull request #2184 from adriaanm/revert-pr-2083Adriaan Moors2013-03-018-2071/+0
| |\ \ \ \ | | | | | | | | | | | | Revert SI-6240 synchronization for runtime reflection
| | * | | | Revert SI-6240 synchronization for runtime reflectionAdriaan Moors2013-03-018-2071/+0
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reverts #2083: - 387b2590db runtime reflection: death from thousand threads - 73d079fb38 removes the assertion in missingHook - f4dd56ca5d synchronizes names - dd148de5a8 synchronizes pendingVolatiles - 4cbb9357c5 synchronizes toolboxes - 07bcb6176a SI-7045 reflection now auto-initializes selfType - bebd62d566 optimizes Scala reflection GIL - 735634f1d6 initializes lazy vals and inner objects in advance - 5b37cfb19a introduces GIL to Scala reflection - 981da8edfc cleans up initialization of runtime reflection - b2c2493b22 reflection no longer uses atPhase and friends - a9dca512d8 synchronizes symbols - 0262941b3c removes the crazy extraneous log - 21d5d3820b moves Symbol#SymbolKind to Symbols
| * | | | Merge pull request #2179 from adriaanm/merge-2.10.1Adriaan Moors2013-03-015-40/+78
| |\ \ \ \ | | |/ / / | |/| | | Merge 2.10.1 into 2.10.x
| * | | | Merge pull request #2083 from scalamacros/ticket/6240Adriaan Moors2013-02-278-0/+2071
| |\ \ \ \ | | | | | | | | | | | | SI-6240 synchronization for runtime reflection
| | * | | | runtime reflection: death from thousand threadsEugene Burmako2013-02-114-0/+2051
| | | | | | | | | | | | | | | | | | | | | | | | not anymore
| | * | | | SI-7045 reflection now auto-initializes selfTypeEugene Burmako2013-02-112-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selfType joins the happy family of flags, annotations and privateWithin, which automatically trigger initialization, when used within runtime reflection.
| | * | | | removes the crazy extraneous logEugene Burmako2013-02-112-0/+6
| | | | | |
* | | | | | Merge pull request #2197 from paulp/pr/integrate-range-positionsJames Iry2013-03-051-1/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Integrate range positions.
| * | | | | | Disentangled RangePositions from interactive.Paul Phillips2013-03-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | SI-7132 - don't discard Unit type in interpreterDan Rosen2013-03-022-10/+15
|/ / / / / /
* | | | | | Merge pull request #2180 from adriaanm/merge-2.10.1-masterAdriaan Moors2013-03-015-0/+39
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge 2.10.1 into master
| * \ \ \ \ \ Merge branch 2.10.1 into masterAdriaan Moors2013-02-275-0/+39
| |\ \ \ \ \ \ | | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | 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-275-40/+78
| | |\ \ \ \ \ | | | |/ / / / | | |/| | | / | | | | |_|/ | | | |/| |
| | | * | | fixes the test for SI-7112Eugene Burmako2013-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Freshly released Java 1.6.0_41 for OSX fails with "IllegalAccessError: tried to access class JavaSimpleEnumeration_1 from class sun.proxy.$Proxy6", and rightfully so, because that class isn't public. I think I will avoid the usual "how could this even work before" in this commit message.
| | | * | | Merge pull request #2152 from retronym/topic/annotatedRetyping-2.10.1Adriaan Moors2013-02-212-0/+68
| | | |\ \ \ | | | | | | | | | | | | | | SI-7163 backport of annotated retyping to 2.10.1
| | | | * | | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-212-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | | * | | | SI-7128 Fix regression in copyToArray for empty arraysJason Zaugg2013-02-141-0/+3
| | | |/ / /
| | | * / / [nomaster] Revert "SI-6548 reflection now correctly enters jinners"Adriaan Moors2013-02-104-40/+75
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | Merge pull request #2134 from scalamacros/topic/resetattrs-thisPaul Phillips2013-02-272-0/+12
| | |\ \ \ | | | | | | | | | | | | resetAttrs now always erases This.tpe
| | | * | | resetAttrs now always erases This.tpeEugene Burmako2013-02-172-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol of This, if it points to a package class, isn't touched, just as usual, so that our Select(Select(Select(...))) => This(...) optimization works fine with attr reset. However the tpe is now erased, so that subsequent reflective compilation doesn't spuriously fail when seeing that some subtrees of a tree being compiled are typed. Erasing the tpe doesn't pose even a tiniest problem, because, as it can be seen in typedThis, type is trivially reconstructed from the symbol.
| | * | | | Merge pull request #2149 from khernyo/issue/7074Grzegorz Kossakowski2013-02-252-0/+24
| | |\ \ \ \ | | | | | | | | | | | | | | SI-7074 Fix xml attribute sorting