summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Made all statistic code disappear unless built with Statistics.canEnable = trueMartin Odersky2012-08-2011-123/+138
|
* Partial revert of itransform commit.Martin Odersky2012-08-201-52/+43
| | | | Profile data actually showed a small slowdown in steady state. We keep the reordering but merge all submethods into one.
* Reverted addition of 5 specialized method from LinearSeqOptimized to List.Martin Odersky2012-08-201-56/+0
| | | | It seems any gains were more then compensated by the loss of making map polymorphic, probably preventing inlining decisions in Hotspot.
* Manaul inling of `UndoLog.undoUnless`.Grzegorz Kossakowski2012-08-202-25/+71
| | | | | | | | | | | | | Inline `UndoLog.undoUnless` into `isSubType` and `isSameType` methods. They are responsible for 20% of all Function0 allocations. I had to do manual inlining because inlier doesn't cope with exception handlers well. Let it be noted that I almost cried while doing this ugly change. I'll want to see inliner being fixed so we can revert this change ASAP.
* Optimizations to SymTree and transformMartin Odersky2012-08-202-85/+97
| | | | | | | Two optimizations: (1) Make SymTree a class rather than a trait to allow faster access to symbol (2) Split itransform into several smaller methods and order cases according to expected frequency.
* Specialize hashCode in TypeRef from the generic MurmurHashCode3 implementation.Martin Odersky2012-08-201-1/+15
|
* Moved five methods from LinearSeqOptimized to ListMartin Odersky2012-08-202-58/+56
| | | | | | | | Curiously, profiling showed that these methods (in particular map) got slower when specialized in LinearSeqOptimized from their generic impl in TraversableLike. I speculate that the virtual calls to head/tail/nonEmpty are more expensive than the closure creation which we save (Note that foreach IS specialized in List, so head/tail are monomorphic, even though isEmpty still has two implementations. If we confirm a speedup in this commit it would make sense to specialize more methods in LinearSeqOptimized again in List.
* Don't allocate closure in List.hashCode.Grzegorz Kossakowski2012-08-201-1/+19
| | | | | | | | | | Provided specialized version of hashing algorithm for List that does not allocate the closure. This saves us 124k closures allocated in a compiler when compiling `Vector.scala` from std library. That's aroudn 5% of all closures allocated for that compiler run.
* Rework synchronization scheme of `UndoLog` for performance.Grzegorz Kossakowski2012-08-202-21/+42
| | | | | | | | | Introduced explicit locking mechanism that allows us to make public methods of `UndoLog` that take thunks as arguments final and thus `@inline`. Once inliner is able to cope with inlining methods with exception handlers we'll be able to get rid of significant (around 5%) number of thunk allocation.
* Mark logging methods in `SymbolTable` with `@inline`.Grzegorz Kossakowski2012-08-201-2/+4
| | | | | Those two methods contribute 2% of Function0 allocation when compiling `Vector.scala`.
* Make Array creation more efficient in hot places.Grzegorz Kossakowski2012-08-203-1/+23
| | | | | Overriden ClassTags in places where we allocate a lot of Arrays.
* Optimizations to cut down on #closures createdMartin Odersky2012-08-209-31/+144
| | | | Driven by profile data.
* Made hashCode a method on Type to avoid megamorphic dispatchMartin Odersky2012-08-205-105/+89
| | | | | | | | | profiling data shows that accessing the hashCode field has a cost of about 10% of fully hot running times. We speculate that it's megamorphic dispatch which is costing us this much. Rewrote code so that UniqueType is not an abstract base class with the hashCode field. Also removed fingerPrinting bloom filter on findMember because it caused complexity and did not gain us anything accdoring to the tests. Made TypeVar an abstract case class to avoid extractor calls in TypeMap.
* No longer uses generic hashCode in UniqueType, since case class hashCode is ↵Martin Odersky2012-08-201-1/+1
| | | | now the same and faster.
* Optimization to atOwnerMartin Odersky2012-08-202-8/+16
| | | | Moved costly hashMap updates into SuperAccessors from general tree transformers and replaced by immutable map.
* Replaced isTrivial lazy vals by custom scheme to save space.Martin Odersky2012-08-202-10/+43
|
* Optimizations of isTrivial fields and methodsMartin Odersky2012-08-201-8/+19
|
* More method splittingMartin Odersky2012-08-205-466/+591
|
* Method splitting for erasure, genJVM, parsers, scanners, uncurryMartin Odersky2012-08-206-557/+664
| | | | Also, added inlined List.foreach
* Second part of typed1 optimizationMartin Odersky2012-08-201-280/+349
| | | | All cases factored out into separate methods. Cases ordered according to node frequency.
* First half of typed1 reorganization, to make it smaller and faster.Martin Odersky2012-08-201-111/+141
|
* Splitting large methods into smaller ones.Martin Odersky2012-08-201-432/+482
|
* More method hoisting.Martin Odersky2012-08-2016-84/+113
| | | | | Also avoided systematically to map (_.tpe) on parameters in favor of lazy val paramTypes.
* Compilespeed improvements: Exists arguments and othersMartin Odersky2012-08-206-38/+111
| | | | | | | | | | | | It turns out that exists is not inlinable, even if put into List. We try to eliminate or hoist most closures passed to exists in Types. There are some other small improvements as well. -- (@gkossakowski): This commit contains also a fix to crasher prepared by @paulp. I squashed that commit and kept the test-case that came with it.
* Merge pull request #1159 from scalamacros/topic/cleanupJosh Suereth2012-08-1917-311/+261
|\ | | | | even more cleanup in Macros.scala
| * pull request feedbackEugene Burmako2012-08-196-101/+87
| |
| * cleanup for macroExpandEugene Burmako2012-08-1815-265/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | Error reporting is moved to ContextErrors to disentangle stuff in Macros.scala. With logics and error reporting intertwined it was an awful mess. Exceptions are used for the same reason. Instead of threading failures through the code polluting it with options/ifs, I outline the success path. It worked much better for typedMacroBody, but I'm also happy with the resulting code of macroExpand. To me a major factor towards applicability of exceptions was that they are short-lived and that there might be max one error per domain, after which we unconditionally bail.
* | Merge pull request #1162 from paulp/aug19-scala-graphPaul Phillips2012-08-183-1/+7
|\ \ | | | | | | Fix for community build blocker.
| * | Fix for community build blocker.Paul Phillips2012-08-183-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | As two character bugfixes go, this was a doozy. I will forego elaborating at length and offer generic instructions for elucidation: % git log --grep=tpeHK
* | | Merge pull request #1161 from VladUreche/issue/5788-hackPaul Phillips2012-08-182-5/+5
|\ \ \ | |/ / |/| | SI-5788 correct test and symbol update
| * | SI-5788 correct test and symbol updateVlad Ureche2012-08-192-5/+5
|/ / | | | | | | | | | | Previously I thought it's fixed because I didn't include the correct testcase. Now it's the correct testcase and this prompted me to change the code a bit to make it work properly.
* | Merge pull request #1154 from hubertp/2.10.x-issue/5676-fixPaul Phillips2012-08-172-2/+2
|\ \ | | | | | | Use rawflags for checking FINAL flag.
| * | Use rawflags for checking FINAL flag.Hubert Plociniczak2012-08-172-2/+2
| | | | | | | | | | | | Partially reverts 18efdedfb97de7ca9f6
* | | Merge pull request #1156 from paulp/last-no-successPaul Phillips2012-08-171-6/+12
|\ \ \ | |_|/ |/| | Restored lastNoSuccess to Parsers.
| * | Restored lastNoSuccess to Parsers.Paul Phillips2012-08-171-6/+12
|/ / | | | | | | It was in 2.9.2 and can't be removed without deprecation.
* | Merge pull request #1151 from scalamacros/topic/cleanupEugene Burmako2012-08-1723-422/+392
|\ \ | | | | | | more cleanup in Macros.scala
| * | more cleanup for typedMacroBodyEugene Burmako2012-08-1718-256/+233
| | |
| * | shaves more than 150 lines off typedMacroBodyEugene Burmako2012-08-179-277/+285
| | |
| * | removes dead codeEugene Burmako2012-08-161-20/+5
| |/
* | Merge pull request #1149 from paulp/topic/substmap210Grzegorz Kossakowski2012-08-171-6/+10
|\ \ | | | | | | Topic/substmap210
| * | Optimization in SubstMap.Paul Phillips2012-08-161-6/+10
| |/ | | | | | | | | | | | | | | Don't create a new type with the same symbol. This modification avoids the creation of 30K types and a similar number of symbols in a compile of trunk. Also cleaned up / deprecated a couple other type mappers.
* | Merge pull request #1146 from paulp/topic/coloncolon-allocationsPaul Phillips2012-08-1736-182/+189
|\ \ | | | | | | Hunting down eliminable :: allocations.
| * | Hunting down eliminable :: allocations.Paul Phillips2012-08-1736-183/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this commit, the number of :: allocations logged in total after individually compiling each scala file in src/compiler drops from 190,766,642 to 170,679,925. Twenty million fewer colon-colons in the world, it's a start. For some heavily used lists like List(List()) I made vals so we can reuse the same one every time, e.g. val ListOfNil = List(Nil) The modifications in this patch were informed by logging call frequency to List.apply and examining the heaviest users. >> Origins tag 'listApply' logged 3041128 calls from 318 distinguished sources. 1497759 scala.reflect.internal.Definitions$ValueClassDefinitions$class.ScalaValueClasses(Definitions.scala:149) 173737 scala.reflect.internal.Symbols$Symbol.alternatives(Symbols.scala:1525) 148642 scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.transform(SuperAccessors.scala:306) 141676 scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$specializedOn$3.apply(SpecializeTypes.scala:114) 69049 scala.tools.nsc.transform.LazyVals$LazyValues$$anonfun$1.apply(LazyVals.scala:79) 62854 scala.tools.nsc.transform.SpecializeTypes.specializedTypeVars(SpecializeTypes.scala:427) 54781 scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.transform(SuperAccessors.scala:293) 54486 scala.reflect.internal.Symbols$Symbol.newSyntheticValueParams(Symbols.scala:334) 53843 scala.tools.nsc.backend.icode.Opcodes$opcodes$CZJUMP.<init>(Opcodes.scala:562) ... etc.
* | | Fixes SI-6236.Aleksandar Prokopec2012-08-176-5/+46
| | | | | | | | | | | | | | | | | | | | | In separate compilation runs, the static field symbol in the companion class of an object was not being recreated. Given that the singleton object was compiled separately, the static field symbol will be recreated on demand.
* | | Fixes SI-6189.Aleksandar Prokopec2012-08-175-3/+68
| | | | | | | | | | | | | | | | | | | | | | | | Disable @static for the REPL code. The problem is that there are no companion classes generated for objects that contain the top-level declarations in the REPL. When there is no companion class, the selecting a @static field will translate to a getter call, instead of to a field load.
* | | Merge pull request #1152 from paulp/topic/fix-relative-toolsPaul Phillips2012-08-174-8/+8
|\ \ \ | |/ / |/| | Absolutize tools.nsc => scala.tools.nsc.
| * | Absolutize tools.nsc => scala.tools.nsc.Paul Phillips2012-08-174-8/+8
|/ / | | | | | | | | | | Relative references to scala.tools which omit the "scala" are uncompilable by themselves if you happen to have a directory called "tools" which shadows scala/tools. As we do in trunk.
* | Merge pull request #1093 from jsuereth/fix/SI-6208-2.10.xPaul Phillips2012-08-162-0/+16
|\ \ | |/ |/| Fix SI-6208. mutable.Queue now returns mutable.Queue for collection met...
| * Fix SI-6208. mutable.Queue now returns mutable.Queue for collection methods ↵Josh Suereth2012-08-082-0/+16
| | | | | | | | rather than MutableList.
* | Merge pull request #1141 from VladUreche/issue/asmVlad Ureche2012-08-164-56/+115
|\ \ | | | | | | Fixes backend crash due to incorrect consumedTypes