summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | * | | | SI-7074 Fix xml attribute sortingSzabolcs Berecz2013-02-242-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorting the attributes of an xml element could drop some of the attributes. It was caused by the incorrect use of MetaData#copy() to concatenate "smaller" with the rest of the attributes. The MetaData#copy() method is similar to the following hypothetical method on a List: def copy(other: List): List = head :: other The fix prepends all elements of "smaller" to the rest of the attributes in the proper order.
| | * | | | | Merge pull request #2159 from scalamacros/topic/7112-followup-210xJames Iry2013-02-241-1/+1
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | | fixes the test for SI-7112
| | | * | | | 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 #2177 from JamesIry/master_SI-7159Grzegorz Kossakowski2013-02-282-0/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-7159 Distinguish between assignability and subtyping in TypeKinds
| * | | | | SI-7159 Prepare to remove erroneous INT <:< LONG in TypeKindsJames Iry2013-02-262-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparation for dealing with a problem in TypeKinds, this commit does some cleanup of code related to doing coercions. * Comments are added to clarify. * A println when converting between BOOL and anything else is removed and the code is allowed to flow through to an assertion. * Assertions are refactored to use string interpolation. * A few pattern matches were reformulated to equivalent variants In addition, a test is created for SI-107, the bug that necessitated the special case in GenICode#adapt for LONG coercion
* | | | | | Merge pull request #2169 from JamesIry/master_SI-7181Grzegorz Kossakowski2013-02-263-75/+176
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-7181 Eliminate unnecessary duplicates of finally blocks
| * | | | | SI-7181 Eliminate unnecessary duplication of finally blocksJames Iry2013-02-261-75/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main body of a try and each exception handler were getting a copy of the finally block for the "normal" flow case (i.e. where they don't throw an uncaught exception or use "return" to exit early). But that's not necessary. With this commit the try body and each exception handler can all jump to the same copy of the finally block on a normal exit. A byte code test is included to ensure we're getting fewer copies of the finally block. inline-ex-handlers.check is updated because the icode is a bit different without the extra finally block copies.
| * | | | | SI-7181 Prepare to remove duplicated finally blocksJames Iry2013-02-252-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a first step towards fixing 7181, this commit improves the comments and variable names around generating try/catch/finally blocks in GenICode and adds a test verifying the current functionality of try/catch/finally blocks
* | | | | | SI-7006 Recognize more jump only blocksJames Iry2013-02-251-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During ASM code emission we would recognize a block that consisted of ICode-only artifacts (ENTER_SCOPE, EXIT_SCOPE, and LOAD_EXCEPTION) followed by a jump. But we weren't using the same logic to recognize all jump-only blocks. So jump-elision wasn't removing them. And that in fact was why the ASM code emission had to do its special case. This commit makes all jump-only block recognition use the same logic: a jump-only block is one that has 0 or more ICode-only instructions followed by a JUMP. It does't necessarily have to start with a JUMP. There's now a debugWarning if the old NOP emitting code is triggered and test t6102 is enhanced to error if that warning occurs.
* | | | | Merge pull request #2161 from scalamacros/topic/7112-followup-masterJames Iry2013-02-241-1/+1
|\ \ \ \ \ | | | | | | | | | | | | fixes the test for SI-7112
| * | | | | 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 #2125 from retronym/ticket/7120Paul Phillips2013-02-236-0/+52
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7120 Erasure must honor typeref prefixes
| * | | | | | SI-7120 Erasure must honor typeref prefixesJason Zaugg2013-02-146-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erasure was discarding these, which led to unnecessarily wide types in quite particular circumstances. This showed up as a double definition error in the reported bug when the bridge method clashed with the erased signature.
* | | | | | | Merge remote-tracking branch 'origin/2.10.x' into masterPaul Phillips2013-02-231-0/+22
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: SI-7171 Consider prefix when assessing type finality. please ant with filenames, add comments Fixed error in reflection API docs about linearization order on method baseClasses Shadowed Implict typo (fixes no issue) remove unused imports Conflicts: src/reflect/scala/reflect/internal/Types.scala
| * | | | | | SI-7171 Consider prefix when assessing type finality.Jason Zaugg2013-02-221-0/+22
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Type#isFinalType` determines if a type could have a non-bottom subtype. This property is exploited by the pattern matcher to flag impossible patterns. This check was ignoring the type's prefix, and incorrectly deemed that `T#A` in `trait T { final class A }` was a final type. But it could have been subtyped by `U#A` where `U` <:< `T`, or, more simply, by `T.this.A`. Now, type finality requires that the prefix is stable. The existing test cases in neg/patmat-type-check.scala still correctly flag incompatiblities. `isFinalType` is also used by some code that massages pattern matches post specialization. That is actually either broken or obsolete under virtpatmat, I've opened SI-7172 to invesigate that. It is also used by GenICode to determine whether to emit the appropriate equality checks that are correct in the face of boxing. It is possible that this change will force the slow path in some rare cases, but it won't affect correctness.
* | | | | | Merge pull request #2147 from JamesIry/master_SI-7015Grzegorz Kossakowski2013-02-222-0/+60
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | SI-7015 Removes redundant aconst_null; pop; aconst_null creation