summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | Address review feedbackLukas Rytz2015-05-254-69/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address feedback in #4516 / 57b8da4cd8. Save allocations of NullnessValue - there's only 4 possible instances. Also save tuple allocations in InstructionStackEffect.
| * | | | | | Fix wrong result in InstructionStackEffect for ATHROW, RETURNLukas Rytz2015-05-251-3/+3
| | | | | | |
| * | | | | | Fix wrong indexing in FrameExtensions.peekStackLukas Rytz2015-05-251-1/+1
| | | | | | |
| * | | | | | Enable nullness analysis in the inlinerLukas Rytz2015-05-255-15/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When inlining an instance call, the inliner has to ensure that a NPE is still thrown if the receiver object is null. By using the nullness analysis, we can avoid emitting this code in case the receiver object is known to be not-null.
| * | | | | | Nullness AnalysisLukas Rytz2015-05-228-8/+1237
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracks nullness of values using an ASM analyzer. Tracking nullness requires alias tracking for local variables and stack values. For example, after an instance call, local variables that point to the same object as the receiver are treated not-null.
* | | | | | Merge pull request #4537 from som-snytt/issue/xml-unapplyJason Zaugg2015-06-043-21/+17
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-9343 Xlint less strict on pattern sequences
| * | | | | SI-9343 Xlint less strict on pattern sequencesSom Snytt2015-06-033-21/+17
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Xlint:stars-align warns only if elementarity > 0, that is, if an extracted sequence is not matched entirely by a pattern sequence, that is, in SLS 8.1.9 on pattern sequences, n = 1 and that pattern is a pattern sequence. This is still only triggered if productarity > 0, that is, a non-pattern-sequence pattern is required for the match. This is a sensitive area because it borders on exhaustiveness checking: it would be preferable to verify just that the match is exhaustive, and to emit this warning only if it is not.
* | | | | Merge pull request #4511 from sriggin/SI-9322Lukas Rytz2015-05-282-3/+3
|\ \ \ \ \ | | | | | | | | | | | | SI-9322 Elapsed times in compiler calculated with System.currentTimeMillis and System.nanoTime
| * | | | | SI-9322 Elapsed times in compiler calculated withSean Riggin2015-05-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System.currentTimeMillis and System.nanoTime Reverted elapsedTime calculation in compiler to use System.currentTimeMillis, consistent with the start time.
* | | | | | Merge pull request #4528 from xuwei-k/patch-2Lukas Rytz2015-05-281-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | fix typo
| * | | | | | fix typokenji yoshida2015-05-281-1/+1
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #4530 from som-snytt/issue/9332Lukas Rytz2015-05-282-20/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-9332 Iterator.span exhausts leading iterator
| * | | | | | SI-9332 Iterator.span simplifiedSom Snytt2015-05-271-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The queue is only used when the prefix is drained by finish. Since a finished flag has been introduced, distinguish between the drained state and using the underlying (buffered) iterator.
| * | | | | | SI-9332 Iterator.span exhausts leading iteratorSom Snytt2015-05-272-17/+22
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the leading and trailing iterators returned by span share the underlying iterator, the leading iterator must flag when it is exhausted (when the span predicate fails) since the trailing iterator will advance the underlying iterator. It would also be possible to leave the failing element in the leading lookahead buffer, where it would forever fail the predicate, but that entails evaluating the predicate twice, on both enqueue and dequeue.
* | | | | | Merge pull request #4531 from kzys/8210-inherited-doc-211Lukas Rytz2015-05-283-3/+28
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8210 Scaladoc: Fix the false negative @inheritdoc warning on accessors
| * | | | | | SI-8210 Scaladoc: Fix the false negative @inheritdoc warning on accessorsKato Kazuyoshi2015-05-273-3/+28
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | This fix is just for the false negative warning. Probably we can skip setters entirely, but I'm not 100% sure.
* | | | | | Merge pull request #4532 from kzys/9144-posix-211Lukas Rytz2015-05-281-0/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-9144 Scaladoc: Make generated HTML files POSIX-compatible text files
| * | | | | SI-9144 Scaladoc: Make generated HTML files POSIX-compatible text filesKato Kazuyoshi2015-05-271-0/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According POSIX, every text file contains characters organized into zero or more lines [1], and every line must be terminated by "\n" [2]. This change makes Scaladoc's HTML files POSIX-compatible text files. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_397 [2] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
* | | | | Merge pull request #4524 from lrytz/BCodeDelambdafyFixesLukas Rytz2015-05-2716-75/+83
|\ \ \ \ \ | | | | | | | | | | | | Fix several tests under GenBCode
| * | | | | 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-2612-14/+17
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* | | | | Update README.mdAdriaan Moors2015-05-261-4/+10
| | | | |
* | | | | Merge pull request #4515 from sschaef/fix-grammar-errorJason Zaugg2015-05-261-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Fix small grammar error in `Warnings`
| * | | | | Fix small grammar error in `Warnings`Simon Schäfer2015-05-221-1/+1
| |/ / / /
* | | | | Merge pull request #4520 from xuwei-k/patch-1Jason Zaugg2015-05-261-1/+1
|\ \ \ \ \ | | | | | | | | | | | | fix typo
| * | | | | fix typokenji yoshida2015-05-251-1/+1
| |/ / / /
* | | | | Merge pull request #4512 from retronym/ticket/9321Jason Zaugg2015-05-262-4/+13
|\ \ \ \ \ | |/ / / / |/| | | | SI-9321 Clarify spec for inheritance of qualified private
| * | | | SI-9321 Clarify spec for inheritance of qualified privateJason Zaugg2015-05-222-4/+13
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I checked the intent with Martin, who said: > [...] qualified private members are inherited like other members, > it’s just that their access is restricted. I've locked this in with a test as well.
* | | | Merge pull request #4513 from retronym/topic/indylambda-bump-compatLukas Rytz2015-05-221-1/+1
|\ \ \ \ | | | | | | | | | | Update to scala-java8-compat 0.5.0
| * | | | Update to scala-java8-compat 0.5.0Jason Zaugg2015-05-221-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains LambdaDeserializer, which we refer to in our synthetic `$deserializeLambda$` method under -target:jvm-1.8. Note: this library is only reference in the Ant build under a non-standard build flag that includes that library into scala-library.jar. This is only for our internal use in running partest for indylambda. The SBT build doesn't have the same option at the moment.
* | | | Merge pull request #4477 from retronym/ticket/9286Adriaan Moors2015-05-217-2/+54
|\ \ \ \ | | | | | | | | | | SI-9286 Check subclass privates for "same type after erasure"
| * | | | SI-9286 Check subclass privates for "same type after erasure"Jason Zaugg2015-05-187-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The overriding pairs cursor used to detect erased signature clashes was turning a blind eye to any pair that contained a private method. However, this could lead to a `VerifyError` or `IllegalAccessError`. Checking against javac's behaviour in both directions: ``` % cat sandbox/Test.java public abstract class Test { class C { int foo() { return 0; } } class D extends C { private <A> int foo() { return 1; } } } % javac sandbox/Test.java sandbox/Test.java:3: error: name clash: <A>foo() in Test.D and foo() in Test.C have the same erasure, yet neither overrides the other class D extends C { private <A> int foo() { return 1; } } ^ where A is a type-variable: A extends Object declared in method <A>foo() 1 error ``` ``` % cat sandbox/Test.java public abstract class Test { class C { private int foo() { return 0; } } class D extends C { <A> int foo() { return 1; } } } % javac sandbox/Test.java % ``` This commit only the exludes private symbols from the superclass from the checks by moving the test from `excludes` to `matches`.
* | | | | Merge pull request #4501 from retronym/topic/indylambda-serializationAdriaan Moors2015-05-2111-22/+179
|\ \ \ \ \ | |_|/ / / |/| | | | [indylambda] Support lambda {de}serialization
| * | | | [indylambda] Enable caching for lambda deserializationJason Zaugg2015-05-186-8/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We add a static field to each class that defines lambdas that will hold a `ju.Map[String, MethodHandle]` to cache references to the constructors of the classes originally created by `LambdaMetafactory`. The cache is initially null, and created on the first deserialization. In case of a race between two threads deserializing the first lambda hosted by a class, the last one to finish will clobber the one-element cache of the first. This lack of strong guarantees mirrors the current policy in `LambdaDeserializer`. We should consider whether to strengthen the combinaed guarantee here. A useful benchmark would be those of the invokedynamic instruction, which allows multiple threads to call the boostrap method in parallel, but guarantees that if that happens, the results of all but one will be discarded: > If several threads simultaneously execute the bootstrap method for > the same dynamic call site, the Java Virtual Machine must choose > one returned call site object and install it visibly to all threads. We could meet this guarantee easily, albeit excessively, by synchronizing `$deserializeLambda$`. But a more fine grained approach is possible and desirable. A test is included that shows we are able to garbage collect classloaders of classes that have hosted lambda deserialization.
| * | | | [indylambda] Support lambda {de}serializationJason Zaugg2015-05-179-22/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support serialization, we use the alternative lambda metafactory that lets us specify that our anonymous functions should extend the marker interface `scala.Serializable`. They will also have a `writeObject` method added that implements the serialization proxy pattern using `j.l.invoke.SerializedLamba`. To support deserialization, we synthesize a `$deserializeLamba$` method in each class with lambdas. This will be called reflectively by `SerializedLambda#readResolve`. This method in turn delegates to `LambdaDeserializer`, currently defined [1] in `scala-java8-compat`, that uses `LambdaMetafactory` to spin up the anonymous class and instantiate it with the deserialized environment. Note: `LambdaDeserializer` can reuses the anonymous class on subsequent deserializations of a given lambda, in the same spirit as an invokedynamic call site only spins up the class on the first time it is run. But first we'll need to host a cache in a static field of each lambda hosting class. This is noted as a TODO and a failing test, and will be updated in the next commit. `LambdaDeserializer` will be moved into our standard library in the 2.12.x branch, where we can introduce dependencies on the Java 8 standard library. The enclosed test cases must be manually run with indylambda enabled. Once we enable indylambda by default on 2.12.x, the test will actually test the new feature. ``` % echo $INDYLAMBDA -Ydelambdafy:method -Ybackend:GenBCode -target:jvm-1.8 -classpath .:scala-java8-compat_2.11-0.5.0-SNAPSHOT.jar % qscala $INDYLAMBDA -e "println((() => 42).getClass)" class Main$$anon$1$$Lambda$1/1183231938 % qscala $INDYLAMBDA -e "assert(classOf[scala.Serializable].isInstance(() => 42))" % qscalac $INDYLAMBDA test/files/run/lambda-serialization.scala && qscala $INDYLAMBDA Test ``` This commit contains a few minor refactorings to the code that generates the invokedynamic instruction to use more meaningful names and to reuse Java signature generation code in ASM rather than the DIY approach. [1] https://github.com/scala/scala-java8-compat/pull/37
* | | | | Merge pull request #4508 from retronym/topic/uncurry-specializedLukas Rytz2015-05-201-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Avoid inefficient specialied lambdas w. delambdafy jvm-1.8, GenASM
| * | | | | Avoid inefficient specialied lambdas w. delambdafy jvm-1.8, GenASMJason Zaugg2015-05-201-1/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A previous change disabled -Ydelambdafy:method for specialized lambdas, as `DelambdafyTransformer` made no attempt to emit the requisite machinery to avoid boxing. This was loosened to allow them under `-target:jvm-1.8`, in the knowledge that `indylambda` would do the right thing. However, this wasn't quite right: indylambda is only supported in `GenBCode`, so we should consider that setting as well.
* | | | | Merge pull request #4509 from retronym/topic/manLukas Rytz2015-05-201-2/+3
|\ \ \ \ \ | | | | | | | | | | | | Document -target:jvm-1.8 in the man page
| * | | | | Document -target:jvm-1.8 in the man pageJason Zaugg2015-05-201-2/+3
| |/ / / / | | | | | | | | | | | | | | | We neglected to do this earlier.
* | | | | Merge pull request #4506 from scala/readme-gitJason Zaugg2015-05-201-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | Update README.md
| * | | | Update README.mdJason Zaugg2015-05-191-1/+1
|/ / / /
* | | | Merge pull request #4497 from retronym/topic/indylambda-diy-boxingJason Zaugg2015-05-167-32/+158
|\| | | | | | | | | | | [indylambda] Relieve LambdaMetafactory of boxing duties [ci: last-only]
| * | | [indylambda] Relieve LambdaMetafactory of boxing dutiesJason Zaugg2015-05-156-31/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `LambdaMetafactory` generates code to perform a limited number of type adaptations when delegating from its implementation of the functional interface method to the lambda target method. These adaptations are: numeric widening, casting, boxing and unboxing. However, the semantics of unboxing numerics in Java differs to Scala: they treat `UNBOX(null)` as cause to raise a `NullPointerException`, Scala (in `BoxesRuntime.unboxTo{Byte,Short,...}`) reinterprets the null as zero. Furthermore, Java has no idea how to adapt between a value class and its wrapped type, nor from a void return to `BoxedUnit`. This commit detects when the lambda target method would require such adaptation. If it does, an extra method, `$anonfun$1$adapted` is created to perform the adaptation, and this is used as the target of the lambda. This obviates the use of `JProcedureN` for `Unit` returning lambdas, we know use `JFunctionN` as the functional interface and bind this to an `$adapted` method that summons the instance of `BoxedUnit` after calling the `void` returning lambda target. The enclosed test cases fail without boxing changes. They don't execute with indylambda enabled under regular partest runs yet, you need to add scala-java8-compat to scala-library and pass the SCALAC_OPTS to partest manually to try this out, as described in https://github.com/scala/scala/pull/4463. Once we enable indylambda by default, however, this test will exercise the code in this patch all the time. It is also possible to run the tests with: ``` % curl https://oss.sonatype.org/content/repositories/releases/org/scala-lang/modules/scala-java8-compat_2.11/0.4.0/scala-java8-compat_2.11-0.4.0.jar > scala-java8-compat_2.11-0.4.0.jar % export INDYLAMBDA="-Ydelambdafy:method -Ybackend:GenBCode -target:jvm-1.8 -classpath .:scala-java8-compat_2.11-0.4.0.jar" qscalac $INDYLAMBDA test/files/run/indylambda-boxing/*.scala && qscala $INDYLAMBDA Test ```
| * | | Update to scala-java8-compat 0.4.0Jason Zaugg2015-05-111-1/+1
| | | |
* | | | Merge pull request #4502 from cneijenhuis/documentation/try-example-deprecatedAdriaan Moors2015-05-151-2/+3
|\ \ \ \ | | | | | | | | | | Fixed deprecation warning in scaladoc example of Try
| * | | | Fixed deprecation warning in scaladoc example of TryChristoph Neijenhuis2015-05-151-2/+3
| |/ / /
* | | | Merge pull request #4499 from lrytz/removeAsmLukas Rytz2015-05-1295-31833/+92
|\ \ \ \ | |/ / / |/| | | Move ASM out of the repository [ci: last-only]
| * | | Remove ASM sourcesLukas Rytz2015-05-1184-31804/+0
| | | |
| * | | intellij project files for ASM removalLukas Rytz2015-05-117-8/+15
| | | | | | | | | | | | | | | | ij fix
| * | | Inlcude ASM as a dependency in sbt buildLukas Rytz2015-05-111-9/+57
| | | |