summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #4463 from retronym/topic/indylambda-emit-indyLukas Rytz2015-05-049-23/+186
|\ | | | | Use LambdaMetafactory where possible for lambda creation.
| * Small refactorings and additional comments in DelambdafyJason Zaugg2015-04-221-46/+54
| |
| * Update internal documentation in Delambdafy phaseJason Zaugg2015-04-221-5/+12
| |
| * Support specialized method-handle based lambdasJason Zaugg2015-04-213-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` scala> (x: Int) => {??? : Int} res2: Int => Int = $$Lambda$1371/1961176822@6ed3ccb2 scala> res2(42) scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) at .$anonfun$1(<console>:8) at $$Lambda$1371/1961176822.apply$mcII$sp(Unknown Source) ... 33 elided scala> (x: Int, y: Long) => {??? : Int} res4: (Int, Long) => Int = $$Lambda$1382/1796047085@6f8e8894 scala> res4(0, 0L) scala.NotImplementedError: an implementation is missing at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225) at .$anonfun$1(<console>:8) at $$Lambda$1382/1796047085.apply$mcIIJ$sp(Unknown Source) ... 33 elided ```
| * Add scala-java8-compat to scala-library.jarJason Zaugg2015-04-211-0/+38
| | | | | | | | | | | | | | | | | | | | | | When the ant build is run with `-Dscala-java8-compat.package`, the contents of `org.scala-lang.modules:scala-java8-compat` are spliced into `scala-library.jar`. This is handy to facilitate downstream testing of indy lambdas, we can just use the the compiler options `-target 1.8 -Ydelambdafy:method -Xexperimental` without needed to add `scala-java8-compat.jar` to the compile and runtime classpaths. (Classpath augmentation doesn't appear to be straight forward in partest or in the community build.)
| * SI-8359 Update a test to work with indylambdaJason Zaugg2015-04-211-0/+1
| |
| * SI-8359 Emit invokedynamic for lambdasJason Zaugg2015-04-215-12/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suitable lambdas are identified in Delambdafy and marked with such with a tree annotation that includes the data needed by the backend to emit an invokedynamic instruction. GenBCode to rewrite instantiation of such anonymous function classes with an invokedynamic instruction. At this stage, I don't plan to merge the support for this into GenASM. Between these points, the lambda capture is represented as an application of a dummy factory symbol: ``` <dummy>(captures...) : FunctionN ``` Demo: ``` % wget http://central.maven.org/maven2/org/scala-lang/modules/scala-java8-compat_2.11/0.3.0/scala-java8-compat_2.11-0.3.0.jar % qscala -classpath scala-java8-compat_2.11-0.3.0.jar -Ydelambdafy:method -target:jvm-1.8 -Ybackend:GenBCode Welcome to Scala version 2.11.6-20150309-144147-c91c978c81 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25). Type in expressions to have them evaluated. Type :help for more information. scala> (() => "").getClass res0: Class[_ <: () => String] = class $$Lambda$1/871790326 ``` I have also corrected an error in a previous commit. The newly added symbol test, `isDelambdafyTarget`, needs to check for the `ARTIFACT` flag, as that is what is added to the method by `Uncurry`.
* | Merge pull request #4470 from swaldman/correct-predef-assertion-docLukas Rytz2015-05-041-2/+2
|\ \ | | | | | | Fix documentation of assertions in Predef
| * | Fixed documentation of assertions in Predefswaldman2015-04-281-2/+2
| | | | | | | | | Assertions can be elided at compile time; they generate no runtime conditional code and are in fact run unconditionally if not elided during compilation. Updated documentation to reflect that.
* | | Merge pull request #4469 from retronym/ticket/9282Lukas Rytz2015-05-041-3/+5
|\ \ \ | | | | | | | | SI-9282 Avoid obscuring an exception during classfile parsing
| * | | SI-9282 Avoid obscuring an exception during classfile parsingJason Zaugg2015-04-271-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on analysis of a stack trace in this bug report, I identified a code path in `ClassfileParser` that can lead to an NPE in its exception handling code. If `val in = new AbstractFileReader(file)` throws (e.g during its construction in which it eagerly reads the file `val buf: Array[Byte] = file.toByteArray`), the call to `in.file` in `handleError` will NPE. This commit stores the active file directly a field in ClassfileParser and uses this in the error reporting.
* | | | Merge pull request #4473 from retronym/ticket/9285Lukas Rytz2015-05-043-1/+3
|\ \ \ \ | | | | | | | | | | SI-9285 Don't warn about non-sensible equals in synthetic methods
| * | | | SI-9285 Don't warn about non-sensible equals in synthetic methodsJason Zaugg2015-04-293-1/+3
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | Notably, in the synthetic equals method of a case class. Otherwise, we get an unsuppressable warning when defining a case class with a `Unit`-typed parameter, which some folks use a placeholder for real type while evolving a design.
* | | | Merge pull request #4487 from mpociecha/remove-unused-source-classLukas Rytz2015-05-041-127/+0
|\ \ \ \ | | | | | | | | | | Remove unused, mostly commented out doc/html/page/Source.scala
| * | | | Remove unused, mostly commented out doc/html/page/Source.scalaMichał Pociecha2015-05-021-127/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file seems to be some early, unfinished draft. It's unused and mostly commented out. De facto it hasn't been changed since this version: https://github.com/scala/scala/blob/d9e3dde6d6d18b9a93e7566447cc3ee342f033d5/src/compiler/scala/tools/nsc/doc/html/page/Source.scala Just in meantime someone updated imports, moved it to other package etc. but nothing more.
* | | | | Merge pull request #4488 from gbasler/topic/files-in-wrong-placeLukas Rytz2015-05-045-4/+2
|\ \ \ \ \ | | | | | | | | | | | | Cleanup files in wrong place
| * | | | | Avoid `Set` instantiation.Gerard Basler2015-05-031-2/+1
| | | | | |
| * | | | | Move test files to the right place.Gerard Basler2015-05-034-2/+1
| |/ / / /
* | | | | Merge pull request #4484 from lrytz/intellijLukas Rytz2015-05-0443-1057/+178
|\ \ \ \ \ | |/ / / / |/| | | | Update intellij project files for IDEA 14.1 and latest Scala plugin
| * | | | Update intellij project files for IDEA 14.1 and latest Scala pluginLukas Rytz2015-05-0143-1057/+178
| | | | | | | | | | | | | | | | | | | | | | | | | Removes the src/intellij-14 folder and moves everything back to src/intellij.
* | | | | Merge pull request #4485 from retronym/topic/pull-libs-redirectLukas Rytz2015-05-021-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Follow HTTP redirects when downloading bootstrap binaries
| * | | | | Follow HTTP redirects when downloading bootstrap binariesJason Zaugg2015-05-021-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | After a recent change to the repository that hosts these JARs, we now get a HTTP redirect to the new destination. We need to explicitly instruct curl to follow this.
* | | | | Merge pull request #4483 from adriaanm/uber-build-publish-zincAdriaan Moors2015-05-011-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | PR validation publishes zinc to $prRepoUrl
| * | | | PR validation publishes zinc to $prRepoUrlAdriaan Moors2015-05-011-1/+1
|/ / / / | | | | | | | | | | | | Companion to https://github.com/scala-ide/uber-build/pull/73
* | | | Merge pull request #4471 from smarter/spec/remove-NotNullAdriaan Moors2015-04-282-6/+1
|\ \ \ \ | |/ / / |/| | | spec: Remove obsolete rules related to scala.NotNull
| * | | spec: Remove obsolete rules related to scala.NotNullGuillaume Martres2015-04-282-6/+1
|/ / / | | | | | | | | | | | | These rules were removed in #2244 and scala.NotNull itself was deprecated.
* | | Merge pull request #4404 from soc/topic/specAdriaan Moors2015-04-2741-465/+1618
|\ \ \ | | | | | | | | Spec improvements
| * | | Spec improvementsSimon Ochsenreither2015-04-2541-465/+1618
| | | |
* | | | Merge pull request #4465 from retronym/ticket/9279Lukas Rytz2015-04-271-5/+5
|\ \ \ \ | |/ / / |/| | | SI-9279 Improve performance of bash runner script
| * | | SI-9279 Improve performance of bash runner scriptJason Zaugg2015-04-231-5/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In fbe897d16, the template for bash scripts (scala/scalac/etc) was modified to fix processing of `-J`, `-bootcp`. This involved looping through the argument array and filtering out options like `-bootcp` that only influence the script, and shouldn't be passed to the JVM. However, the mechanism to do this uses an inefficient, erm, "CanBuildFrom", and under the load of even a few hundred source files takes half a second before the JVM starts. Throw 2000 files at it, and you have to wait ten seconds! This commit uses a more efficient array append operator. This requires Bash 3 or above. Hopefully it is safe to presume this version these days, it's been around for a decade. Results: ``` % time ~/scala/2.11.6/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1 Unrecognized option: -NOJVM Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. real 0m7.765s user 0m7.734s sys 0m0.028s % time ./build/quick/bin/scalac -J-NOJVM abcdedfghijklmnopqrtsuvwxyv{1..2000} 2>&1 Unrecognized option: -NOJVM Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. real 0m0.144s user 0m0.124s sys 0m0.022s ``` Thanks to Stephan Schmidt for pointing out the performance gulf.
* | | Merge pull request #4415 from Ichoran/issue/9254Adriaan Moors2015-04-222-5/+32
|\ \ \ | | | | | | | | SI-9254 UnrolledBuffer appends in wrong position
| * | | SI-9254 UnrolledBuffer appends in wrong positionRex Kerr2015-03-312-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed two bugs in insertion (insertAll of Unrolled): 1. Incorrect recursion leading to an inability to insert past the first chunk 2. Incorect repositioning of `lastptr` leading to strange `append` behavior after early insertion Added tests checking that both of these things now work. Also added a comment that "waterlineDelim" is misnamed. But we can't fix it now--it's part of the public API. (Shouldn't be, but it is.)
* | | | Merge pull request #4416 from Ichoran/issue/9197Adriaan Moors2015-04-222-1/+28
|\ \ \ \ | | | | | | | | | | SI-9197 Duration.Inf not a singleton when deserialized
| * | | | SI-9197 Duration.Inf not a singleton when deserializedRex Kerr2015-03-312-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made `Duration.Undefined`, `.Inf`, and `.MinusInf` all give back the singleton instance instead of creating a new copy by overriding readResolve. This override can be (and is) private, which at least on Sun's JDK8 doesn't mess with the auto-generated SerialVersionUIDs. Thus, the patch should make things strictly better: if you're on 2.11.7+ on JVMs which pick the same SerialVersionUIDs, you can recover singletons. Everywhere else you were already in trouble anyway.
* | | | | Merge pull request #4462 from som-snytt/issue/badtabAdriaan Moors2015-04-222-5/+30
|\ \ \ \ \ | | | | | | | | | | | | SI-9275 Fix row-first display in REPL
| * | | | | SI-9275 Fix row-first display in REPLSom Snytt2015-04-212-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A missing range check in case anyone ever wants to use ``` -Dscala.repl.format=across ``` which was observed only because of competition from Ammonite.
* | | | | | Merge pull request #4461 from adriaanm/rebase-4446Adriaan Moors2015-04-2255-69/+69
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix many typos
| * | | | | | Fix many typosMichał Pociecha2015-04-2155-69/+69
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | This commit corrects many typos found in scaladocs and comments. There's also fixed the name of a private method in ICodeCheckers.
* | | | | | Merge pull request #4452 from lrytz/valueClassSelfTypeBCodeAdriaan Moors2015-04-222-2/+56
|\ \ \ \ \ \ | | | | | | | | | | | | | | Don't crash GenBCode for value classes with a self declaration
| * | | | | | Don't crash GenBCode for value classes with a self declarationLukas Rytz2015-04-162-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a value class has a self declaration class V(x: Long) extends AnyVal { self => /* ... */ } `vClassSymbol.typeOfThis.typeSymbol` is `class Long` in the backend. The InlineInfo for traits contains a field for the self type of the trait. This is required for re-writing calls to final trait methods to the static implementation method: the self type appears in the impl method signature. By mistake, the backend was recording the self type of all classes, not only of traits. In the case of a value class with a self declaration, this broke the assumption that the self type is always a class type (not a primitive type). The simple fix: only record the self type for traits.
* | | | | | | Merge pull request #4455 from adriaanm/sbt-buildAdriaan Moors2015-04-2210-5/+521
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Experimental sbt build [ci: last-only]
| * | | | | | Remove stdout/stderr output from Junit testsJason Zaugg2015-04-211-1/+0
| | | | | | |
| * | | | | | Avoid unwanted boostrap JARs in the subproject classpathsJason Zaugg2015-04-211-19/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added build configuration to ask SBT to forcible override the Scala version in the subproject to the declared bootstrap version. I did this in response to a warning by SBT the declared `scalaVersion` has been evicted. However, we actually *want* the newer version. To get rid of the warning, we need to exclude all `"org.scala-lang" % "*"` when depending on Scala modules. This cleanly breaks the cycle. Here's a diff of `*/dependencyClasspath` as a result of this patch: https://gist.github.com/retronym/217c76001b1b81798042
| * | | | | | Avoid wildcard ignorance of files named 'target'.Jason Zaugg2015-04-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In favour of explicitly ignoring the ones we know contain SBT build output. Rationale: we used to have a package named target. Admittedly we thought better of that (55109d0d253) so it is now called `meta`, but let's not get lazy and encode a poor practice into our gitignore.
| * | | | | | Align how ant builds asm & forkjoinGrzegorz Kossakowski2015-04-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two inconsistencies in building asm & forkjoin: 1. Asm classes lived in `build/asm`, while forkjoin's were in `build/libs/classes/forkjoin`. 2. Though no jars are needed for these projects, forkjoin was packaged, but asm was not. No reason for these inconsistencies could be found in the history.
| * | | | | | Script that diffs `build/` and `build-sbt/`Grzegorz Kossakowski2015-04-172-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To ensure the sbt build matches the ant build, diff their output. The scripts just delegates to `diff` command that compares directories recursively. We've added some handy ignore patterns (e.g. for .complete files). Ignore locker and deps dirs when comparing build and build-sbt, these directories are needed by Ant build only. Ignore irrelevant jars in build/pack/lib generated by the Ant build.
| * | | | | | `test/it:test` runs partest regression testsGrzegorz Kossakowski2015-04-171-2/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partest tests are defined in Integration configuration. This means you need to run them with `test/it:test` command. We put them in separate configuration because they are slow to run so user needs to ask explicitly for partest to run. Introduce a common way of setting jar location so it can be reused between `scalaSubprojectSettings` and `partestJavaAgent`.
| * | | | | | `test` task runs Junit testsJason Zaugg2015-04-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dependency on scaladoc in junit subproject, as required by 6e6632e (it introduced a junit test for scaladoc). Enable assertion stack traces and info logging of each test.
| * | | | | | Tweak formatting of build.sbtJason Zaugg2015-04-171-45/+44
| | | | | | |
| * | | | | | Projects for partest-extras and junitJason Zaugg2015-04-171-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Explicitly set [un]managed[re]sourceDirectories for all projects to improve the import into IntelliJ - Add partest extras project, that contains scala/scala specific extensions to partest for use in partest and junit tests. - Add junit project, which contains unit tests for the compiler and library.