summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Add package view to scaladocFelix Mulder2016-02-261-5/+0
| | | | | | | | The package view shows the current package's: - siblings - children packages - path to root package - child entities (objects, traits, abstract types and classes)
* Merge pull request #4968 from lrytz/oldOptCleanupAdriaan Moors2016-02-2459-155/+108
|\ | | | | Remove -Y settings that are no longer used in 2.12
| * Remove -Y settings that are no longer used in 2.12Lukas Rytz2016-02-1645-111/+50
| | | | | | | | | | | | Added a deprecation warning for `-optimize`. Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
| * Rewrite a few more tests to the new optimizerLukas Rytz2016-02-1515-44/+58
| |
* | Merge pull request #4958 from adriaanm/typerefrefactorAdriaan Moors2016-02-241-2/+2
|\ \ | | | | | | Simplify TypeRef hierarchy. baseType returns NoType, as needed for isSubtype. Also improves performance.
| * | SI-9540 typedFunction is erasure awareAdriaan Moors2016-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When typer is running during erasure, must assign erased FunctionType in typedFunction. This removes a bunch of unneeded casts now we no longer assign a half-erased FunctionType. I poked around a bit, and it looks like erasure doesn't want typer to erase built-in types (like Unit/Any/Nothing). They are already treated specially during erasure.
* | | Add doc annotation `@shortDescription` to enable explicit synopsisFelix Mulder2016-02-223-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | Entities with this annotation will be able to control what is shown in the method summary on entity pages as well as the hover text on search results. Review: @VladUreche
* | | Merge pull request #4969 from lrytz/valPatternOptStefan Zeiger2016-02-178-182/+183
|\ \ \ | | | | | | | | Tests for optimizing val patterns
| * | | Clean up some bytecode testsLukas Rytz2016-02-166-168/+111
| | | |
| * | | Tests for optimizing val patternsLukas Rytz2016-02-162-14/+72
| | |/ | |/| | | | | | | Fixes https://github.com/scala/scala-dev/issues/28
* / | Scaladoc: Add new search, featuring entity and member searchFelix Mulder2016-02-175-59/+29
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a revamped search function for the scaladoc tool. It also contains a number of small fixes for HTML-layout and JavaScript issues. The search is implemented by enhancing the scheduler and using JavaScript promises. List of changes/additions: * Revamped search functionality - Search members as well as entities - Preserve keyboard navigation - Scroll to selected entity if outside of viewport - Non-blocking, cancelable * Display of library name (top left) * Refactored scheduler * Cleanup of HTML layout - Remove left pane - Better mobile layout, no need for dynamic offsets - Remove unused element classes - Remove iframe structure - Better layout for kinds
* | SD-79 don't issue spurious inliner warnings under l:projectLukas Rytz2016-02-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | When enabling `-Yopt:inline-project` (or `-Yopt:l:project`), the inliner would spuriously warn about callsites to methods marked `@inline` that are read from the classpath (not being compiled currently). This patch introduces yet another field to the `Callsite` class, which is growing a bit too large. But the call graph representation will get an overhaul when implementing the new inliner heuristics (2.12.0-M5), so this is just a temporary fix that would be nice to have in M4.
* | Merge pull request #4963 from lrytz/simplerBranchingLukas Rytz2016-02-153-5/+127
|\ \ | | | | | | Generate leaner code for branches
| * | Avoid generating ACONST_NULL; POP; ACONST_NULL when loading nullLukas Rytz2016-02-142-1/+48
| | | | | | | | | | | | | | | | | | | | | When loading a value of type scala.runtime.Null$ we need to add POP; ACONST_NULL, see comment in BCodeBodyBuilder.adapt. This is however not necessary if the null value is a simple ACONST_NULL. This patch eliminates that redundancy.
| * | Generate leaner code for branchesLukas Rytz2016-02-131-4/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenBCode used to generate more bytecode for branching instructions than GenASM. A simple method def f(x: Int, b: Boolean) = if (b) 1 else 2 would generate ILOAD 2 IFNE L1 GOTO L2 L1 ICONST_1 GOTO L3 L2 ICONST_2 L3 IRETURN If the conditional branch is negated (IFEQ) the GOTO is unnecessary. While -Yopt:l:method would clean this up, it's also not too hard to generate the leaner bytecode in the first place.
* | | SI-8790 test caseLukas Rytz2016-02-131-0/+20
|/ / | | | | | | | | Tuples created for pattern matching are eliminated since https://github.com/scala/scala/pull/4858
* | Merge pull request #4944 from lrytz/stringBuilderNoBoxLukas Rytz2016-02-123-37/+115
|\ \ | | | | | | SI-9571 Avoid boxing primitives in string concatenation
| * | SI-9571 Avoid boxing primitives in string concatenationMarko Elezovic2016-02-062-37/+100
| | |
| * | test case for optimizing BooleanOrdering.compareLukas Rytz2016-02-041-0/+15
| | |
* | | Merge pull request #4896 from retronym/topic/indy-all-the-thingsJason Zaugg2016-02-128-23/+152
|\ \ \ | | | | | | | | Use invokedynamic for structural calls, symbol literals, lambda ser.
| * | | Use invokedynamic for structural calls, symbol literals, lamba ser.Jason Zaugg2016-01-298-23/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous encodings created static fields in the enclosing class to host caches. However, this isn't an option once emit code in default methods of interfaces, as Java interfaces don't allow private static fields. We could continue to emit fields, and make them public when added to traits. Or, as chosen in this commit, we can emulate a call-site specific static field by using invokedynamic: when the call site is linked, our bootstrap methid can perform one-time computation, and we can capture the result in the CallSite. To implement this, I've allowed encoding of arbitrary invokedynamic calls in ApplyDynamic. The encoding is: ApplyDynamic( NoSymbol.newTermSymbol(TermName("methodName")).setInfo(invokedType) Literal(Constant(bootstrapMethodSymbol)) :: ( Literal(Constant(staticArg0)) :: Literal(Constant(staticArgN)) :: Nil ) ::: (dynArg0 :: dynArgN :: Nil) ) So far, static args may be `MethodType`, numeric or string literals, or method symbols, all of which can be converted to constant pool entries. `MethodTypes` are transformed to the erased JVM type and are converted to descriptors as String constants. I've taken advantage of this for symbol literal caching and for the structural call site cache. I've also included a test case that shows how a macro could target this (albeit using private APIs) to cache compiled regexes. I haven't managed to use this for LambdaMetafactory yet, not sure if the facility is general enough.
* | | | Merge pull request #4957 from retronym/topic/merge-2.11.x-to-2.12.x-20160210Seth Tisue2016-02-111-0/+28
|\ \ \ \ | | | | | | | | | | Merge 2.11.x to 2.12.x [ci:last-only]
| * \ \ \ Merge branch '2.11.x' into topic/merge-2.11.x-to-2.12.x-20160210Jason Zaugg2016-02-101-0/+28
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/Iterator.scala | `-- trivial conflicts only. Parens were added to the next() calls in 2.12.x, while in the meantime `{Concat,Join}Iterator` were optimized in 2.11.x
| | * \ \ \ Merge pull request #4937 from szeiger/issue/9623-2.11Seth Tisue2016-02-081-0/+28
| | |\ \ \ \ | | | | | | | | | | | | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIterator
| | | * | | | SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIteratorStefan Zeiger2016-02-011-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These iterator implementations are used to concatenate two (JoinIterator) or more (ConcatIterator) other iterators with `++`. They used to perform many unnecessary calls to the child iterators’ `hasNext` methods. This improved state machine-based implementation reduces that number to the bare minimum, i.e. iterating over concatenated iterators with `foreach` calls the children's `hasNext` methods a total of (number of children) + (number of elements) times, the same as when iterating over all children separately.
* | | | | | | Merge pull request #4955 from som-snytt/issue/8685-depr-caseLukas Rytz2016-02-104-1/+107
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9650 Refchecks on case apply transform
| * | | | | | | SI-9650 Refchecks on case apply transformSom Snytt2016-02-104-1/+107
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Apply checks for unsavoriness when transforming a case apply.
* | | | | | | Merge pull request #4924 from ShaneDelmore/SI-9452Lukas Rytz2016-02-103-1/+23
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | SI-9452: Extend BigDecimal with Ordered for java interop
| * | | | | | Merge branch '2.12.x' into SI-9452Shane Delmore2016-02-0455-263/+573
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | |
| * | | | | | Extend BigInt with Ordered for java interopShane Delmore2016-02-012-1/+18
| | | | | | |
| * | | | | | Extend BigDecimal with Ordered for java interopShane Delmore2016-02-011-0/+5
| | | | | | |
* | | | | | | Merge pull request #4938 from retronym/ticket/9349Jason Zaugg2016-02-102-0/+22
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9349 Fix use of patmat binder as prefix for new x.Inner
| * | | | | | | SI-9349 Fix use of patmat binder as prefix for new x.InnerJason Zaugg2016-02-022-0/+22
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When substituting in references to the synthetic values representing pattern binders, we were replacing: Select(Ident(o).setType(o.type), TypeName("Inner")) with: Select(Ident(x2).setType(typeOf[Outer]), TypeName("Inner")) The post transform in uncurry would then run: else if (tree.isType) TypeTree(tree.tpe) setPos tree.pos Which would loses track of the outer term `o` and crashes the compiler in ExplicitOuter. This commit generates stable references to the binders. I made this change in the substitutions for all `TreeMakers`, however only one of seems like it triggers a crash in the test variations I tried. Here's how the trees for the first pattern in the test case change after this patch: ``` @@ -1,30 +1,30 @@ [[syntax trees at end of patmat]] // test.scala package <empty>{<empty>.type} { object Test extends scala.AnyRef { def <init>(): Test.type = { Test.super{Test.type}.<init>{()Object}(){Object}; (){Unit} }{Unit}; def main(args: Array[String]): Unit = { val o1: Outer = Outer.apply{(i: Int)Outer}(5{Int(5)}){Outer}; { case <synthetic> val x1: Outer = o1{Outer}; case5(){ if (x1.ne{(x$1: AnyRef)Boolean}(null{Null(null)}){Boolean}) matchEnd4{(x: Unit)Unit}({ - val i: Outer#Inner = new x1.Inner{Outer#Inner}{()Outer#Inner}(){Outer#Inner}; + val i: x1.Inner = new x1.Inner{x1.Inner}{()x1.Inner}(){x1.Inner}; (){Unit} }{Unit}){Unit} else case6{()Unit}(){Unit}{Unit} }{Unit}; case6(){ matchEnd4{(x: Unit)Unit}(throw new MatchError{MatchError}{(obj: Any)MatchError}(x1{Outer}){MatchError}{Nothing}){Unit} }{Unit}; matchEnd4(x: Unit){ x{Unit} }{Unit} }{Unit} }{Unit} } ```
* | | | | | | Merge pull request #4868 from retronym/ticket/9542-comboJason Zaugg2016-02-102-1/+35
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | SI-9542 Fix regression in value classes (served two ways)
| * | | | | | SI-9542 Unify different reprs. of module type refsJason Zaugg2016-02-012-1/+35
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new unit test shows failures in transitivity of subtyping and type equivalence, which boil down the the inconsistent handling of the semantically equivalent: ThisType(pre, ModuleClass) ModuleTypeRef(pre, ModuleClass) SingleType(pre, Module) This commit: - adds a case to `normalizePlus` to unwrap a `ThisType` to a `ModuleTypeRef` - Use `normalizePlus` more widely during subtype comparison - refactor `fourthTry` (part of `isSubType`) to remove code that becomes obviated by the use of `normalizePlus`. This fixes the regression in the extension methods phase which was triggered by https://github.com/scala/scala/pull/4749. We can also fix that regression by tweaking the extension methods phase itself to emit the `ThisType` representation of the owner of the value class, as before. I plan to demonstrate the two approaches to fixing the regression on separate branches, and the propose that the merged result of these two is useds.
* | | | | | SI-9620: add doc annotation to hide specific conversionsFelix Mulder2016-02-092-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit will introduce the doc annotation `@hideImplicitConversion`. By specifying which conversions to hide, the user can "toggle" which conversions are kept in the parsed entity. This implementation is a better workaround than hardcoding which ones to ignore when running scaladoc. Review: @VladUreche
* | | | | | SI-9574 Prevent illegal overrides of members with module typesStefan Zeiger2016-02-082-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f32a32b1b33c9d7ccd62467e3e10cb69930023c8 introduced the ability to override objects with other objects. The exception that allows these overrides (where the usual subtyping check fails) was applied to all members whose type is a module class. This is too broad, however, because it not only applies to members of the form `object foo` but also `def foo: bar.type` (where `bar` is an `object`). The fix is to restrict the exception to those cases where both definitions actually are objects.
* | | | | | Merge remote-tracking branch 'origin/2.12.x' into ↵Jason Zaugg2016-02-0455-263/+573
|\ \ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | merge/2.11.x-to-2.12.x-20160203
| * | | | | Merge pull request #4940 from lrytz/partestUpgradeSeth Tisue2016-02-034-1/+11
| |\ \ \ \ \ | | | | | | | | | | | | | | Update partest to 1.0.12, test case for reporting invalid flags
| | * | | | | Update partest to 1.0.12, test case for reporting invalid flagsLukas Rytz2016-02-035-2/+12
| | |/ / / /
| * | | | | Merge pull request #4920 from lrytz/oldOptimizerTestsLukas Rytz2016-02-0349-262/+444
| |\ \ \ \ \ | | | | | | | | | | | | | | restore / rewrite various tests
| | * | | | | Re-write and Re-enable optimizer testsLukas Rytz2016-02-0347-256/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite tests for new optimizer - SI-6941 - SI-2171 - t3430 - t3252 - t4840 - t2171 - t3430 - t3252 - t6157 - t6547 - t8062 - t8306 - t8359 - t9123 - trait-force-info - private-inline test cases for bugs fixed in the new optimizer - SI-9160, the unnecessary boxing mentioned in the ticket is optimzied since push-pop elimination (#4858). - SI-8796 - SI-8524 - SI-7807 fix flags file for t3420 remove an empty flags file remove unnecessary partest filters explicit inliner warnings in test t7582 Restore the lisp test. Removing the flags file - our build runs with the (new) optimizer enabled anyway. The test spent the past few years as an optimizer test in pos/ see https://issues.scala-lang.org/browse/SI-4512. The attempt may fail, but why not give it a try. $ git lg -S"lisp" ... | * | | | f785785 - SI-4579 Yoke the power of lisp.scala as a stress for the optimizer. (3 years, 8 months ago) <Jason Zaugg> ... * | | | | | | 622cc99 - Revert the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | | | | | | 97f0324 - Revived the lisp test. (3 years, 10 months ago) <Paul Phillips> ... * | 1e0f7dc - Imprison the lisp test, no review. (4 years, 4 months ago) <Paul Phillips> ... * | 6b09630 - "Freed the lisp test." Tweaked partest defaults... (4 years, 6 months ago) <Paul Phillips> ... * | fec42c1 - Lisp test wins again, no review. (4 years, 8 months ago) <Paul Phillips> ... * | 1c2d44d - Restored the lisp.scala test. (4 years, 8 months ago) <Paul Phillips> ... * | 15ed892 - Temporarily sending lisp.scala to be interprete... (4 years, 8 months ago) <Paul Phillips> ...
| | * | | | | show erroneous compiler flags in junit compiler testsLukas Rytz2016-02-031-2/+4
| | | | | | |
| | * | | | | Improve simplifyJumpsLukas Rytz2016-02-031-4/+19
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve simplifyJumps to rewrite IFEQ L4 L5 GOTO L6 to IFNE L6 L5 This rewrite is only correct if L5 is not the target of any jump instruction (otherwise, removing the GOTO would change semantics). Previously we did not do the rewrite if there was any label between the conditional jump and the goto (like L5). Now we track which labels are jump targets.
| * | | | | Merge pull request #4737 from soc/SI-9315Lukas Rytz2016-02-031-0/+70
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-9315 Desugar string concat to java.lang.StringBuilder ...
| | * | | | | SI-9315 Desugar string concat to java.lang.StringBuilder ...Simon Ochsenreither2016-02-031-0/+70
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of scala.collection.mutable.StringBuilder to benefit from JVM optimizations. Unfortunately primitives are already boxed in erasure when they end up in this part of the backend.
| * | / / / Clarified and expanded which Builders were reusableRex Kerr2016-01-301-0/+48
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This additionally fixes both SI-8648 and SI-9564. Added documentation to Builder to clarify that in general Builders are NOT reusable. Altered implementation of GrowingBuilder to use Growable instance's clear (not valid for a reusable builder, but this one isn't reusable). Added a new marker trait ReusableBuilder that specifies that these builders should be reusable. This trait overrides the clear and result methods while leaving them abstract in order to supply appropriate scaladoc. Made all Array builders Reusable in all cases (by setting capacity to 0 if the original array is returned). (Fixed a poor implmentation of Array[Unit] builder along the way.) Documented which other builders were already reusable (maps, sets, Vector, LazyBuilder, StringBuilder, ListBuffer, etc.).
* | | | | Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-046-2/+94
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * | | | Merge pull request #4927 from szeiger/issue/9572Jason Zaugg2016-02-012-0/+13
| |\ \ \ \ | | | | | | | | | | | | SI-9572 Check for illegal tuple sizes in the parser
| | * | | | SI-9572 Check for illegal tuple sizes in the parserStefan Zeiger2016-01-282-0/+13
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds explicit checks with syntax errors for tuple literals and types of more than 22 elements. An alternative approach to fixing SI-9572 would be to revert to the old failure mode of Scala 2.10 where references to arbitrary `scala.TupleXY` would be generated in the parser, which then leads to “type/object not found” errors in the typechecker. This fix here is more intrusive but arguably provides a better user experience. Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to `Parsers` because they can now generate syntax errors. New methods `makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking on top of `makeTupleType` and `makeTupleTerm`. They are overridden with no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.