| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
Co-Authored-By: Jason Zaugg <jzaugg@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`s.c.i.RedBlackTree.TreeIterator` uses a stack of nodes that need
to be processed later. This stack is implemented as an `Array`,
which is allocated with the maximum size that can possibly be
used, based on properties of red-black trees. This was added in
72ec0ac869a29fca9ea0d45a3f70f1e9e1babaaf. At the time, there was
no `iteratorFrom` method, and as the comment in that commit says,
the deepest nodes were never added to the stack, hence the final
`- 1` in computing the maximum stack size.
However, this changed with the introduction of `iteratorFrom` in
62bc99d3b20a7b37a977b19a6202cdac474eb5f6. The method `startFrom`
used to initialize the iterator at the right `start` node does
push the deepest nodes in some cases.
This internal bug got unnoticed because `pushNext` (originally
`pushPath`) has some error recovery in case the stack size got
miscalculated. This has performance impacts, though, since an
exception is thrown and caught.
More importantly, this error recovery mechanism does not work in
Scala.js, which considers `ArrayIndexOutOfBoundsException` to be
undefined behavior.
This commit fixes the stack size computation by simply removing
the `- 1` term. To minimize risks on Scala/JVM, the error recovery
mechanism is left untouched.
|
|\| |
|
| |
| |
| | |
`enqueue` appends elements to the `Queue`, it doesn't prepend them.
|
|\ \
| | |
| | | |
SI-9507 Make Stream #:: and #::: allow type widening
|
| | | |
|
|\ \ \
| | | |
| | | | |
Optimizations in immutable.Map.{get, contains}
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- 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
|
|\ \ \
| |/ /
|/| | |
Improve Queue.++ when building another Queue
|
| | |
| | |
| | |
| | | |
Use reverse_:::
|
|\ \ \
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
merge/2.11.x-to-2.12.x-20161220
Conflicts:
bincompat-backward.whitelist.conf
build.xml
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/library/scala/collection/immutable/NumericRange.scala
|
| |/
| |
| | |
SI-10086 NumericRange.min|max with custom Integral
|
|\ \
| | |
| | | |
SI-10060 Fixes NumricRange.max bug on empty ranges
|
| | | |
|
|\ \ \
| | | |
| | | | |
String.replaceAllLiterally is String.replace
|
| |/ /
| | |
| | |
| | |
| | | |
The method is not deprecated outright because it avoids
the overloaded equivalent.
|
| | | |
|
| | |
| | |
| | |
| | | |
Unified, since indices are always positive and unsigned shift was already used in other places
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
|/ / |
|
| | |
|
| |
| |
| |
| |
| |
| | |
All calls to Platform.arraycopy were rewritten as java.lang.System.arraycopy to reduce the work that the JIT compiler has to do to produce optimized bytecode that avoids zeroing just-allocated arrays that are about to be copied over.
(Tested with -XX:-ReduceBulkZeroing as suggested by retronym.)
|
|\ \
| | |
| | | |
SI-9909: corrected stream example so it does not give forward reference
|
| | |
| | |
| | |
| | | |
error
|
|\ \ \
| | |/
| |/| |
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Looking at the class hierarchy around ClassTag and Manifest, the only
class that had a serialVersionUID is AnyValManifest, where the hierarchy
is something like:
trait ClassTag // extends Serializable
|- class GenericClassTag
|- trait Manifest
|- class ClassTypeManifest
|- class SingletonTypeManifest
|- ...
|- abstract class AnyValManifest // has SerialVersionUID
|- class DoubleManifest
|- ...
Note that AnyValManifest is an abstract class, so the SerialVersionUID
annotation does not help there.
This commit adds explicit SerialVersionUID annotations to (hopefully)
all subclasses of ClassTag, to make sure they are stable under
compatible changes (such as changing -Xmixin-force-forwarders).
|
|\ \
| | |
| | | |
SI-7838 Document the multi-threading semantics of List and Vector
|
| | |
| | |
| | |
| | | |
Making them completely thread-safe would be too expensive (in terms
of performance of single-threaded use cases).
|
|\ \ \
| | | |
| | | | |
SI-8576 Minimal changes for `-Xcheckinit` compatibility
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As explained in https://issues.scala-lang.org/browse/SI-8576, I expect
serialization compatibility between builds with and without
`-Xcheckinit` to be unattainable. This commit contains some minor fixes
for issues discovered while running builds with `-Xcheckinit`:
- Add `@SerialVersionUID` to `scala.collection.immutable.Vector`, as
requested in SI-8576. Note that this does not make `Vector`
serialization compatible.
- Use lazy initialization for `global` in `PresentationCompilation`. It
used to access the uninitialized `self` variable (which seems to be
inconsequential in practice and only fails under `-Xcheckinit`).
We should consider using `Externalizable` instead of `Serializable` for
collections in 2.13 to make collection classes serialization compatible.
|
|\ \ \
| |/ /
|/| | |
SI-6881 Detect reference equality when comparing streams
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
`==` already covers this case. We override `equals` in `Stream` to do
the same when `equals` is called directly. This takes care of identical
streams.
To support short-circuiting equality checks on elements prepended to
identical streams we also override `sameElements` in `Cons` to treat
the case where both sides are `Cons` separately.
Tests in StreamTest.test_reference_equality.
|
|\ \ \
| | | |
| | | | |
SI-6947 Better type parameter names for Map classes
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Type parameter names are currently assigned pretty much alphabetically
without any meaning. This change renames all key parameters in Map
classes from `A` to `K` and all value parameters from `B` to `V` to
make them more meaningful. Derived names are renamed accordingly (e.g.
`V1` instead of `B1` for an upper bound on `V`, `W` instead of `C` for
a new value type).
As a side-effect this solves the documentation problem in SI-6947. Due
to using `B` both as a type parameter for `foldLeft[B]` in
`GenTraversableOnce[A]` and in `Map[A, B]` which extends
`GenTraversableOnce[(A, B)]`, the signature of `Map.foldLeft` was
rendered in scaladoc as
def foldLeft[B](z: B)(op: (B, (A, B)) ⇒ B): B
Now you get an unambiguous version:
def foldLeft[B](z: B)(op: (B, (K, V)) ⇒ B): B
|
|\ \ \
| | | |
| | | | |
If Range is sealed, it makes sense to have Range.Inclusive final.
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
SI-9817 Immutable queue formatting
SI-9817 Added comments
SI-9817 Comment formatting
|
|\ \
| | |
| | | |
Merge 2.11 to 2.12 [ci: last-only]
|
| |\| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The kv field of scala.collection.immutable.HashMap.HashMap1 can be null. This
commit corrects the behavior of updated0 (which is on call path for merged) to
work in such cases, instead of throwing NPE.
Commit contains regression test.
|
|\ \ \
| |/ /
|/| | |
Privatize the deprecated members of `immutable.Range`.
|
| | |
| | |
| | |
| | |
| | |
| | | |
`lastElement` is only used in code paths where the range is
non-empty. It is therefore wasteful to try and give it a sort
of sensible value for empty ranges.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The implementation of these obscure members of `Range` are
uselessly complicated for the purposes of `Range` itself.
Making them private will allow to relax their semantics to the
specific needs of `Range`, making them simpler, together with
the initialization code of `Range`.
`terminalElement` becomes dead code and is removed.
|