summaryrefslogtreecommitdiff
path: root/test/junit
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5531 from tabdulradi/SI-10060Lukas Rytz2016-12-121-0/+42
|\ | | | | SI-10060 Fixes NumricRange.max bug on empty ranges
| * fixup! SI-10060 Fixes NumericRange.max bug on empty rangesTamer Mohammed Abdul-Radi2016-11-161-2/+14
| |
| * SI-10060 Fixes NumericRange.max bug on empty rangesTamer AbdulRadi2016-11-161-0/+30
| |
* | Don't exclude super calls to trait methods from inliningLukas Rytz2016-11-291-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | In 8020cd6, the inliner was changed to make sure trait methods bodies are not duplicated into the static super accessors, and from there into mixin forwarders. The check for mixin forwarders was too wide. In `def t = super.m`, where `m` is a trait method annotated `@inline`, we want to inline `m`. Note that `super.m` is translated to an `invokestatic T.m$`. The current check incorrectly identifies `t` as a mixin forwarder, and skip inlining.
* | Merge commit '57290a1' into topic/merge-2.11.x-to-2.12.x-20161129Jason Zaugg2016-11-291-0/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: spec/_layouts/default.yml test/junit/scala/tools/nsc/interpreter/CompletionTest.scala Fixes scala/scala-dev#272
| * | Improve performance of REPL autocompletionJason Zaugg2016-11-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used to fuzzily match, e.g, `declasses` with `getDeclaredClasses` was exploring fruitless parts of the search space. The enclosed test case was hanging the REPL. This commit improves this by performing a prefix match of the unconsumed input against the current chunk of the candidate before exploring the `inits`. Fixes scala/scala-dev#271
* | | Merge pull request #5544 from retronym/ticket/8779Jason Zaugg2016-11-292-1/+53
|\ \ \ | | | | | | | | SI-8779 Enable inlining of code within a REPL session
| * | | SI-8779 Enable inlining of code within a REPL sessionJason Zaugg2016-11-282-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The REPL has a long running instance of Global which outputs classfiles by default to a VirtualDirectory. The inliner did not find any of these class files when compiling calls to methods defined in previous runs (ie, previous lines of input.) This commit: - Adds a hook to augment the classpath that the optimizer searches, and uses this in the REPL to add the output directory - Fixes the implementation of `findClassFile` in VirtualDirectory, which doesn't seem to have been used in anger before. I've factored out some common code into a new method on `AbstractFile`. - Fixes a similar problem getSubDir reported by Li Haoyi - Adds missing unit test coverage. This also fixes a bug in REPL autocompletion for types defined in packages >= 2 level deep (with the `:paste -raw` command). I've added a test for this case.
* | | | Better inliner support for 2.12 trait encodingLukas Rytz2016-11-255-34/+153
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes to the trait encoding came late in the 2.12 cycle, and the inliner was not adapted to support it in the best possible way. In 2.12.0 concrete trait methods are encoded as interface T { default int m() { return 1 } static int m$(T $this) { <invokespecial $this.m()> } } class C implements T { public int m() { return T.m$(this) } } If a trait method is selected for inlining, the 2.12.0 inliner would copy its body into the static super accessor `T.m$`, and from there into the mixin forwarder `C.m`. This commit special-cases the inliner: - We don't inline into static super accessors and mixin forwarders. - Insted, when inlining an invocation of a mixin forwarder, the inliner also follows through the two forwarders and inlines the trait method body. There was a difficulty implementing this: inlining the static static super accessor would copy an `invokespecial` instruction into a different classfile, which is not legal / may change semantics. That `invokespecial` is supposed to disappear when inlining the actual default method body. However, this last step may fail, for example because the trait method body itself contains instructions that are not legal in a different classfile. It is very difficult to perform all necessary checks ahead of time. So instead, this commit implements the ability to speculatively inline a callsite and roll back if necessary. The commit also cleans up the implementation of inliner warnings a little. The previous code would always emit a warning when a method annotated `@inline` was not picked by the heuristics - this was a problem when the callsite in the static super accessor was no longer chosen.
* | | Merge pull request #5481 from som-snytt/issue/10007-processLukas Rytz2016-11-182-0/+26
|\ \ \ | | | | | | | | SI-10007 sys.process thread sync
| * | | SI-10007 sys.process thread syncSom Snytt2016-11-172-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous change to replace `SyncVar.set` with `SyncVar.put` breaks things. This commit tweaks the thread synchronizing in `sys.process` to actually use `SyncVar` to sync and pass a var. Joining the thread about to exit is superfluous. A result is put exactly once, and consumers use non-destructive `get`. Note that as usual, avoid kicking off threads in a static context, since class loading cycles are somewhat dicier with 2.12 lambdas. In particular, REPL is a static context by default. SI-10007 Clarify deprecation message The message on `set` was self-fulfilling, as it didn't hint that `put` has different semantics. So explain why `put` helps avoid errors instead of creating them. SI-10007 Always set exit value Always put a value to exit code, defaulting to None. Also clean up around tuple change to unfortunately named Future.apply. Very hard to follow those types. Date command pollutes output, so tweak test.
* | | | Merge pull request #5330 from som-snytt/issue/9885Jason Zaugg2016-11-181-0/+19
|\ \ \ \ | | | | | | | | | | SI-9885 Don't return offset past EOF
| * | | | SI-9885 Don't return offset past EOFSom Snytt2016-08-121-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | On bad line number, `lineToOffset` should not return an offset past EOF (which was sentinel, internally).
* | | | | Revert "SI-9750 isJavaAtLeast(Int)"Jason Zaugg2016-11-161-8/+3
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | This reverts commit 656162bb48fbbd703790a2c94d4563e40ddfdfc2. Adding new APIs is not possible until a major release.
* | | | Merge pull request #5335 from rumoku/SI-9888Jason Zaugg2016-11-111-0/+15
|\ \ \ \ | | | | | | | | | | SI-9888. Prevent OOM on ParRange. Improve toString.
| * | | | SI-9888. Prevent OOM on ParRange. Improve toString.Vladimir Glushak2016-10-021-0/+15
| | | | |
* | | | | Merge commit 'b9a16c4' into 2.12.xJason Zaugg2016-11-081-0/+6
|\ \ \ \ \ | |_|_|/ / |/| | | / | | |_|/ | |/| |
| * | | Merge pull request #5378 from som-snytt/issue/9913Seth Tisue2016-10-261-0/+6
| |\ \ \ | | | | | | | | | | SI-9913 Lead span iterator finishes at state -1
| | * | | SI-9913 Lead span iterator finishes at state -1Som Snytt2016-09-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Even if no elements fail the predicate (so that the trailing iterator is empty).
* | | | | Merge pull request #5276 from som-snytt/issue/9750Seth Tisue2016-10-261-28/+74
|\ \ \ \ \ | | | | | | | | | | | | SI-9750 scala.util.Properties.isJavaAtLeast works with JDK9
| * | | | | SI-9750 Spec check major.minor.securitySom Snytt2016-07-211-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't assume spec is just major, but allow arbitrary version number for both spec value and user value to check. Only the first three dot-separated fields are considered, after skipping optional leading value "1" in legacy format. Minimal validity checks of user arg are applied. Leading three fields, if present, must be number values, but subsequent fields are ignored. Note that a version number is not a version string, which optionally includes pre and build info, `9-ea+109`.
| * | | | | SI-9750 isJavaAtLeast(Int)Som Snytt2016-07-151-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A good opportunity to simplify the API. Versions are strings, but a spec version is just a number.
| * | | | | SI-9750 Tweak tests for what is a numberSom Snytt2016-07-151-21/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Leaves the error string as is, but adds test to show how it looks. Java calls it a version number. `Not a version: 1.9`. Don't strip `1.` prefix recursively. (That was Snytt's fault.)
| * | | | | SI-9750 scala.util.Properties.isJavaAtLeast works with JDK9Pavel Petlinsky2016-07-131-17/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The utility method compares javaSpecVersion, which has the form "1.8" previously and "9" going forward. The method accepts "1.n" for n < 9. More correctly, the string argument should be a single number. Supports JEP-223.
* | | | | | assorted typo fixes, cleanup, updating of commentsSeth Tisue2016-10-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | just in time for Halloween. "boostrap" is definitely the most adorable typo evah -- and one of the most common, too. but we don't want to scare anybody.
* | | | | | re-enable (or simplify) various tests now that STARR is bumpedSeth Tisue2016-10-241-206/+185
| | | | | |
* | | | | | Merge pull request #5400 from sjrd/rewrite-traversablelike-stringprefixSeth Tisue2016-10-201-5/+41
|\ \ \ \ \ \ | | | | | | | | | | | | | | Rewrite TraversableLike.stringPrefix not to blow up code size in Scala.js.
| * | | | | | Rewrite TraversableLike.stringPrefix not to blow up code size in Scala.js.Sébastien Doeraene2016-09-151-5/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 30876fe2dd8cbe657a6cad6b11bbc34f10c29b36 changed `TraversableLike.stringPrefix` to report nicer results for inner classes and method-local classes. The changes included calls to `String.split()`, `Character.isDigit()` and `Character.isUpperCase()`. This was particularly bad for Scala.js, because those methods bring with them huge parts of the JDK (the `java.util.regex.*` implementation on the one hand, and the Unicode database on the other hand), which increased generated code size by 6 KB after minimification and gzip for an application that does not otherwise use those methods. This sudden increase is tracked in the Scala.js bug tracker at https://github.com/scala-js/scala-js/issues/2591. This commit rewrites `TraversableLike.stringPrefix` in a very imperative way, without resorting to those methods. The behavior is (mostly) preserved. There can be different results when `getClass().getName()` contains non-ASCII lowercase letters and/or digits. Those will now be recognized as user-defined instead of likely compiler-synthesized (which is a progression). There still are false positives for ASCII lowercase letters, which cause the `stringPrefix` to be empty (as before). Since the new implementation is imperative anyway, at least I made it not allocate anything but the result `String` in the common case where the result does not contain any `.`.
* | | | | | | Merge 2.11.x into 2.12.xAdriaan Moors2016-10-201-18/+22
|\ \ \ \ \ \ \ | | |_|/ / / / | |/| | | | | | | | | | | | Include PRs #5464, #5467
| * | | | | | SI-9832 Fix line endings in junit testSom Snytt2016-10-191-18/+22
| | | | | | |
* | | | | | | Merge 2.11.x into 2.12.xAdriaan Moors2016-10-181-0/+63
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix conflict in #5453: ``` - def help: String = { + override def help: String = { ```
| * | | | | | SI-9832 -Xlint:help shows defaultSom Snytt2016-10-111-0/+63
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conclude help method with the default list. Extra words are supplied for underscore.
| * | | | | Avoid triple-quoting triple quotesSom Snytt2016-06-171-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The boolean test for triples was inadvertently flipped. Adds test for pretty printed multiline strings
| * | | | | SI-9737 [no-merge] Backport stringOf ParIterableNicolas Stucki2016-06-031-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cherry-picked c5f3d3f286ee5c26c8ddcf10f6878058e8f7e040 Edited comment: in stringOf, let GenIterable subsume both Iterable and ParIterable. This change is required for Scala.js compatibility as it does not support parallel collections. Conflicts: src/library/scala/runtime/ScalaRunTime.scala
| * | | | | Merge pull request #5167 from martijnhoekstra/SI-9766Lukas Rytz2016-05-231-0/+18
| |\ \ \ \ \ | | | | | | | | | | | | | | SI 9766 - allow ++ on empty ConcatIterator
| | * | | | | SI-9766 - allow ++ on empty ConcatIteratorMartijn Hoekstra2016-05-211-0/+18
| | | | | | |
* | | | | | | Merge remote-tracking branch 'origin/2.12.0' into merge/2.12.0-to-2.12.xJason Zaugg2016-10-148-34/+222
|\ \ \ \ \ \ \
| * | | | | | | Test cases for super callsLukas Rytz2016-09-301-0/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recovered and adapted some test cases for super calls from #5415
| * | | | | | | Default -Xmixin-force-forwarders to trueLukas Rytz2016-09-303-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also eliminates the warning when a mixin forwarder cannot be implemented because the target method is a java-defined default method in an interface that is not a direct parent of the class. The test t5148 is moved to neg, as expected: It was moved to pos when disabling mixin forwarders in 33e7106. Same for the changed error message in t4749.
| * | | | | | | re-enable two tests (starr is up to date now)Lukas Rytz2016-09-306-20/+12
| | | | | | | |
| * | | | | | | Error message for super calls to indirect java parent interfacesLukas Rytz2016-09-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super calls to indirect java parent interfaces cannot be emitted, an error message is emitted during SuperAccessors. The error message was missing if the super call was non-qualified, resulting in an assertion failure in the backend.
* | | | | | | | Merge pull request #5416 from SethTisue/merge-2.12.0-to-2.12.x-sep-24Seth Tisue2016-10-053-4/+19
|\| | | | | | | | | | | | | | | | | | | | | | | merge 2.12.0 onto 2.12.x [ci: last-only]
| * | | | | | | Emit local module like lazy valAdriaan Moors2016-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation is to use the new fine-grained lock scoping that local lazies have since #5294. Fixes scala/scala-dev#235 Co-Authored-By: Jason Zaugg <jzaugg@gmail.com>
| * | | | | | | SD-233 synchronized blocks are JIT-friendly againJason Zaugg2016-09-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenBCode, the new backend in Scala 2.12, subtly changed the way that synchronized blocks are emitted. It used `java/lang/Throwable` as an explicitly named exception type, rather than implying the same by omitting this in bytecode. This appears to confuse HotSpot JIT, which reports a error parsing the bytecode into its IR which leaves the enclosing method stuck in interpreted mode. This commit passes a `null` descriptor to restore the old pattern (the same one used by javac.) I've checked that the JIT warnings are gone and that the method can be compiled again.
| * | | | | | | SD-225 Use a "lzycompute" method for module initializationJason Zaugg2016-09-142-3/+10
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The monitors and module instantation were inliuned into the module accessor method in b2e0911. However, this seems to have had a detrimental impact on performance. This might be because the module accessors are now above the "always inline" HotSpot threshold of 35 bytes, or perhaps because they contain monitor-entry/exit and exception handlers. This commit returns to the the 2.11.8 appraoch of factoring the the second check of the doublecheck locking into a method. I've done this by declaring a nested method within the accessor; this will be lifted out to the class level by lambdalift. This represents a slight deviation from the implementation strategy used for lazy accessors, which create a symbol for the slowpath method in the info transform and generate the corresponding DefDef as a class member. I don't believe this deviation is particular worrisome, though. I have bootstrapped the compiler through this commit and found that the drastic regression in compiling the shapeless test suite is solved.
* / | | | | | SI-9936 SeqLike.indexWhere starts at zeroSom Snytt2016-09-261-0/+19
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows the Scaladoc, and makes ``` "abcdef".indexOf('c', -1) ``` work like ``` "abcdef".toVector.indexOf('c', -1) ```
* | | | | | SD-143 allow super calls to methods defined in indirect super classesJason Zaugg2016-09-051-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The restriction for super calls to methods defined in indirect super classes introduced in a980fde was over-restrictive. In particular, it ruled out a valid code pattern to select a method from a superclass when an unqualified `super` would resolve to an override defined in a trait (example in the commit as a test).
* | | | | | Merge pull request #5369 from lrytz/sd210Lukas Rytz2016-09-022-8/+93
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes to mixin forwarders
| * | | | | | Add a -Xmixin-force-forwarders ChoiceSettingLukas Rytz2016-09-021-4/+4
| | | | | | |
| * | | | | | SD-143 error for super calls that cannot be implemented correctlyLukas Rytz2016-09-011-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a call super[T].m resolves to a method A.m where A is a class, but not the direct superclass of the current class, there is no way to emit an invocation of A.m: `invokespecial A.m` will resolve to B.m where B is the superclass of the current class. This commit adds an error message in this case. Note that this is similar to an existing error message for qualified super calls to a non-direct superclass: class A { def m = 1 } class B extends A { override def m = 2 } class C extends B { override def m = super[A].m } Gives "error: A does not name a parent class of class C". If the user means to call method m in the superclass, he can write an unqualified `super.m`. An similar error message is introduced if A is a Java-defined interface (and m is a default method), and A is not a direct parent of the current class. In this case `invokespecial A.m` is invalid bytecode. The solution is to add A as a direct parent of the current class.