summaryrefslogtreecommitdiff
path: root/project/ScalaOptionParser.scala
Commit message (Collapse)AuthorAgeFilesLines
* Workaround bug in Scala runtime reflection on JDK 9Jason Zaugg2017-02-161-0/+2
| | | | | | | | | | | | | | | | | | | The underlying bug is tracked as https://github.com/scala/scala-dev/issues/304 and blocks our SBT starting on JDK 9. This commit avoids using the empty package in our build definition. After this change, I needed to manually clean the class files from the build definition as follows, which might indicate a bug in SBT. $ sbt ... /Users/jz/code/scala-java9-ci/build.sbt:0: warning: imported `BuildSettings' is permanently hidden by definition of object BuildSettings import ..., _root_.scala.build.BuildSettings, ... ^C % rm -rf project/target/scala-2.10/sbt-0.13/classes/ % sbt # okay second time
* Fix how "sbt" is writtenDale Wijnand2016-12-211-1/+1
| | | | | | | | "sbt" is not an acronym (it used to be, but it isn't any longer). It's a proper name, like "iPhone" or "eBay". So, just like you wouldn't write "Get Started With EBay" or "How To Reset Your IPhone", we don't write "Using the Sbt Build".
* remove deprecated compiler flag "-Yinfer-by-name"Lars Hupel2016-12-011-1/+1
| | | | This was slated for removal in 2.12.
* remove deprecated compiler flag "-Yeta-expand-keeps-star"Lars Hupel2016-12-011-1/+1
| | | | This was slated for removal in 2.12.
* Fields does bitmaps & synch for lazy vals & modulesAdriaan Moors2016-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Essentially, we fuse mixin and lazyvals into the fields phase. With fields mixing in trait members into subclasses, we have all info needed to compute bitmaps, and thus we can synthesize the synchronisation logic as well. By doing this before erasure we get better signatures, and before specialized means specialized lazy vals work now. Mixins is now almost reduced to its essence: implementing super accessors and forwarders. It still synthesizes accessors for param accessors and early init trait vals. Concretely, trait lazy vals are mixed into subclasses with the needed synchronization logic in place, as do lazy vals in classes and methods. Similarly, modules are initialized using double checked locking. Since the code to initialize a module is short, we do not emit compute methods for modules (anymore). For simplicity, local lazy vals do not get a compute method either. The strange corner case of constant-typed final lazy vals is resolved in favor of laziness, by no longer assigning a constant type to a lazy val (see widenIfNecessary in namers). If you explicitly ask for something lazy, you get laziness; with the constant-typedness implicit, it yields to the conflicting `lazy` modifier because it is explicit. Co-Authored-By: Lukas Rytz <lukas@lightbend.com> Fixes scala/scala-dev#133 Inspired by dotc, desugar a local `lazy val x = rhs` into ``` val x$lzy = new scala.runtime.LazyInt() def x(): Int = { x$lzy.synchronized { if (!x$lzy.initialized) { x$lzy.initialized = true x$lzy.value = rhs } x$lzy.value } } ``` Note that the 2.11 decoding (into a local variable and a bitmap) also creates boxes for local lazy vals, in fact two for each lazy val: ``` def f = { lazy val x = 0 x } ``` desugars to ``` public int f() { IntRef x$lzy = IntRef.zero(); VolatileByteRef bitmap$0 = VolatileByteRef.create((byte)0); return this.x$1(x$lzy, bitmap$0); } private final int x$lzycompute$1(IntRef x$lzy$1, VolatileByteRef bitmap$0$1) { C c = this; synchronized (c) { if ((byte)(bitmap$0$1.elem & 1) == 0) { x$lzy$1.elem = 0; bitmap$0$1.elem = (byte)(bitmap$0$1.elem | 1); } return x$lzy$1.elem; } } private final int x$1(IntRef x$lzy$1, VolatileByteRef bitmap$0$1) { return (byte)(bitmap$0$1.elem & 1) == 0 ? this.x$lzycompute$1(x$lzy$1, bitmap$0$1) : x$lzy$1.elem; } ``` An additional problem with the above encoding is that the `lzycompute` method synchronizes on `this`. In connection with the new lambda encoding that no longer generates anonymous classes, captured lazy vals no longer synchronize on the lambda object. The new encoding solves this problem (scala/scala-dev#133) by synchronizing on the lazy holder. Currently, we don't exploit the fact that the initialized field is `@volatile`, because it's not clear the performance is needed for local lazy vals (as they are not contended, and as soon as the VM warms up, biased locking should deal with that) Note, be very very careful when moving to double-checked locking, as this needs a different variation than the one we use for class-member lazy vals. A read of a volatile field of a class does not necessarily impart any knowledge about a "subsequent" read of another non-volatile field of the same object. A pair of volatile reads and write can be used to implement a lock, but it's not clear if the complexity is worth an unproven performance gain. (Once the performance gain is proven, let's change the encoding.) - don't explicitly init bitmap in bytecode - must apply method to () explicitly after uncurry
* Merge pull request #5102 from milessabin/2.12.xJason Zaugg2016-05-271-1/+1
|\ | | | | SI-2712 Add support for partial unification of type constructors
| * SI-2712 Add support for higher order unificationMiles Sabin2016-05-241-1/+1
| |
* | Rename -Yopt to -opt, -Yopt-warnings to -opt-warningsLukas Rytz2016-05-251-1/+1
|/ | | | Keep -Yopt-inline-heuristics and -Yopt-trace unchanged
* Fix some typos in `spec` documents and comments.Dongjoon Hyun2016-03-151-1/+1
|
* Remove -Y settings that are no longer used in 2.12Lukas Rytz2016-02-161-7/+5
| | | | | | Added a deprecation warning for `-optimize`. Later we'll also graduate `-Yopt` to `-opt`, probably for 2.12.0-M5.
* Fix SBT tab completion of scala commandJason Zaugg2016-02-111-4/+5
| | | | | | | | | | | `scala -deprecation` (without a trailing script argument) wasn't allowed. Now it is. I also supported trailing whitespace on all commands. Also fixed: a bug with completion of `scalac ./san<TAB>`. It was completing as though the `./` had not been typed, which threw the suggestion off by a few characters.
* Add SBT tab completion for scala{,c,doc}Jason Zaugg2016-02-091-0/+128
Also refactor the partest parser to use the improved tab completion for test paths.