summaryrefslogtreecommitdiff
path: root/test/junit
Commit message (Collapse)AuthorAgeFilesLines
* Extend BigInt with Ordered for java interopShane Delmore2016-02-011-0/+16
|
* Extend BigDecimal with Ordered for java interopShane Delmore2016-02-011-0/+5
|
* SI-9398 Treat case classes as one-element ADTs for analysisJason Zaugg2016-01-291-1/+1
| | | | | | | | Currently, exhaustivity analysis only runs for scrutinees with a sealed type. This commit treats any case class as a one-element, sealed type to enable additional analysis, such as in the new test case.
* Rename junit tests to end in *Test to make them run in ANTLukas Rytz2016-01-254-7/+5
| | | | | | Our ANT script only runs junit tests that match *Test.class. https://github.com/scala/scala/blob/1081e718f8f8e174dbf615e42b157e187d3d3886/build.xml#L1467
* Rewrite test: no local for underscoreLukas Rytz2016-01-251-0/+19
|
* Rewrite test: no null in patmatLukas Rytz2016-01-251-0/+13
|
* Rewrite test: no type test on primitives in patmatLukas Rytz2016-01-251-0/+19
|
* Rewrite test for SI-7006Lukas Rytz2016-01-251-0/+24
|
* Rewrite test for inlining higher-order functionsLukas Rytz2016-01-251-0/+20
|
* Rewrite test for inlining from sealed classLukas Rytz2016-01-252-1/+29
|
* Rewrite copy propagation testLukas Rytz2016-01-251-6/+73
|
* Rewrite test for SI-5313Lukas Rytz2016-01-251-1/+92
|
* Rewrite test for SI-6955Lukas Rytz2016-01-251-0/+28
|
* Rewrite test for SI-6956Lukas Rytz2016-01-251-0/+58
|
* Merge remote-tracking branch 'upstream/2.12.x' into opt/elimBoxesLukas Rytz2016-01-246-19/+201
|\
| * Fix problems with a locale-dependent decimal mark in StringContextTestMichał Pociecha2016-01-131-16/+36
| | | | | | | | | | | | | | | | Depending on the current locale one can get 3,400000e+00 instead of 3.400000e+00 so the expected result should take this into account. It's a similar change to one I made some time ago in 2.11.x: https://github.com/scala/scala/pull/4204
| * Make StringContextTest pass on WindowsLinas Medziunas2016-01-131-3/+2
| | | | | | | | | | | | One assertion in StringContextTest."f interpolator baseline"() was relying on platform specific newline encoding, making it fail when run on Windows.
| * Merge pull request #4875 from slothspot/ticket/9454Lukas Rytz2015-12-181-0/+1
| |\ | | | | | | [SI-9454] Add isAlive method into sys.process.Process trait
| | * [SI-9454] Add isAlive method into sys.process.Process traitDmitry Melnichenko2015-12-111-0/+1
| | |
| * | SI-9583: Update SystemProperties.empty to return a mutable.Map to fix buildersShane Delmore2015-12-101-0/+27
| |/
| * Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-242-0/+99
| |\
| | * Merge pull request #4809 from wpopielarski/delambdafy-multiple-outputsJason Zaugg2015-11-131-0/+73
| | |\ | | | | | | | | Multi output problem with delambdafied compilation
| | | * Test addedwpopielarski2015-11-061-0/+73
| | | |
| | * | SI-9497 Fix SetLike#clear() default implementationRui Gonçalves2015-10-211-0/+26
| | |/ | | | | | | | | | When dealing with mutable collections, it is not safe to assume iterators will remain consistent when the collection is modified mid-traversal. The bug reported in SI-9497 is very similar to SI-7269, "ConcurrentModificationException when filtering converted Java HashMap". Then, only the `retain` method was fixed. This commit fixes `clear`, which had the same problem.
| * | SI-9363 - Add empty serializabletriggerNZ2015-11-241-0/+2
| | |
| * | Fix for SI-9363triggerNZ2015-11-241-0/+34
| | |
* | | Jump optimizations may enable more push-pop eliminationLukas Rytz2016-01-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Jump optimization replaces an unnecessary conditional jump, e.g. `IFNULL l; l: ...` by `POP`, which enables further push-pop elimination. Also introduces a `-YoptTrace` flag that traces the progress of the bytecode as it goes through local optimizations.
* | | SI-8601 Don't treat newarray as dead codeLukas Rytz2016-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we lose the side effect of a `NegativeArraySizeException`. A test for this case already exists (run/t8601b.scala), but it currently enforces `-optimize -Ybackend:GenASM`, so it didn't trigger on the new backend. However, PR #4814 was merged into 2.12.x and moved that test over to the new backend and optimizer. After merging the 2.12.x into the current optimizer branch (push-pop elimination), the test started failing. Also disable the optimizer for `jvm/bytecode-test-example`: it counts the number of null checks in a method, the optimizer (rightly) eliminates one of the two.
* | | Harden methods to recognize method invocations to optimizeLukas Rytz2016-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous methods to identify method invocations that can be optimized, such as `isPredefAutoBox`, were String-based. Now we obtain class and method signatures from symbols through the BTypes infrastructure. We also piggy-back on specialization's type transformer to create all specialized subclasses of Tuple1/Tuple2. We'll do the same in the future for FunctionN, but the current JFunctionN are written in Java and specialized artisanally.
* | | Run DCE before the closure optimizer (fixes a crash)Lukas Rytz2016-01-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before identifying function callsites within the same method as a closure allocation, run DCE. The ProdCons analysis used to identify these function calls may crash if there is unreachable code, as observed in the community build with scala-js. The crash was rare because inlining, which is performed before closure optimizations, already runs DCE. However, inlining may render more code unreachable (e.g. when inlining a method that throws). Also make sure that DCE is always performed on the callee before inlining: move the DCE invocation into the inlineCallsite method, which is also invoked by the closure optimizer.
* | | Apply local optimization based on nullness informationLukas Rytz2015-12-152-13/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize IFNULL branches to GOTO when (non-)nullness of the tested value is known statically. This enables unreachable code to be removed, which in turn enables boxes to be eliminated. Changed a test flag from `-Ynooptimise` to `-Yopt:l:classpath` - I still have to do this systematically, this will follow later.
* | | Eliminate unnecessary castsLukas Rytz2015-12-153-10/+41
| | | | | | | | | | | | | | | | | | Eliminate casts that are statically known to succeed. This enables boxes to be eliminated and simplifies the implementation of closure allocation elimination.
* | | Eliminate non-escaping boxes, tuples and refsLukas Rytz2015-12-152-55/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Make some testing tools from InlinerTest available to other testsLukas Rytz2015-12-133-20/+17
| | |
* | | Rename test MethodLevelOpts -> MethodLevelOptsTestLukas Rytz2015-12-131-4/+4
| | |
* | | Support specialized functions in closure optimizerLukas Rytz2015-11-132-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/scala/scala-dev/issues/52. An IndyLambda may create a specialized function type, where the SAM is the corresponding specialized variant of apply. If this closure is invoked through the generic apply method, the closure optimizer would previously not re-write the invocation to the $anonfun method. This is now done, including the necessary box / unbox operations.
* | | Fix specialized function class names in closure optimizerLukas Rytz2015-11-101-0/+17
| | |
* | | Copy propagation, remove unused values (closures!) and local variablesLukas Rytz2015-11-103-27/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Copy propagation uses an AliasingAnalyzer: it replaces a `LOAD n` instruction by `LOAD m` where m is the smallest alias of n. This leads to stale STORE instructions. Stale STOREs are identified using a ProdCons analyzer and replaced by POPs. Values that are pushed on the stack by a side-effect free instruction and consumed by a POP are then removed by `eliminatePushPop`. This includes elimination of unused closure allocations and unused boxes and tuple allocations (*). A final cleanup eliminates `STORE x; LOADx` pairs where the stored value is not otherwise used. Fixes - https://github.com/scala/scala-dev/issues/25 - https://github.com/scala/scala-dev/issues/7 - https://github.com/scala/scala-dev/issues/14 - https://github.com/scala/scala-dev/issues/12 (*) We don't yet rewrite reads of boxes and tuples yet. For example, `val x = (1, 2); x._1` remains a method invocation and the tuple cannot be eliminated (https://github.com/scala/scala-dev/issues/11). Inspired in many ways by Miguel's work!
* | | Track aliases of primitive values in AliasingFrameLukas Rytz2015-10-292-1/+64
|/ / | | | | | | | | This allows using an AliasingAnalyzer for copy propagation (subsequent commit).
* | Merge pull request #4794 from densh/topic/predef-autoboxingSeth Tisue2015-10-271-0/+35
|\ \ | | | | | | Fixes an inconsistency between BoxesRunTime and Predef's autoboxing
| * | Fixes an inconsistency between BoxesRunTime and Predef's autoboxingDenys Shabalin2015-10-081-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously autoboxing implicits in Predef were inconsistent with BoxesRunTime box/unbox due to different treatment of unboxing of nulls. Implicits didn't check for null and would crash with NPE unlike the BoxesRunTime which correctly returned zero value of given type. The fix is trivial: lets just use asInstanceOfs to implement implicits in Predef. This would ensure that both have the same behaviour and that the two would not diverge again in the future.
* | | f interp test is junitSom Snytt2015-10-251-0/+160
| | | | | | | | | | | | | | | | | | | | | Moves test/files/run/stringinterpolation_macro-run.scala to the junit test class test/junit/scala/StringContextTest.scala. Adds a couple of assertions to the test.
* | | Merge pull request #4802 from SethTisue/merge-2.11-to-2.12-oct-16Lukas Rytz2015-10-211-0/+42
|\ \ \ | | | | | | | | merge 2.11 to 2.12 Oct 16
| * \ \ merge 2.11.x onto 2.12.x, Oct 16 2015Seth Tisue2015-10-161-0/+42
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there were merge conflicts in the Eclipse config that I resolved with --ours. I invite @performantdata to submit a followup PR bringing the Eclipse stuff into a good state on 2.12.x. there was a test failure in test/junit/scala/collection/mutable/OpenHashMapTest.scala due to the 2.12 compiler emitting the field backing a private var differently (with an unmangled name). Lukas says the difference is expected, so I just updated the code in the test. there were no other merge conflicts. % git log --decorate --oneline -1 origin/2.11.x | cat ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request #4791 from performantdata/issue/9508 % git log --decorate --oneline -1 origin/2.12.x | cat c99e53e (HEAD -> 2.12.x, origin/2.12.x) Merge pull request #4797 from lrytz/M3-versions % export MB=$(git merge-base 2.12.x origin/2.11.x) % echo $MB 42cafa21f3c4a08c6dd34608278f810b6ec2886f % git log --graph --oneline --decorate $MB...origin/2.11.x | cat * ae5f0de (origin/HEAD, origin/2.11.x) Merge pull request #4791 from performantdata/issue/9508 |\ | * 08dca37 (origin/pull/4791) SI-9508 fix classpaths in Eclipse configuration * | fe76232 Merge pull request #4798 from performantdata/issue/9513 |\ \ | * | 9c97a7f (origin/pull/4798) Suppress unneeded import. | * | 30d704d Document some OpenHashMap internal methods. | * | 1fb32fc SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reused | |/ * | 14f875c Merge pull request #4788 from dk14/patch-1 |\ \ | * | 42acd55 (origin/pull/4788) explicitly specify insertion-order feature in docs | / * | 68ce049 Merge pull request #4771 from som-snytt/issue/9492-here |\ \ | * | f290962 (origin/pull/4771) SI-9492 Line trimming paste | * | bc3589d SI-9492 REPL paste here doc | / * | 9834fc8 Merge pull request #4610 from todesking/spec-implicits-remove-obsolete |\ \ | * | 46009b1 (origin/pull/4610) Add view/context-bound parameter ordering rule | * | 6eba305 Spec: Implicit parameters with context/view bound is allowed since 2.10 | / * | d792e35 Merge pull request #4789 from janekdb/2.11.x-param-names-predicates-operations |\ \ | |/ |/| | * b19a07e (origin/pull/4789) Rename forall, exists and find predicate and operator params. |/ * 648c7a1 Merge pull request #4790 from SethTisue/issue/9501 |\ | * 40d12f1 (origin/pull/4790) SI-9501 link README to Scala Hacker Guide * e0b5891 Merge pull request #4786 from performantdata/issue/9506 * 39acad8 (origin/pull/4786) SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs * 74dc364 SI-9506 suppress Scala IDE-generated files in the Eclipse project dirs % git merge ae5f0de Auto-merging src/repl/scala/tools/nsc/interpreter/ILoop.scala Auto-merging src/library/scala/util/Either.scala Auto-merging src/library/scala/runtime/Tuple3Zipped.scala Auto-merging src/library/scala/runtime/Tuple2Zipped.scala Auto-merging src/library/scala/collection/parallel/ParIterableLike.scala Auto-merging src/library/scala/collection/immutable/ListMap.scala Auto-merging src/library/scala/collection/TraversableLike.scala Auto-merging src/eclipse/test-junit/.classpath CONFLICT (content): Merge conflict in src/eclipse/test-junit/.classpath Auto-merging src/eclipse/scaladoc/.classpath CONFLICT (content): Merge conflict in src/eclipse/scaladoc/.classpath Auto-merging src/eclipse/scala-compiler/.classpath Auto-merging src/eclipse/repl/.classpath CONFLICT (content): Merge conflict in src/eclipse/repl/.classpath Auto-merging src/eclipse/partest/.classpath CONFLICT (content): Merge conflict in src/eclipse/partest/.classpath Auto-merging src/eclipse/interactive/.classpath Auto-merging README.md Automatic merge failed; fix conflicts and then commit the result. % git checkout --ours src/eclipse/partest/.classpath % git checkout --ours src/eclipse/repl/.classpath % git checkout --ours src/eclipse/scaladoc/.classpath % git checkout --ours src/eclipse/test-junit/.classpath % git add -u % emacs test/junit/scala/collection/mutable/OpenHashMapTest.scala % git diff test/junit/scala/collection/mutable/OpenHashMapTest.scala | cat ... - val field = m.getClass.getDeclaredField("scala$collection$mutable$OpenHashMap$$deleted") + val field = m.getClass.getDeclaredField("deleted") ... % git add -u
| | * Suppress unneeded import.Performant Data LLC2015-10-141-2/+2
| | |
| | * SI-9513 decrement "deleted" count in OpenHashMap.put() when slot reusedPerformant Data LLC2015-10-101-0/+42
| | |
* | | Allow @inline/noinline at callsites (in addition to def-site)Lukas Rytz2015-10-202-12/+69
| | | | | | | | | | | | | | | | | | | | | Allow annotating individual callsites @inline / @noinline using an annotation ascription c.foo(): @inline
* | | Correctly handle post-inline requests of non-existing callsitesLukas Rytz2015-10-201-4/+36
| | | | | | | | | | | | | | | | | | A post-inline request is allowed to refer to a callsite that does not exist anymore because it was alredy inlined while handling some other inline request, or because it was DCE'd.
* | | Simplify post inlining requestsLukas Rytz2015-10-203-128/+40
| | | | | | | | | | | | Clean up inliner test
* | | Don't create inline requests for callsites that cannot be inlinedLukas Rytz2015-10-202-20/+94
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When traversing the call graph and collecting inline reqeusts, rule out callsites that we already know cannot be inlined. Note that we cannot perform all necessary checks already at this stage: checks that depend on the callee body (the inlined code) are deferred until the callsite is actually inlined. The reason is that the code may change. Example: @inline final def f = try 1 catch { case _: Throwable => 2 } @inline final def g = f def t = println(g) When collecting inline requests, the body of g invokes the public method f, so g could be inlined into t. However, once f is inlined into g, the body of g contains a try-catch block. Now we cannot inline g into t anymore, because the call stack at the g callsite is non-empty (the stack is cleared when entering a handler).