summaryrefslogtreecommitdiff
path: root/bincompat-forward.whitelist.conf
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Optimize slice and take in ArrayOps, WrappedArray"Adriaan Moors2017-04-071-296/+0
| | | | This reverts commit d540bf01fe4d9e5c56a68b0d3bada9d97af77e3f.
* Revert "Optimised implementation of List.filter/filterNot"Adriaan Moors2017-04-071-17/+0
| | | | This reverts commit eb5c51383a63c5c3420e53ef021607ff5fd20296.
* Revert "Handle WrappedArray the same way as ArrayOps for binary compatibility"Adriaan Moors2017-04-071-44/+12
| | | | This reverts commit f24c2603d0acee5bcb6d5d80bf1e1a4645fa74f0.
* Merge pull request #5592 from fommil/jar-open-closeJason Zaugg2017-03-221-0/+12
|\ | | | | SI-9632 don't keep JarFile open in ZipArchive
| * SI-9632 don't keep JarFile open in ZipArchiveSam Halliday2017-02-221-0/+12
| |
* | Merge pull request #5600 from paplorinc/HashTable_indexSeth Tisue2017-03-061-0/+4
|\ \ | |/ |/| Further small HashTable optimizations
| * Optimized HashTable.nextPositivePowerOfTwoPap Lőrinc2017-02-181-0/+4
| |
* | SD-256 enable colored output by default on unixAntoine Gourlay2017-02-211-0/+8
| | | | | | | | | | | | | | | | | | `scala.color` now has 3 states: `true`, `false` and `auto` (the default). `auto` allows colors if not on windows and if the shell is interactive (as in, both stdin and stdout are a tty). The autodetect works as expected when run via SBT too, and it can always be overriden on the CLI or via JAVA_OPTS.
* | SI-10026 Fix endless cycle in runtime reflectionJason Zaugg2017-02-191-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 56f23af introduced a call to `baseTypeSeq` of `scala.collection.mutable.ArrayOps.ofRef[?T]{}` in `findMember`. This exposed a latent bug in the synchronized wrapper of `BaseTypeSeq`, demonstrated below with an older version of Scala: ``` Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112). Type in expressions for evaluation. Or try :help. scala> val symtab = reflect.runtime.universe.asInstanceOf[scala.reflect.internal.SymbolTable] symtab: scala.reflect.internal.SymbolTable = scala.reflect.runtime.JavaUniverse@458544e0 scala> import symtab._ import symtab._ scala> val ArrayOps_ofRef_Class = symtab.symbolOf[scala.collection.mutable.ArrayOps.ofRef[AnyRef]] ArrayOps_ofRef_Class: symtab.TypeSymbol = class ofRef scala> appliedType(symbolOf[Set[Any]], symbolOf[Set[Any]].typeParams.map(TypeVar(_))) res2: symtab.Type = Set[?A] scala> .narrow res3: symtab.Type = <none>.<refinement>.type scala> .baseTypeSeq java.lang.StackOverflowError at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:21) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.scala$reflect$runtime$SynchronizedOps$SynchronizedBaseTypeSeq$$super$map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anonfun$map$1.apply(SynchronizedOps.scala:27) at scala.reflect.runtime.Gil$class.gilSynchronized(Gil.scala:19) at scala.reflect.runtime.JavaUniverse.gilSynchronized(JavaUniverse.scala:16) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.map(SynchronizedOps.scala:27) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.map(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$class.lateMap(SynchronizedOps.scala:34) at scala.reflect.runtime.SynchronizedOps$SynchronizedBaseTypeSeq$$anon$2.lateMap(SynchronizedOps.scala:34) at scala.reflect.internal.BaseTypeSeqs$MappedBaseTypeSeq.map(BaseTypeSeqs.scala:235) ``` The infinite cycle involves: ``` class MappedBaseTypeSeq(orig: BaseTypeSeq, f: Type => Type) extends BaseTypeSeq(orig.parents map f, orig.elems) { ... override def map(g: Type => Type) = lateMap(g) override def lateMap(g: Type => Type) = orig.lateMap(x => g(f(x))) } trait SynchronizedBaseTypeSeq extends BaseTypeSeq { ... override def map(f: Type => Type): BaseTypeSeq = gilSynchronized { super.map(f) } override def lateMap(f: Type => Type): BaseTypeSeq = // only need to synchronize BaseTypeSeqs if they contain refined types if (map(f).toList.exists(_.isInstanceOf[RefinedType])) new MappedBaseTypeSeq(this, f) with SynchronizedBaseTypeSeq else new MappedBaseTypeSeq(this, f) } ``` This commit creates a new factory method for `MappedBaseTypeSeq`-s to break the cycle. As an independent change, I have also removed the attempt to conditionally synchronize them, as the condition was eagerly applying the map function (and throwing away the result!). I've appeased MiMa with new whitelist entries, but I'm confident that this is deep enough in the bowels of our runtime reflection implementation that there is no way that user code will be calling these methods directly.
* Merge branch '2.12.x' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-171-0/+8
|\
| * update MiMa whitelist for infix annotationSeth Tisue2017-02-161-0/+8
| | | | | | | | little missing piece of https://github.com/scala/scala/pull/5589
* | Merge commit '0965028809' into merge-2.11.x-to-2.12.x-20170214Seth Tisue2017-02-161-0/+349
|\ \ | |/ |/|
| * Handle WrappedArray the same way as ArrayOps for binary compatibilityStefan Zeiger2017-02-031-12/+44
| | | | | | | | | | We introduce a package-private superclass with the overridden implementations. This is public at the bytecode level, so it needs to be whitelisted.
| * Optimised implementation of List.filter/filterNotRory Graves2017-01-281-0/+17
| |
| * Optimize slice and take in ArrayOps, WrappedArrayMike Skells2017-01-281-0/+296
| | | | | | | | use Array block copy operations rather than builder/iterator
* | Optimizations in immutable.Map.{get, contains}Jason Zaugg2017-02-031-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid allocation of Some in get - defer integer left shift until needed - avoid redundantly masking an integer before: Benchmark (size) Mode Cnt Score Error Units HashMapBenchmark.contains 10 avgt 20 284.624 ± 18.985 ns/op HashMapBenchmark.contains 100 avgt 20 3190.580 ± 33.622 ns/op HashMapBenchmark.contains 1000 avgt 20 52967.171 ± 1524.834 ns/op HashMapBenchmark.get 10 avgt 20 248.168 ± 2.612 ns/op HashMapBenchmark.get 100 avgt 20 2795.469 ± 54.458 ns/op HashMapBenchmark.get 1000 avgt 20 52238.773 ± 1268.764 ns/op after: Benchmark (size) Mode Cnt Score Error Units HashMapBenchmark.contains 10 avgt 20 195.107 ± 2.442 ns/op HashMapBenchmark.contains 100 avgt 20 2454.151 ± 24.392 ns/op HashMapBenchmark.contains 1000 avgt 20 40722.993 ± 520.473 ns/op HashMapBenchmark.get 10 avgt 20 245.282 ± 3.547 ns/op HashMapBenchmark.get 100 avgt 20 2729.669 ± 32.767 ns/op HashMapBenchmark.get 1000 avgt 20 49568.410 ± 794.565 ns/op
* | Override equals and hashCode for WrappedArrayAlexey Romanov2016-12-211-0/+8
| |
* | Support Java 9 modular runtime imagesJason Zaugg2016-12-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://openjdk.java.net/jeps/220 changes the layout of the JDK to encapsulate the provided libraries with the new module system. This commit modifies the compiler's classpath implementation to scan the new location of these, the `jrt://` virtual filesystem. This might need to be adjusted once we provide a means for users to specify the subset of modules that they want to depend on, but for now reclaims the ground we lost. ``` ⚡ (java_use 9-ea; qscala) Welcome to Scala 2.12.0-20160908-223617-7e4ebda (Java HotSpot(TM) 64-Bit Server VM, Java 9-ea). Type in expressions for evaluation. Or try :help. scala> import StackWalker._, java.util.stream._, scala.collection.JavaConverters._ import StackWalker._ import java.util.stream._ import scala.collection.JavaConverters._ scala> (() => StackWalker.getInstance(java.util.EnumSet.of(Option.RETAIN_CLASS_REFERENCE)).walk[Seq[String]]((s: java.util.stream.Stream[StackFrame]) => s.iterator.asScala.take(3).map(_.toString).toList)).apply().mkString("\n") res0: String = .$anonfun$res0$1(<console>:21) .<init>(<console>:21) .<clinit>(<console>) scala> ``` I've marked the new class, `NioFile` as `private[scala]` to justify the forward compatibility whitelist entry. In principle we could use NioFile more widely rather than `PlainFile` I tried this out in https://github.com/retronym/scala/commit/b2d0a17a which passed CI. But to be conservative, I'm not submitting that change at this point.
* | Merge remote-tracking branch 'origin/2.11.x' into merge-2.11.x-to-2.12.x-dec-1Seth Tisue2016-12-011-0/+6
|\|
| * upgrade MiMa to 0.1.12Seth Tisue2016-12-011-0/+237
| | | | | | | | | | dogfooding the latest. upgrading all the way from 0.1.8 -- there have been a bunch of improvements since then.
| * SI-2712 Add support for higher order unificationMiles Sabin2016-08-151-0/+4
| |
| * SI-9488 - adds the same default toString format to Scala Futures as 2.12.xViktor Klang2016-03-221-0/+6
| | | | | | | | Includes tests to verify the toString representations.
* | Pattern matching virtualization now guarded by -Yvirtpatmat.Miles Sabin2016-11-281-0/+4
| |
* | Whitelist the remaining changes since 2.12.0 that break all buildsStefan Zeiger2016-11-211-0/+8
| | | | | | | | | | | | | | The changes were made in https://github.com/scala/scala/pull/5481, subsequently breaking binary compatibility checks after https://github.com/scala/scala/pull/5532 was merged, too. The affected methods are part of an internal implementation class. Whitelisting should be safe.
* | Restore binary compatiblity with 2.12.0Jason Zaugg2016-11-161-474/+4
| | | | | | | | | | | | | | - Revert a typo fix to a non-private method - Whitelist changes to internals of runtime reflection that are not part of the API and should only be referenced from within scala-reflect.jar itself.
* | SI-2712 Add support for higher order unificationMiles Sabin2016-05-241-0/+4
| |
* | Merge remote-tracking branch 'origin/2.11.x' into 2.12.xSeth Tisue2015-08-201-0/+9
|\| | | | | | | | | | | | | | | | | | | all conflicts were because the changes changed code that doesn't exist anymore in 2.12; they were resolved with `git checkout --ours` c201eac changed bincompat-forward.whitelist.conf but I dropped the change in this merge because it refers to AbstractPromise which no longer exists in 2.12
| * SI-8362: AbstractPromise extends AtomicReferenceMariot Chauvin2015-07-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid `sun.misc.Unsafe`, which is not supported on Google App Engine. Deprecate `AbstractPromise` --> extend `j.u.c.atomic.AtomicReference` directly. `AtomicReference.compareAndSet()` should also provide better performance on HotSpot, which compiles it down to the machine's CAS instruction. The binary incompatible change is ok because it's in an internal package. I can't think of any real issue with adding a superclass (which contributes only final methods) to a class in an implementation package (as long as those methods were not introduced in any illicit subclasses of said class). Instead of changing `DefaultPromise`'s super class, let's be more conservative, and do it closest to the source. This is both clearer and more focussed, leaving those subclasses of AbstractPromise we never heard of unaffected. Genesis of the commit: since the work on `Future` performance, `AbstractPromise` is using `Unsafe`, breaking the ability for `Future` to be executed on GAE. At that time, viktorklang suggested to implement a fallback in case `Unsafe` is not available. carey proposed an implementation, and mchv submitted a patch, which was refined by adriaanm.
* | Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624Jason Zaugg2015-06-241-0/+53
|\|
| * Clean implementation of sorts for scala.util.Sorting.Rex Kerr2015-06-011-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed code based on Sun JDK sorts and implemented new (basic) sorts from scratch. Deferred to Java Arrays.sort whenever practical. Behavior of `scala.util.Sorting` should be unchanged, but changed documentation to specify when the Java methods are being used (as they're typically very fast). A JUnit test is provided. Performance is important for sorts. Everything is better with this patch, though it could be better yet, as described below. Below are sort times (in microseconds, SEM < 5%) for various 1024-element arrays of small case classes that compare on an int field (quickSort), or int arrays that use custom ordering (stableSort). Note: "degenerate" means there are only 16 values possible, so there are lots of ties. Times are all with fresh data (no re-using cache from run to run). Results: ``` random sorted reverse degenerate big:64k tiny:16 Old Sorting.quickSort 234 181 178 103 25,700 1.4 New Sorting.quickSort 170 27 115 74 18,600 0.8 Old Sorting.stableSort 321 234 236 282 32,600 2.1 New Sorting.stableSort 239 16 194 194 25,100 1.2 java.util.Arrays.sort 124 4 8 105 13,500 0.8 java.util.Arrays.sort|Box 126 15 13 112 13,200 0.9 ``` The new versions are uniformly faster, but uniformly slower than Java sorting. scala.util.Sorting has use cases that don't map easily in to Java unless everything is pre-boxed, but the overhead of pre-boxing is minimal compared to the sort. A snapshot of some of my benchmarking code is below. (Yes, lots of repeating myself--it's dangerous not to when trying to get somewhat accurate benchmarks.) ``` import java.util.Arrays import java.util.Comparator import math.Ordering import util.Sorting import reflect.ClassTag val th = ichi.bench.Thyme.warmed() case class N(i: Int, j: Int) {} val a = Array.fill(1024)( Array.tabulate(1024)(i => N(util.Random.nextInt, i)) ) var ai = 0 val b = Array.fill(1024)( Array.tabulate(1024)(i => N(i, i)) ) var bi = 0 val c = Array.fill(1024)( Array.tabulate(1024)(i => N(1024-i, i)) ) var ci = 0 val d = Array.fill(1024)( Array.tabulate(1024)(i => N(util.Random.nextInt(16), i)) ) var di = 0 val e = Array.fill(16)( Array.tabulate(65536)(i => N(util.Random.nextInt, i)) ) var ei = 0 val f = Array.fill(65535)( Array.tabulate(16)(i => N(util.Random.nextInt, i)) ) var fi = 0 val o = new Ordering[N]{ def compare(a: N, b: N) = if (a.i < b.i) -1 else if (a.i > b.i) 1 else 0 } for (s <- Seq("one", "two", "three")) { println(s) th.pbench{ val x = a(ai).clone; ai = (ai+1)%a.length; Sorting.quickSort(x)(o); x(x.length/3) } th.pbench{ val x = b(bi).clone; bi = (bi+1)%b.length; Sorting.quickSort(x)(o); x(x.length/3) } th.pbench{ val x = c(ci).clone; ci = (ci+1)%c.length; Sorting.quickSort(x)(o); x(x.length/3) } th.pbench{ val x = d(di).clone; di = (di+1)%d.length; Sorting.quickSort(x)(o); x(x.length/3) } th.pbench{ val x = e(ei).clone; ei = (ei+1)%e.length; Sorting.quickSort(x)(o); x(x.length/3) } th.pbench{ val x = f(fi).clone; fi = (fi+1)%f.length; Sorting.quickSort(x)(o); x(x.length/3) } } def ix(ns: Array[N]) = { val is = new Array[Int](ns.length) var i = 0 while (i < ns.length) { is(i) = ns(i).i i += 1 } is } val p = new Ordering[Int]{ def compare(a: Int, b: Int) = if (a > b) 1 else if (a < b) -1 else 0 } for (s <- Seq("one", "two", "three")) { println(s) val tag: ClassTag[Int] = implicitly[ClassTag[Int]] th.pbench{ val x = ix(a(ai)); ai = (ai+1)%a.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } th.pbench{ val x = ix(b(bi)); bi = (bi+1)%b.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } th.pbench{ val x = ix(c(ci)); ci = (ci+1)%c.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } th.pbench{ val x = ix(d(di)); di = (di+1)%d.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } th.pbench{ val x = ix(e(ei)); ei = (ei+1)%e.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } th.pbench{ val x = ix(f(fi)); fi = (fi+1)%f.length; Sorting.stableSort(x)(tag, p); x(x.length/3) } } for (s <- Seq("one", "two", "three")) { println(s) th.pbench{ val x = a(ai).clone; ai = (ai+1)%a.length; Arrays.sort(x, o); x(x.length/3) } th.pbench{ val x = b(bi).clone; bi = (bi+1)%b.length; Arrays.sort(x, o); x(x.length/3) } th.pbench{ val x = c(ci).clone; ci = (ci+1)%c.length; Arrays.sort(x, o); x(x.length/3) } th.pbench{ val x = d(di).clone; di = (di+1)%d.length; Arrays.sort(x, o); x(x.length/3) } th.pbench{ val x = e(ei).clone; ei = (ei+1)%e.length; Arrays.sort(x, o); x(x.length/3) } th.pbench{ val x = f(fi).clone; fi = (fi+1)%f.length; Arrays.sort(x, o); x(x.length/3) } } def bx(is: Array[Int]): Array[java.lang.Integer] = { val Is = new Array[java.lang.Integer](is.length) var i = 0 while (i < is.length) { Is(i) = java.lang.Integer.valueOf(is(i)) i += 1 } Is } def xb(Is: Array[java.lang.Integer]): Array[Int] = { val is = new Array[Int](Is.length) var i = 0 while (i < is.length) { is(i) = Is(i).intValue i += 1 } is } val q = new Comparator[java.lang.Integer]{ def compare(a: java.lang.Integer, b: java.lang.Integer) = o.compare(a.intValue, b.intValue) } for (s <- Seq("one", "two", "three")) { println(s) val tag: ClassTag[Int] = implicitly[ClassTag[Int]] th.pbench{ val x = bx(ix(a(ai))); ai = (ai+1)%a.length; Arrays.sort(x, q); xb(x)(x.length/3) } th.pbench{ val x = bx(ix(b(bi))); bi = (bi+1)%b.length; Arrays.sort(x, q); xb(x)(x.length/3) } th.pbench{ val x = bx(ix(c(ci))); ci = (ci+1)%c.length; Arrays.sort(x, q); xb(x)(x.length/3) } th.pbench{ val x = bx(ix(d(di))); di = (di+1)%d.length; Arrays.sort(x, q); xb(x)(x.length/3) } th.pbench{ val x = bx(ix(e(ei))); ei = (ei+1)%e.length; Arrays.sort(x, q); xb(x)(x.length/3) } th.pbench{ val x = bx(ix(f(fi))); fi = (fi+1)%f.length; Arrays.sort(x, q); xb(x)(x.length/3) } } ```
* | Merge commit 'fcc20fe' into merge/2.11-to-2.12-apr-1Lukas Rytz2015-04-011-0/+5
|\|
| * SI-9059 Random.alphanumeric is inefficientDenton Cockburn2015-02-131-0/+5
| | | | | | | | | | | | | | | | | | Generate alphanumeric values by taking random element of string containing all alphanumerics. Instead of generating nextPrintableChar then filtering for alphanumerics, we can just take from a string containing all alphanumerics. This provides a significant performance improvement.
* | Merge commit '7ba38a0' into merge/2.11.x-to-2.12.x-20150129Jason Zaugg2015-01-291-0/+22
|\| | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/library/scala/collection/Iterator.scala versions.properties
| * Cleanup and refactoring - semicolons, unused or commented out codempociecha2014-12-051-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains some minor changes made by the way when implementing flat classpath. Sample JUnit test that shows that all pieces of JUnit infrastructure work correctly now uses assert method form JUnit as it should do from the beginning. I removed commented out lines which were obvious to me. In the case of less obvious commented out lines I added TODOs as someone should look at such places some day and clean them up. I removed also some unnecessary semicolons and unused imports. Many string concatenations using + have been changed to string interpolation. There's removed unused, private walkIterator method from ZipArchive. It seems that it was unused since this commit: https://github.com/scala/scala/commit/9d4994b96c77d914687433586eb6d1f9e49c520f However, I had to add an exception for the compatibility checker because it was complaining about this change. I made some trivial corrections/optimisations like use 'findClassFile' method instead of 'findClass' in combination with 'binary' to find the class file.
| * Add flat classpath implementation for zip and jar filesmpociecha2014-11-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an implementation of flat classpath which can handle both jar and vanilla zip files. In fact there are two versions - for a class- and a sourcepath. Both extend ZipArchiveFileLookup which provides common logic. They use FileZipArchive. @gkossakowski made a comparison of different ways of handling zips and jars (e.g. using javac's ZipFileIndex). He stated that general efficiency of FileZipArchive, taking into account various parameters, is the best. FileZipArchive is slightly changed. From now it allows to find the entry for directory in all directory entries without iterating all entries regardless of a type. Thanks to that we can simply find a directory for a package - like in the case of DirectoryFileLookup. There's also added possibility to cache classpath representation of classpath elements from jar and zip files across compiler instances. The cache is just a map AbstractFile -> FlatClassPath. It should reduce the number of created classpath and file instances e.g. in the case of many ScalaPresentationCompilers in Scala IDE. To prevent the possibility to avoid a cache, caches are created as a part of factories responsible for the creation of these types of the flat classpath.
| * [nomerge] SI-8899 Revert "SI-8627 make Stream.filterNot non-eager"Lukas Rytz2014-10-121-97/+0
|/ | | | | | | | | This reverts commit 9276a1205f74fdec74206209712831913e93f359. The change is not binary compatible, See discussion on SI-8899. Making filterImpl non-private changes its call-sites (within TraversableLike) from INVOKESTATIC to INVOKEINTERFACE. Subclasses of TraversableLike compiled before this change don't have a mixin for filterImpl.
* SI-8680 Stream.addString is too eagerRex Kerr2014-09-121-0/+21
| | | | | | | | | | Used the standard method of sending out two iterators, one twice as fast as the others, to avoid hanging on .force, .hasDefiniteSize, and .addString. .addString appends a "..." as the last element if it detects a cycle. It knows how to print the cycle length, but there's no good way to specify what you want right now, so it's not used. Added tests in t8680 that verify that cyclic streams give the expected results. Added to whitelist names of methods formerly used for recursion (now looping).
* SI-8627 make Stream.filterNot non-eagerLukas Rytz2014-08-271-0/+97
| | | | | | | | | | | | | | | | The obvious fix, overriding `filterNot` in Stream, is not binary compatible, see https://github.com/scala/scala/pull/3925 Instead, this makes `filterImpl` in TaversableLike private[scala], which allows overriding it in Stream. The corresponding mima-failures can be whitelisted, as the changes are only to private[scala]. In 2.12.x we can remove the override of `filter` in Stream, but in 2.11.x this is not binary compatible. Eventually we'd also like to make filter / filterNot in TraversableLike final, but that's not source compatible, so it cannot be done in 2.12.x.
* SI-5919 TypeTags and Exprs should be serializablePhilipp Haller2014-07-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make TypeCreator and TreeCreator extend Serializable. - When replacing a SerializedTypeTag with a TypeTag or WeakTypeTag, do not use scala.reflect.runtime.universe.rootMirror, since it is unlikely to find user classes; instead, create a runtime mirror using the context ClassLoader of the current thread. Use the same logic for SerializedExpr. - Remove writeObject/readObject methods from SerializedTypeTag and SerializedExpr since they are unused. - Add @throws annotation on writeReplace and readResolve methods. - Handle SecurityException if the current thread cannot access the context ClassLoader. - To make type tags of primitive value classes serializable, make PredefTypeCreator a top-level class. Otherwise, it would retain a reference to the enclosing Universe, rendering the TypeCreator non-serializable. Binary compatibility: - Keep nested PredefTypeCreator class to avoid backward binary incompatible change. - Keep `var` modifiers on the class parameters of SerializedTypeTag for backward binary compatibility. - Adds filter rules to forward binary compatibility whitelist: - `TypeCreator`, `PredefTypeCreator`, and `TreeCreator` must now extend from `Serializable`. - Must have new class `scala.reflect.api.PredefTypeCreator` to avoid problematic outer reference.
* Remove deprecationWarning, currentReporting from ReportingAdriaan Moors2014-07-041-0/+12
| | | | | | | | This moves us a bit closer to the goal of having a single entry point to reporting. Must modularize Reporting a bit so it can be used in Variances (need a reference to `currentRun` in `reflect.internal.Reporting`).
* Uniformly route reporting through reporter.Adriaan Moors2014-07-041-1/+1
| | | | | | | | | | | | Sharpen interfaces, reduce footprint of Reporting trait. Ideally, all reporting should indirect through reporter, and the `Reporting` trait itself should be restricted to a single method that retrieves the current `reporter`. Pull up some more reporting to reflect.internal. Would like to do more, but need to move partest to the reflect.internal interface first. (Its `errorCount` relies on `ERROR.count` in `tools.nsc.Reporter`.)
* Move reporting logic into Reporting traitAdriaan Moors2014-07-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move code from Global/SymbolTable to separate Reporting traits to start carving out an interface in scala.reflect.internal.Reporting, with internals in scala.tools.nsc. Reporting is mixed into the cake. It contains a nested class PerRunReporting. Should do the same for debugging/logging. The idea is that CompilationUnit and Global forward all reporting to Reporter. The Reporting trait contains these forwarders, and PerRunReporting, which accumulates warning state during a run. In the process, I slightly changed the behavior of `globalError` in reflect.internal.SymbolTable: it used to abort, weirdly. I assume that was dummy behavior to avoid introducing an abstract method. It's immediately overridden in Global, and I couldn't find any other subclasses, so I don't think the behavior in SymbolTable was ever observed. Provide necessary hooks for scala.reflect.macros.Parsers#parse. See scala/reflect/macros/contexts/Parsers.scala's parse method, which overrides the reporter to detect when parsing goes wrong. This should be refactored, but that goes beyond the scope of this PR. Don't pop empty macro context stack. (Ran into this while reworking -Xfatal-warnings logic.) Fix -Xfatal-warnings behavior (and check files): it wasn't meant to influence warning reporting, except for emitting one final error; if necessary to fail the compile (when warnings but no errors were reported). Warnings should stay warnings. This was refactored in fbbbb22946, but we soon seem to have relapsed. An hour of gitfu did not lead to where it went wrong. Must've been a merge.
* Optimize nested scope creationJason Zaugg2014-05-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can copy the hash table from the parent scope, rather than constructing it from scratch. This takes us to: % rm -rf /tmp/pkg; (for i in {1..50}; do for j in {1..100}; do echo "package pkg { class A_${i}_${j}___(val a: Int, val b: Int) }"; done; done) > sandbox/A1.scala && time qbin/scalac -Ybackend:GenASM -J-Xmx1G -J-XX:MaxPermSize=400M -d /tmp sandbox/A1.scala; real 0m19.639s // head~1 was 0m35.662s user 0m41.683s // head~1 was 0m58.275s sys 0m1.886s In more detail, this commit: - Removes the unused `fingerprint` constructor parameter from scopes. This is a remnant from a previous optimization attempt - Leave only one constructor on Scope which creates an empty scope - Update the factory method, `newNestedScope`, to copy the hash table from the parent if it exists. We can rely on the invariant that `outer.hashTable != null || outer.size < MIN_HASH)`, so we don't need `if (size >= MIN_HASH) createHash()` anymore. This used to be needed in `Scope#<init>`, which accepted an aribitrary `initElems: ScopeEntry`. - Update subclasses and factories of `Scope` in runtime reflection to accomodate the change. Pleasingly, we could actually remove the override for `newNestedScope`. - Unit tests the functionality I'm touching
* Merge commit '876590b' into topic/merge-2.10.xJason Zaugg2014-05-081-0/+4
|\ | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/reflect/scala/reflect/runtime/JavaMirrors.scala
| * SI-8196 Runtime reflection robustness for STATIC impl detailsJason Zaugg2014-03-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala's runtime reflection works in few modes. The primary mode reads reads out the pickled signatures from ScalaSig annotations, if avaialable. However, these aren't available for Java-defined classes (obviously) nor for local Scala-defined classes (less obviously.), and the Scala `Symbol`s and `Types` must be reconstructed from the Java generic reflection metadata. This bug occurs in the last case, and is centered in `FromJavaClassCompleter`. In that completer, member fields and methods are given an owner based on the STATIC modifier. That makes sense for Java defined classes. I'm not 100% if it makes sense for Scala defined classes; maybe we should just skip them entirely? This patch still includes them, but makes the ownership-assignment more robust in the face of STATIC members emitted by the Scala compiler backend, such as the cache fields for structural calls. (It's reflection all the way down!). We might not have a companion module at all, so before we ended up owning those by `NoSymbol`, and before too long hit the dreaded NSDHNAO crash. That crash doesn't exist any more on 2.11 (it is demoted to a -Xdev warning), but this patch still makes sense on that branch. This commit makes `followStatic` and `enter` more robust when finding a suitable owner for static members. I've also factored out the duplicated logic between the two.
| * [nomaster] Update MiMa and use new wildcard filterJason Zaugg2014-01-151-1266/+4
| | | | | | | | | | | | | | scala.reflect.internal._ now gets a free pass from binary compatibility checking. Previously, we had to excrutiatingly exclude violations individually.
| * SI-8029 Avoid multi-run cyclic error with companions, package objectJason Zaugg2013-12-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug report suggests this problem only became visible in the IDE *after* 2.10.3, but I tested an IDE with exactly 2.10.3 and saw the same problem. In fact, my test case fails as far back as 2.10.0. I suspect the problem showed up after 816cecf9a9, which checks that pairs of companion symbols are codefined eagerly in Namers. This commit modifies the check of `rawInfo ne NoType` in `isCoDefinedWith` to avoid triggering adaptation of types from the previous run. I'm not sure of the precise intent of that check. I looked at c9861cd198 (genesis of isCoDefinedWith). Before that we get back to 3761cb4b3a1 (the dawn of Subversion.)
| * SI-7825 Consider DEFAULTMETHOD when refchecking concretenessJason Zaugg2013-09-101-0/+24
| | | | | | | | | | | | | | | | | | | | A class should not be required to implement a Java default method. This commit uses `isDeferredNotDefault` in place of `isDeferred` when finding unimplemented methods. The test itself does not depend on Java 8 as we use scalac's Java source parser to set things up.
| * SI-7149 Use a WeakHashSet for type uniquenessGrzegorz Kossakowski2013-09-031-0/+24
| | | | | | | | | | | | | | | | Currently type uniqueness is done via a HashSet[Type], but that means the Types live through an entire compile session, even ones that are used once. The result is a huge amount of unnecessarily retained memory. This commit uses a WeakHashSet instead so that Types and their WeakReferences are cleaned up when no longer in use.
| * SI-7150 Replace scala.reflect.internal.WeakHashSetGrzegorz Kossakowski2013-09-031-0/+800
| | | | | | | | | | | | | | Replaces scala.reflect.internal.WeakHashSet with a version that * extends the mutable.Set trait * doesn't leak WeakReferences * is unit tested