summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | SD-275 Further harden against refs to absentee classesJason Zaugg2016-11-296-3/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Limit the strategy of unpickling an external reference to a module class to a lookup of the module var to non-stub owners in order to enable fall through to stub symbol creation. Fixes scala/scala-dev#275
| * | | | | | | SI-8502 Rework handling of stub symbols in unpicklerJason Zaugg2016-11-292-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Rework previous fixes for SI-8502 to move the creation of a term or type stub symbol during unpickling to the initial point of stub creation, based on the tag. - Just set the PACKAGE flag on class stub symbols created during unpickling `ThisType`, rather than bothering with a different subclass of `StubSymbol` for (assumed) packages.
* | | | | | | | Merge pull request #5537 from paplorinc/hashTableIndexJason Zaugg2016-11-302-59/+194
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Optimized HashTable.index
| * | | | | | | | Optimized HashTable.indexPap Lőrinc2016-11-242-7/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (`ops/s`, smaller is better) `Before (9c5d3f8)`: ```scala [info] # Run complete. Total time: 00:08:15 [info] [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 645.594 ± 9.435 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2084.216 ± 37.814 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 19878.481 ± 262.404 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 689.941 ± 5.850 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7357.330 ± 45.956 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95767.200 ± 1550.771 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 509.181 ± 2.683 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5563.301 ± 32.335 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 71965.365 ± 1809.738 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 247.270 ± 3.972 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5646.185 ± 106.172 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 81303.663 ± 954.938 ns/op ``` `Changed modulo to bitwise and in hash calculation (4c729fe)`: ```scala [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 631.291 ± 9.269 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2077.885 ± 59.737 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 15458.278 ± 317.347 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 678.013 ± 4.453 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7258.522 ± 76.088 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 94748.845 ± 1226.120 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 498.042 ± 5.006 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5243.154 ± 110.372 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 68194.752 ± 655.436 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 257.275 ± 1.411 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5318.532 ± 152.923 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 79607.160 ± 651.779 ns/op ``` `Optimized HashTable.index (6cc1504)`: ```scala [info] Benchmark (size) Mode Cnt Score Error Units [info] s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 616.164 ± 4.712 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2034.447 ± 14.495 ns/op [info] s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 14712.164 ± 119.983 ns/op [info] s.c.mutable.HashMapBenchmark.get 10 avgt 20 679.046 ± 6.872 ns/op [info] s.c.mutable.HashMapBenchmark.get 100 avgt 20 7242.097 ± 41.244 ns/op [info] s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95342.919 ± 1521.328 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 488.034 ± 4.554 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 4883.123 ± 59.268 ns/op [info] s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 65174.034 ± 496.759 ns/op [info] s.c.mutable.HashMapBenchmark.put 10 avgt 20 267.983 ± 1.797 ns/op [info] s.c.mutable.HashMapBenchmark.put 100 avgt 20 5097.351 ± 104.538 ns/op [info] s.c.mutable.HashMapBenchmark.put 1000 avgt 20 78772.540 ± 543.935 ns/op ``` Summary, i.e. the effect of this PR, according to the benchmarks: * `groupBy` has a `~35%` speedup * `get` didn't change * `getOrElseUpdate` has a `~10%` speedup * `put` has a `~3%` speedup Note: caching the `exponent` to a local private field (`Byte` or `Int`) didn't have any performance advantage (only a minor slowdown was measured, possibly because it's accessed via an interface now)
| * | | | | | | | Changed modulo to bitwise AND in hash calculationPap Lőrinc2016-11-231-52/+17
| | | | | | | | |
* | | | | | | | | Merge pull request #5563 from lrytz/sd259bJason Zaugg2016-11-302-4/+23
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Don't exclude super calls to trait methods from inlining
| * | | | | | | | | Don't exclude super calls to trait methods from inliningLukas Rytz2016-11-292-4/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 8020cd6, the inliner was changed to make sure trait methods bodies are not duplicated into the static super accessors, and from there into mixin forwarders. The check for mixin forwarders was too wide. In `def t = super.m`, where `m` is a trait method annotated `@inline`, we want to inline `m`. Note that `super.m` is translated to an `invokestatic T.m$`. The current check incorrectly identifies `t` as a mixin forwarder, and skip inlining.
* | | | | | | | | | Merge pull request #5554 from retronym/ticket/10009Adriaan Moors2016-11-295-5/+50
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-10009 Fields survive untypecheck/retypecheck
| * | | | | | | | | | SI-10009 Fields survive untypecheck/retypecheckJason Zaugg2016-11-285-5/+50
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some places in the compiler, and many places in macros, use `untypecheck` (aka `resetAttrs`) to strip types and local symbols from a tree before retypechecking it under some different context. The refactoring of the desugaring of vals and vars in Scala 2.12.0 broke an assumption in this facility. When a ValDef must be split into multiple members (e.g. a field and a getter, or a perhaps also a setter), the ValDef that was parsed assumes the role of the `field`, and the trees for other members are stached by `Namer` to the `synthetics` map of the compilation unit, in order to spliced into the right statement list by typechecking. See `enterGetterSetter` for more details. However, the parsed ValDef is now used verbatim, carrying the meaning (ie, the symbol) of the `private[this]` field. This tree now had an inconsistency between the flags in `tree.mods.flags` and `tree.symbol.flags`. `tree.name` also differed from `tree.symbol.name` (the latter was renamed to be a local name, ie one with a trailing space.) When `ResetAttrs` stripped off the symbol and we retypechecked, we'd end up with two symbols in scope with the same name. In the first from the `run` test: ``` ================================================================================ { class a extends scala.AnyRef { def <init>(): a = { a.super.<init>(); () }; private[this] val x: Int = 42; <stable> <accessor> def x: Int = a.this.x }; new a() } { class a extends scala.AnyRef { def <init>() = { super.<init>(); () }; val x = 42; // oops, the name is "x" rather than "x " and we've missing `private[this]`! <stable> <accessor> def x: Int = a.this.x }; new a() } scala.tools.reflect.ToolBoxError: reflective typecheck has failed: x is already defined as value x ``` This commit uses the flags and name of the symbol in `typedValDef`. I've also had to modify the internals of `CodePrinter` to use the implicit, override, and deferred flags from the modifiers of an accessor when recovering pre-typer tree for a ValDef.
* | | | | | | | | | Merge pull request #5536 from retronym/ticket/SD-268Adriaan Moors2016-11-293-15/+33
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Fix more compiler crashes with fields, refinement types
| * | | | | | | | | | Fix more compiler crashes with fields, refinement typesJason Zaugg2016-11-213-15/+33
| | |_|_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same manner as scala/scala-dev#219, the placement of the fields phase after uncurry is presenting some challenges in keeping our trees type correct. This commit whacks a few more moles by adding a casts in the body of synthetic methods. Fixes scala/scala-dev#268
* | | | | | | | | | Merge pull request #5506 from retronym/topic/existential-idsAdriaan Moors2016-11-2911-16/+30
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Avoid name table pollution with fresh existentials
| * | | | | | | | | | Avoid name table pollution with fresh existentialsJason Zaugg2016-11-0811-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During large compilations runs, the large numbers of globally unique fresh names for existentials captured from prefixes of `asSeenFrom`. is a) somewhat wasteful (all these names are interned in the name table) , and, b) form a pathological case for the current implementation of `Names#hashValue`, which leads to overfull hash-buckets in the name table. `hashValue` should probably be improved, but my attempts to do so have shown a small performance degradation in some benchmarks. So this commit starts by being more frugal with these names, only uniquely naming within an `asSeenFrom` operation. References scala/scala-dev#246
* | | | | | | | | | | Merge pull request #5407 from som-snytt/issue/9557Adriaan Moors2016-11-292-2/+2
|\ \ \ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / / / |/| | | | | | | | | | SI-9557 Backquoted id spec
| * | | | | | | | | | SI-9557 Backquoted id specSom Snytt2016-11-152-2/+2
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | |
* | | | | | | | | | Merge pull request #5561 from retronym/topic/merge-2.11.x-to-2.12.x-20161129Lukas Rytz2016-11-294-4/+13
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / |/| | | | | | | | | Merge 2.11.x to 2.12.x [ci: last-only]
| * | | | | | | | | Merge commit '57290a1' into topic/merge-2.11.x-to-2.12.x-20161129Jason Zaugg2016-11-293-3/+12
| |\ \ \ \ \ \ \ \ \ | | | |_|_|_|_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: spec/_layouts/default.yml test/junit/scala/tools/nsc/interpreter/CompletionTest.scala Fixes scala/scala-dev#272
| | * | | | | | | | Merge pull request #5553 from retronym/ticket/SD-271Jason Zaugg2016-11-292-1/+10
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Improve performance of REPL autocompletion
| | | * | | | | | | | Improve performance of REPL autocompletionJason Zaugg2016-11-222-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used to fuzzily match, e.g, `declasses` with `getDeclaredClasses` was exploring fruitless parts of the search space. The enclosed test case was hanging the REPL. This commit improves this by performing a prefix match of the unconsumed input against the current chunk of the candidate before exploring the `inits`. Fixes scala/scala-dev#271
| | * | | | | | | | | Merge pull request #5559 from szeiger/wip/mathjax-httpsAdriaan Moors2016-11-281-2/+2
| | |\ \ \ \ \ \ \ \ \ | | | |/ / / / / / / / | | |/| | | | | | | | Use https links to JS and CSS in the spec when serving from https
| | | * | | | | | | | Use https links to JS and CSS in the spec when serving from httpsStefan Zeiger2016-11-281-2/+2
| | |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spec is published on a server that supports https (https://www.scala-lang.org/files/archive/spec/2.11/) and this comes up as the default in search results (as it should) but the link to MathJAX is hardcoded to http, which prevents any web browser that cares about security from loading it. This commit changes the links to MathJAX and to the Highlight.js stylesheet to be scheme-relative (like the link to JQuery already was).
| * | | | | | | | | Merge commit '35f8908' into topic/merge-2.11.x-to-2.12.x-20161129Jason Zaugg2016-11-290-0/+0
| |\| | | | | | | |
| | * | | | | | | | Merge pull request #5518 from som-snytt/issue/10037-2.11Jason Zaugg2016-11-116-5/+23
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-10037 ASR/LSR switched in ICodeReader
| | | * | | | | | | | [nomerge] SI-10037 ASR/LSR switched in ICodeReaderSom Snytt2016-11-106-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Noticed when inlining from a class file. The test doesn't work because inlining fails with bytecode unavailable due to: ``` scala.reflect.internal.MissingRequirementError: object X in compiler mirror not found. ```
| | * | | | | | | | | Merge pull request #5491 from SethTisue/akka-bumpSeth Tisue2016-11-101-1/+1
| | |\ \ \ \ \ \ \ \ \ | | | |/ / / / / / / / | | |/| | | | | | | | move to latest Akka 2.3.x release
| | | * | | | | | | | move to latest Akka 2.3.x releaseSeth Tisue2016-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Akka 2.3.16 was released in October 2016: http://akka.io/news/2016/10/30/akka-2.3.16-released.html
| * | | | | | | | | | Merge commit '74ed575' into topic/merge-2.11.x-to-2.12.x-20161129Jason Zaugg2016-11-291-1/+1
|/| | | | | | | | | | | |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: scripts/jobs/integrate/bootstrap
| * | | | | | | | | Merge pull request #5511 from SethTisue/stop-no-dont-delete-everything-arghSeth Tisue2016-11-081-1/+1
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | don't mass-delete old nightlies at release time
| | * | | | | | | | | don't mass-delete old nightlies at release timeSeth Tisue2016-11-081-1/+1
| |/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as happened with 2.12.0, for gory details see https://github.com/scala/scala-dev/issues/257 fix suggested by Stefan Zeiger
* | | | | | | | | | Merge pull request #5544 from retronym/ticket/8779Jason Zaugg2016-11-2911-25/+133
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-8779 Enable inlining of code within a REPL session
| * | | | | | | | | | Support inlining under -Yrepl-class-based REPLJason Zaugg2016-11-284-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By marking the wrapper classes as sealed, the inliner will be able to assume finality of defs introduces in the REPL without requiring the user to mark them as `final`, which is an odd thing to do in single line of REPL input.
| * | | | | | | | | | SI-8779 Enable inlining of code within a REPL sessionJason Zaugg2016-11-289-21/+118
| | |_|_|_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The REPL has a long running instance of Global which outputs classfiles by default to a VirtualDirectory. The inliner did not find any of these class files when compiling calls to methods defined in previous runs (ie, previous lines of input.) This commit: - Adds a hook to augment the classpath that the optimizer searches, and uses this in the REPL to add the output directory - Fixes the implementation of `findClassFile` in VirtualDirectory, which doesn't seem to have been used in anger before. I've factored out some common code into a new method on `AbstractFile`. - Fixes a similar problem getSubDir reported by Li Haoyi - Adds missing unit test coverage. This also fixes a bug in REPL autocompletion for types defined in packages >= 2 level deep (with the `:paste -raw` command). I've added a test for this case.
* | | | | | | | | | Merge pull request #5529 from lrytz/sd259Jason Zaugg2016-11-2914-270/+578
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Better inliner support for 2.12 trait encoding
| * | | | | | | | | Clean up the implementation and output of Yopt-log-inlineLukas Rytz2016-11-281-42/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One line per inline request, nested inlines are indented. Log when a rollback happens. Examples: ``` Inline into scala/collection/SeqLike$$anon$2.andThen: inlined scala/collection/SeqLike$$anon$2.andThen. Before: 8 ins, inlined: 8 ins. inlined scala/PartialFunction.andThen$. Before: 20 ins, inlined: 8 ins. inlined scala/PartialFunction.andThen. Before: 31 ins, inlined: 10 ins. ``` and ``` Inline into scala/collection/IterableLike$$anon$1.takeWhile: inlined scala/collection/IterableLike$$anon$1.takeWhile. Before: 8 ins, inlined: 8 ins. inlined scala/collection/TraversableViewLike.takeWhile$. Before: 20 ins, inlined: 8 ins. failed scala/collection/TraversableViewLike.takeWhile. [...] would cause IllegalAccessError [...] rolling back, nested inline failed. ```
| * | | | | | | | | Address review feedbackLukas Rytz2016-11-281-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename `undoLog.run` to `rollback`, use java ArrayList instead of helper methods to copy to an array.
| * | | | | | | | | Better inliner support for 2.12 trait encodingLukas Rytz2016-11-2514-242/+484
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes to the trait encoding came late in the 2.12 cycle, and the inliner was not adapted to support it in the best possible way. In 2.12.0 concrete trait methods are encoded as interface T { default int m() { return 1 } static int m$(T $this) { <invokespecial $this.m()> } } class C implements T { public int m() { return T.m$(this) } } If a trait method is selected for inlining, the 2.12.0 inliner would copy its body into the static super accessor `T.m$`, and from there into the mixin forwarder `C.m`. This commit special-cases the inliner: - We don't inline into static super accessors and mixin forwarders. - Insted, when inlining an invocation of a mixin forwarder, the inliner also follows through the two forwarders and inlines the trait method body. There was a difficulty implementing this: inlining the static static super accessor would copy an `invokespecial` instruction into a different classfile, which is not legal / may change semantics. That `invokespecial` is supposed to disappear when inlining the actual default method body. However, this last step may fail, for example because the trait method body itself contains instructions that are not legal in a different classfile. It is very difficult to perform all necessary checks ahead of time. So instead, this commit implements the ability to speculatively inline a callsite and roll back if necessary. The commit also cleans up the implementation of inliner warnings a little. The previous code would always emit a warning when a method annotated `@inline` was not picked by the heuristics - this was a problem when the callsite in the static super accessor was no longer chosen.
* | | | | | | | | | Merge pull request #5556 from dragos/ticket/10071Iulian Dragos2016-11-2511-65/+147
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | SI-10071 Separate compilation for varargs methods
| * | | | | | | | | Simplify creation of varargs forwarder symbolJason Zaugg2016-11-251-42/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cloning the original symbol in its entirety, rather than cloning its type/value parameters individually. `cloneSymbol` takes care of all the tricky substitutions for us!
| * | | | | | | | | Don’t run the uncurry info transformer on Java symbols.Iulian Dragos2016-11-251-3/+4
| | | | | | | | | |
| * | | | | | | | | SI-10071 Separate compilation for varargs methodsIulian Dragos2016-11-2511-64/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that methods annotated with varargs are properly mixed-in. This commit splits the transformation into an info transformer (that works on all symbols, whether they come from source or binary) and a tree transformer. The gist of this is that the symbol-creation part of the code was moved to the UnCurry info transformer, while tree operations remained in the tree transformer. The newly created symbol is attached to the original method so that the tree transformer can still retrieve the symbol. A few fall outs: - I removed a local map that was identical to TypeParamsVarargsAttachment - moved the said attachment to StdAttachments so it’s visible between reflect.internal and nsc.transform - a couple more comments in UnCurry to honour the boy-scout rule
* | | | | | | | | | Merge pull request #5540 from retronym/ticket/9814Lukas Rytz2016-11-252-1/+30
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | SI-9814 Fix synchronized in specialized overrides
| * | | | | | | | | SI-9814 Fix synchronized in specialized overridesJason Zaugg2016-11-252-1/+30
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialization creates a subclasses of a specializd class for each type parameter combination. These contains copies of the methods from the superclass. However, before this transform, the pattern of self-synchronization in a method body had been replace by flag Flag.SYNCHRONIZED on the method symbol. This was not being propagated to the override, and hence no locking occured. This commit modifies the creation of the specialized overload symbol to copy the SYNCHRONIZED flag, as was already done for ASBOVERRIDE. I have also done the same for the `@strictfp` annotation.
* | | | | | | | | Merge pull request #5480 from SethTisue/remove-reflection-mem-typecheck-testSeth Tisue2016-11-231-28/+0
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-6412 remove flaky test
| * | | | | | | | | SI-6412 remove flaky testSeth Tisue2016-10-261-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have repeatedly seen this fail CI runs, including recently as the comment in the test itself says: "I'm not sure this is a great way to test for memory leaks, since we're also testing how good the JVM's GC is, and this is not easily reproduced between machines/over time"
* | | | | | | | | | Merge pull request #5535 from som-snytt/issue/9945Seth Tisue2016-11-231-1/+1
|\ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ / / |/| | | | | | | | | SI-9945 Don't warn imports in java units
| * | | | | | | | | SI-9945 Don't warn imports in java unitsSom Snytt2016-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scaladoc was prone to warning about java imports.
* | | | | | | | | | Merge pull request #5528 from paplorinc/getOrElseUpdateJason Zaugg2016-11-226-8/+138
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Changed HashMap.getOrElseUpdate to only calculate the index once
| * | | | | | | | | | Changed HashMap.getOrElseUpdate to only calculate the index oncePap Lőrinc2016-11-181-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://issues.scala-lang.org/browse/SI-10049 Since `groupBy` uses this method extensively and suffered a measurable slowdown in `2.12.0`, this modification restores (and exceeds) its original speed. --- included benchmarks: (`ns/op` → smaller is better) `before (2.12.0):` ```java Benchmark (size) Mode Cnt Score Error Units s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 865.693 ± 7.869 ns/op s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 3095.657 ± 56.438 ns/op s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 28247.005 ± 470.513 ns/op s.c.mutable.HashMapBenchmark.get 10 avgt 20 679.448 ± 11.809 ns/op s.c.mutable.HashMapBenchmark.get 100 avgt 20 7240.178 ± 61.734 ns/op s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95725.127 ± 2373.458 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 836.561 ± 20.085 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 7891.368 ± 56.808 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 97478.629 ± 1782.497 ns/op s.c.mutable.HashMapBenchmark.put 10 avgt 20 243.422 ± 2.915 ns/op s.c.mutable.HashMapBenchmark.put 100 avgt 20 5810.927 ± 60.054 ns/op s.c.mutable.HashMapBenchmark.put 1000 avgt 20 82175.539 ± 1690.296 ns/op ``` `after:` ```java Benchmark (size) Mode Cnt Score Error Units s.c.immutable.VectorMapBenchmark.groupBy 10 avgt 20 627.007 ± 9.718 ns/op s.c.immutable.VectorMapBenchmark.groupBy 100 avgt 20 2086.955 ± 19.042 ns/op s.c.immutable.VectorMapBenchmark.groupBy 1000 avgt 20 19515.234 ± 173.647 ns/op s.c.mutable.HashMapBenchmark.get 10 avgt 20 683.977 ± 11.843 ns/op s.c.mutable.HashMapBenchmark.get 100 avgt 20 7345.675 ± 41.092 ns/op s.c.mutable.HashMapBenchmark.get 1000 avgt 20 95085.926 ± 1702.997 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 10 avgt 20 503.208 ± 2.643 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 100 avgt 20 5526.483 ± 28.262 ns/op s.c.mutable.HashMapBenchmark.getOrElseUpdate 1000 avgt 20 69265.900 ± 674.958 ns/op s.c.mutable.HashMapBenchmark.put 10 avgt 20 252.481 ± 7.597 ns/op s.c.mutable.HashMapBenchmark.put 100 avgt 20 5708.034 ± 110.360 ns/op s.c.mutable.HashMapBenchmark.put 1000 avgt 20 82051.378 ± 1432.009 ns/op ``` i.e. for the given benchmark conditions `~40%` faster `groupBy` and `getOrElseUpdate`
| * | | | | | | | | | Added benchmarks for Vector and HashMapPap Lőrinc2016-11-182-0/+102
| | | | | | | | | | |
| * | | | | | | | | | Updated benchmark dependenciesPap Lőrinc2016-11-183-8/+5
| | | | | | | | | | |