summaryrefslogtreecommitdiff
path: root/test/files/jvm
Commit message (Collapse)AuthorAgeFilesLines
...
| * Make two tests work under -Ydelambdafy:methodJason Zaugg2015-05-264-61/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, in 029cce7, I changed uncurry to selectively fallback to the old method of emitting lambdas when we detect that `-Ydelambdafy:method`. The change in classfile names breaks the expectations of the test `innerClassAttribute`. This commit changes that test to avoid using specialized functions, so that under -Ydelambdafy:method all functions are uniform. This changes a few fresh suffixes for anonymous class names under both `-Ydelambdafy:{inline,method}`, so the expectations have been duly updated. Similarly, I have changed `javaReflection` in the same manner. Its checkfiles remained unchanged.
| * Fix several tests under GenBCodeLukas Rytz2015-05-265-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - private-inline, t8601-closure-elim, inline-in-constructors - test closure inlining / elimination, which is not yet implemented in GenBCode. noted in https://github.com/scala-opt/scala/issues/14. - constant-optimization, t7006 - no constant folding in GenBCode yet. noted in https://github.com/scala-opt/scala/issues/29. - patmat_opt_ignore_underscore, patmat_opt_no_nullcheck, patmat_opt_primitive_typetest - not all optimizations in GenBCode yet. noted in https://github.com/scala-opt/scala/issues/30. - t3234 - tests a warning of trait inlining - trait inlining works in GenBCode - synchronized - ignore inliner warnings (they changed a bit) - t6102 - account for the changed outputo of -Ydebug has under GenBCode
* | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-05-012-3/+3
|\| | | | | | | merge/2.11.x-to-2.12.x-20150501
| * Fix many typosMichał Pociecha2015-04-212-3/+3
| | | | | | | | | | This commit corrects many typos found in scaladocs and comments. There's also fixed the name of a private method in ICodeCheckers.
* | Remove scala.actors and the actors migration module dependencyLukas Rytz2015-04-2376-2269/+0
| |
* | Merge pull request #4436 from adriaanm/rebase-4082Adriaan Moors2015-04-131-0/+43
|\ \ | | | | | | SI-8336: add `fold` & `toEither` to `util.Try`
| * | SI-8336: add `fold` & `toEither` to `util.Try`cchantep2015-04-071-0/+43
| | | | | | | | | | | | | | | | | | | | | `res.fold(fa, fb)` evaluates to `fa(e)` if `res` is a `Failure(e)`, or `fb(value)` if `res` is a `Success(value)`. (If `fb` throws an exception `e` when applied, `fa(e)`.)
* | | Merge commit '32f520f' into merge/2.11-to-2.12-apr-1Lukas Rytz2015-04-011-2/+7
|\ \ \ | | |/ | |/|
| * | SI-8689 Make a Future test case determisticJason Zaugg2015-03-311-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed: https://groups.google.com/forum/#!topic/scala-internals/m8I_3GQR4vQ We need to ensure a happens-before relationship between the callback that prints "success" and the end of the main method.
* | | Merge commit 'fcc20fe' into merge/2.11-to-2.12-apr-1Lukas Rytz2015-04-0112-37/+566
|\| | | |/ |/|
| * Merge commit 'ad845ff' into merge/2.10.x-to-2.11.x-20150224Jason Zaugg2015-02-243-8/+81
| |\ | | | | | | | | | | | | | | | Conflicts: src/library/scala/concurrent/Promise.scala test/files/jvm/future-spec/PromiseTests.scala
| | * SI-8689 Avoid internal error in Promise after sequence of completionsViktor Klang2015-02-043-9/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling `completeWith` when the `DefaultPromise` is already completed, leads to callbacks not being properly executed. This happened because `Future.InternalCallbackExecutor` extends `BatchingExecutor`[1] which assumes `unbatchedExecute` to be async, when in this case it is sync, and if there is an exception thrown by executing the batch, it creates a new batch with the remaining items from the current batch and submits that to `unbatchedExecute` and then rethrows, but if you have a sync `unbatchedExecute`, it will fail since it is not reentrant, as witnessed by the failed `require` as reported in this issue. This commit avoids problem by delegating `completeWith` to `tryComplete`, which has the effect of using `onComplete` + `tryComplete` i.s.o. `complete`, which means that when it fails (because of a benign race condition between completers) it won't throw an exception. It has been tested by the minimized reproducer. [1] Actually, in the 2.10.x branch where this patch is starting out, "The BatchingExecutor trait had to be inlined into InternalCallbackExecutor for binary compatibility.". This comment will be more literally correct in the context of 2.11.x and beyond
| * | Test java reflection on scala library / reflect / compiler jarsLukas Rytz2015-02-071-0/+65
| | | | | | | | | | | | | | | | | | | | | Run a number of Java reflection operations on all classes in scala library / reflect / compiler. The test is based on a draft by Jason.
| * | Fix InnerClass / EnclosingMethod for closures nested in value classesLukas Rytz2015-02-074-13/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members of value classes are moved over to the companion object early. This change ensures that closure classes nested in value classes appear that way to Java reflection. This commit also changes the EnclosingMethod attribute for classes (and anonymous functions) nested in anonymous function bodies. Before, the enclosing method was in some cases the function's apply method. Not always though: () => { class C ... val a = { class D ...} } The class C used to be nested in the function's apply method, but not D, because the value definition for a was lifted out of the apply. After this commit, we uniformly set the enclosing method of classes nested in function bodies to `null`. This is consistent with the source-level view of the code. Note that under delambdafy:method, closures never appear as enclosing classes (this didn't change in this commit).
| * | Fix InnerClass/EnclosingMethod for trait impl and specialized classesLukas Rytz2015-02-072-2/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trait implementation classes and specialized classes are always considered top-level in terms of the InnerClass / EnclosingMethod attributes. These attributes describe source-level properties, and such classes are a compilation artifact. Note that the same is true for delambdafy:method closure classes (they are always top-level).
| * | SI-9124 fix EnclosingMethod of classes nested in implOnly trait defsLukas Rytz2015-02-072-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private trait methods are not added to the generated interface, they end up only in the implementation class. For classes nested in such methods, the EnclosingMethod attribute was incorrect. Since the EnclosingMethod attribute expresses a source-level property, but the actual enclosing method does not exist in the bytecode, we set the enclosing method to null.
| * | SI-9105 Fix EnclosingMethod for classes defined in lambdasLukas Rytz2015-02-075-19/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes both GenASM and GenBCode, except for the change to renaming in LamdaLift mentioned below. The reason for an inconsistent EnclosingMethod attribute was the symbol owner chain. Initially, closure class symbols don't exist, they are only created in UnCurry (delambdafy:inline). So walking the originalOwner of a definition does not yield closure classes. The commit also fixes uses of isAnonymousClass, isAnonymousFunction and isDelambdafyFunction in two ways: 1. by phase-travelling to an early phase. after flatten, the name includes the name of outer classes, so the properties may become accidentally true (they check for a substring in the name) 2. by ensuring that the (destructive) renames during LambdaLift don't make the above properties accidentally true. This was in fact the cause for SI-8900.
| * | Merge pull request #4233 from kanielc/SI-7770Lukas Rytz2015-02-032-2/+2
| |\ \ | | | | | | | | SI-7770 mutable.BitSet.toImmutable isn't immutable
| | * | SI-7770 mutable.BitSet.toImmutable isn't immutableDenton Cockburn2015-01-072-2/+2
| | | | | | | | | | | | | | | | | | | | Mark method as deprecated due to it not providing the expected result, while fixing it will break existing code.
* | | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2015-01-294-20/+25
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20150129 Conflicts: build.number src/library/scala/concurrent/Future.scala versions.properties
| * | | Construct ClassBTypes from parsed classfilesLukas Rytz2015-01-163-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This infrastructure is required for the inliner: when inlining code from a classfile, the corresponding ClassBType is needed for various things (eg access checks, InnerClass attribute). The test creates two ClassBTypes for the same class: once using the (unpickled) Symbol, once using the parsed ASM ClassNode, and verifies that the two are the same. There's a cleanup to the InnerClass attribute: object T { class Member; def foo = { class Local } } class T For Java compatibility the InnerClass entry for Member says the class is nested in T (not in the module class T$). We now make sure to add that entry only to T, not to T$ (unless Member is actually referenced in the classfile T$, in that case it will be added, as required).
| * | | SI-9044 Fix order of interfaces in classfilesLukas Rytz2014-12-181-0/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | It was reversed since ced3ca8ae1. The reason is that the backend used `mixinClasses` to obtain the parents of a class, which returns them in linearization order. `mixinClasses` als returns all ancestors (not only direct parents), which means more work for `minimizeInterfaces`. This was introduced in cd62f52 for unclear reasons. So we switch back to using `parents`.
* | | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-292-5/+5
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * | Fix lambda names under delambdafy:method in innerClassAttribute testLukas Rytz2014-10-101-3/+3
| | | | | | | | | | | | This should have been done in 63207e1
| * | Update check files for -Ydelambdafy:methodLukas Rytz2014-10-101-2/+2
| | | | | | | | | | | | Should have been done in 63207e1.
* | | Add missing canonical combinators:Viktor Klang2014-10-205-2/+400
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `def transform[S](f: Try[T] => Try[S])(implicit executor: ExecutionContext): Future[S]` - `def transformWith[S](f: Try[T] => Future[S])(implicit executor: ExecutionContext): Future[S]` - `def flatten[S](implicit ev: T <:< Future[S]): Future[S]` - `def zipWith[U, R](that: Future[U])(f: (T, U) => R)(implicit executor: ExecutionContext): Future[R]` Add missing utilities: - `val unit: Future[Unit]` in `object Future` - `object never extends Future[Nothing]` in `object Future` - `def defaultBlockContext: BlockContext` in `object BlockContext` - `def toString: String` on stdlib implementations of `Future` Refactors: - the `scala.concurrent.Future` trait to not explicit create any `Promises`, so that implementations can control implementation type, this is mainly facilitated through adding of the `transform` and `transformWith` methods. - the implementation of `ExecutionContextImpl` has been cleaned up - the `scala.concurrent.impl.DefaultPromise` has been reimplemented to not use `sun.misc.Unsafe` Securing: - Add a self-check in `completeWith` and `tryCompleteWith` to avoid cycles in trait Promise - Capping the maximum number of threads for the global `ExecutionContext` to the max parallelism - Implementing (almost) all `Future` combinators on `transformWith` and `transform` means that `DefaultPromise` linking works on both `(flat)map` and `recover(With)` - Nested `blocking {}` should not spawn extra threads beyond the first. Removes: - the private `internalExecutor` method in favor of an import in trait `Future` - the private `internalExecutor` method in favor of an import in trait `Promise` - the `AtomicReferenceFieldUpdater` in `AbstractPromise` since we're using `Unsafe` - `scala.concurrent.impl.Future` is no longer needed Deprecates: - `Future.onSuccess` - discourage the use of callbacks (and is also redundant considering `foreach` and `onComplete`) - `Future.onFailure` - discourage the use of callbacks (and is also redundant considering `onComplete` and `failed.foreach`) - `ExecutionContext.prepare` - it was ill specced and it is too easy to forget to call it (or even know when to call it or call it more times than needed) - All classes in scala.concurrent.forkjoin. Scala 2.12 will be Java 8+ and as such the jsr166e should be used as included in java.util.concurrent. Reimplements: - `failed` - in terms of `transform` - `map` - in terms of `transform` - `flatMap` - in terms of `transformWith` - `recover` - in terms of `transform` - `recoverWith` - in terms of `transformWith` - `zip` - in terms of `flatMap` + `map` - `fallbackTo` - in terms of `recoverWith` + `recoverWith` - `andThen` - in terms of `transform` Miscellaneous: - Giving the threads of `ExecutionContext.global` sensible names - Optimizes `object Future.successful` and `object Future.failed` are now separate implementations, to optimize for the result, avoiding doing work for the "other branch". - Optimizes `compressedRoot()` by avoiding double-calls to volatile get. Documentation: - Almost all methods on `Future` and `Promise` have been revisited and had their ScalaDoc updated Tests: - Yes
* | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2014-09-173-6/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/2.11.x-to-2.12.x-20140917 Conflicts: build.xml The merge conflict was centred around the introduction of the build property `test.bc.skip`, and was straight forward to resolve.
| * | SI-8568 unreachable test now passes in GenBCodeLukas Rytz2014-09-101-1/+0
| | |
| * | JUnit tests for dead code elimination.Lukas Rytz2014-09-102-5/+5
| | | | | | | | | | | | JUnit tests may use tools from partest-extras (ASMConverters)
* | | Merge commit 'abd595d' into merge/2.11.x-to-2.12.x-20140915Jason Zaugg2014-09-161-1/+3
|\| |
| * | SI-8786 disable part of test that's failing the jdk8 buildLukas Rytz2014-09-041-1/+3
| | |
* | | Merge branch 'merge/2.10-to-2.11-sept-2' into ↵Lukas Rytz2014-09-027-39/+815
|\| | | | | | | | | | | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer Conflicts: versions.properties
| * | Fix InnerClass / EnclosingMethod attributesLukas Rytz2014-09-017-39/+815
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit seems bigger than it is. Most of it is tests, and moving some code around. The actual changes are small, but a bit subtle. The InnerClass and EnclosingMethod attributes should now be close to the JVM spec (which is summarized in BTypes.scala). New tests make sure that changes to these attributes, and changes to the way Java reflection sees Scala classfiles, don't go unnoticed. A new file, BCodeAsmCommon, holds code that's shared between the two backend (it could hold more, future work). In general, the difficulty with emitting InnerClass / EnclosingMethod is that we need to find out source-level properties. We need to make sure to do enough phase-travelling, and work around destructive changes to the ownerchain in lambdalift (we use originalOwner a lot). The change to JavaMirrors is prompted by the change to the EnclosingMethod attribute, which changes Java reflection's answer to getEnclosingMethod and getEnclosingConstructor. Classes defined in field initializers no longer have an enclosing method, just an enclosing class, which broke an assumption in JavaMirrors. There's one change in erasure. Before this change, when an object declaration implements / overrides a method, and a bridge is required, then the bridge method was actually a ModuleSymbol (it would get the lateMETHOD flag and be emitted as a method anyway). This is confusing, when iterating through the members of a class, you can find two modules with the same name, and one of them doesn't have a module class. Now, such bridge methods will be MethodSymbols. Removed Symbol.originalEnclosingMethod, that is a backend thing and doesn't need to live in the symbol API.
* | | Merge commit '47908f1' into ↵Lukas Rytz2014-09-026-3/+313
|\| | | | | | | | | | | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer Conflicts: src/library/scala/util/matching/Regex.scala
| * | Merge pull request #3927 from lrytz/innerClassesTestLukas Rytz2014-08-123-0/+310
| |\ \ | | | | | | | | test for InnerClass and EnclosingMethod attributes
| | * | test for InnerClass and EnclosingMethod attributesLukas Rytz2014-08-123-0/+310
| | | | | | | | | | | | | | | | | | | | | | | | Some parts of the test assert (current) buggy behavior. This is marked in the test file with TODO. It will be fixed in later work on the backend.
| * | | SI-4563 friendlier behavior for Ctrl+D in the REPLAntoine Gourlay2014-07-293-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closing the REPL with Ctrl+D does not issue a newline, so the user's prompt displays on the same line as the `scala>` prompt. This is bad. We now force a newline before closing the interpreter, and display `:quit` while we're at it so that people know how to exit the REPL (since `exit` doesn't exist anymore). The tricky part was to only add a newline when the console is interrupted, and *not* when it is closed by a command (like `:quit`), since commands are processed after their text (including newline) has been sent to the console.
* | | Merge commit '01f2d27' into ↵Lukas Rytz2014-09-023-2/+4
|\| | | | | | | | | | | merge/2.11-to-2.12-is-it-really-sept-2-already-where-was-summer
| * | SI-8743 Fix crasher with poly-methods annotated with @varargsJason Zaugg2014-07-233-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code that generated the Java varargs forwarder was basing things on the `ValDef-s` of the parameters of the source method. But, their types refer to a type parameter skolems of the enclosing method, which led to a type mismatch when typechecking the forwarder. Instead, I've reworked the code to simply use the `DefDef`-s symbol's info, which *doesn't* refer to skolems. This actually simplifies the surrounding code somewhat; rather than repeated symbols in a map we can just time travel the pre-uncurry method signatures to figure out which params are releated.
* | | Merge remote-tracking branch 'origin/2.11.x' into ↵Jason Zaugg2014-07-143-3/+3
|\| | | | | | | | | | | merge/2.11.x-to-2.12.x-20140714
| * | Merge pull request #3866 from Blaisorblade/issue/8677-backportLukas Rytz2014-07-091-0/+5
| |\ \ | | | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| | * | [backport] SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-07-041-0/+5
| | | | | | | | | | | | | | | | | | | | Fixes #8677. Add basic tests. This is a backport from 2.12.x of dead39dc5f21c6eac41788e93426c50ddd398c24.
| * | | Use countElementsAsString for summarized warnings.Adriaan Moors2014-07-043-3/+3
| |/ /
* | | Merge pull request #3843 from Blaisorblade/topic/fix-minus-infAdriaan Moors2014-07-031-0/+5
|\ \ \ | | | | | | | | SI-8677 Duration: Zero - Inf should be MinusInf
| * | | SI-8677 Duration: Zero - Inf should be MinusInfPaolo G. Giarrusso2014-06-281-0/+5
| | | | | | | | | | | | | | | | Fixes #8677. Add basic tests.
* | | | Merge remote-tracking branch 'origin/2.11.x' into merge/2.11.x-2.12.x-20140627Jason Zaugg2014-06-275-6/+6
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | SI-8185 Correct grammar for single-warning compilation runFrançois Garillot2014-05-145-6/+6
| | |
* | | Merge branch '2.11.x' into 2.12.xLukas Rytz2014-05-226-0/+161
|\| |
| * | Move t8582 to test/files/jvmLukas Rytz2014-05-132-0/+125
| | |
| * | Fix BeanInfo generation for GenBCodeLukas Rytz2014-05-133-0/+32
|/ /