summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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-205-38/+85
| | | | | | | | | | | | 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-199-311/+243
|\ | | | | even more cleanup in Macros.scala
| * pull request feedbackEugene Burmako2012-08-196-101/+87
| |
| * cleanup for macroExpandEugene Burmako2012-08-187-265/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-181-1/+1
|\ \ | | | | | | Fix for community build blocker.
| * | Fix for community build blocker.Paul Phillips2012-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | | SI-5788 correct test and symbol updateVlad Ureche2012-08-191-2/+3
|/ / | | | | | | | | | | 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
* | | 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-175-402/+347
|\ \ | | | | | | more cleanup in Macros.scala
| * | more cleanup for typedMacroBodyEugene Burmako2012-08-174-245/+197
| | |
| * | shaves more than 150 lines off typedMacroBodyEugene Burmako2012-08-175-268/+276
| | |
| * | 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-172-3/+14
| | | | | | | | | | | | | | | | | | | | | 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-172-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | 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-161-0/+12
|\ \ | |/ |/| 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-081-0/+12
| | | | | | | | rather than MutableList.
* | Merge pull request #1141 from VladUreche/issue/asmVlad Ureche2012-08-161-56/+81
|\ \ | | | | | | Fixes backend crash due to incorrect consumedTypes
| * | Fixes backend crash due to incorrect consumedTypesVlad Ureche2012-08-151-56/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This started out as a compiler crash after Greg copied the comprehension methods to List and made them final. The culprit was the dead code elimination phase, which after sweeping pieces of code was unable to restore the stack to its original state, thus causing the ASM backend to crash notifying the resulting bytecode is incorrect. The dead code elimination phase uses the icode Instructions' consumedTypes to determine what needs to be dropped from the stack when an instruction is eliminated, but the consumedTypes were only defined for a handful of instructions. So dce encountered a DUP instruction for which it did not have consumedTypes defined and did not restore the stack correctly. The consumedTypes/producedTypes for icode instructions are redundantly defined in 3 separate places: - Opcodes.scala (consumedTypes/producedTypes) - ICodeCheckers.scala (for checking icode) - TypeFlowAnalysis.scala (for computing types on the stack at each program point) Since the Opcodes types are the only ones visible outside, I suggest we use them in ICodeCheckers.scala and TypeFlowAnalysis.scala too. But we should make such changes after the release, as we're chilling out by the lake with a glass of good wine: SI-6234 The relevant discussion around it can be found at: https://groups.google.com/forum/?fromgroups#!topic/scala-internals/qcyTjk8euUI[1-25] Many thanks to Paul for his help! Review by @magarciaEPFL or @paulp.
* | | Merge pull request #1145 from scalamacros/topic/cleanupEugene Burmako2012-08-1666-513/+232
|\ \ \ | | | | | | | | cleanup of reflection and macros
| * | | pull request feedbackEugene Burmako2012-08-161-1/+1
| | | |
| * | | more macro cleanupEugene Burmako2012-08-161-39/+11
| | | |
| * | | further cleanup of transformTypeTagEvidenceParamsEugene Burmako2012-08-151-14/+23
| | | |
| * | | macroImplSigs => macroImplSigEugene Burmako2012-08-151-44/+14
| | | | | | | | | | | | | | | | | | | | We no longer have multiple canonical signatures for macro implementations, so it was time to put the List-List-List-based logic to rest.
| * | | Dominik's comments on api.MirrorsEugene Burmako2012-08-151-3/+3
| | | |
| * | | phaseId(currentPeriod) >= erasurePhase.idEugene Burmako2012-08-151-3/+1
| | | | | | | | | | | | | | | | Simplifies this expression found in Typers to just phase.erasedTypes.
| * | | materializeImplicit and implicitsOfExpectedTypeEugene Burmako2012-08-151-10/+7
| | | | | | | | | | | | | | | | | | | | Previously these guys were coupled in a single method. Now they are separated. In my opinion that helps understanding the stuff going on in implicit search.
| * | | cleanup of reflection- and macro-related stuffEugene Burmako2012-08-1565-399/+161
| | | | | | | | | | | | | | | | | | | | | | | | mostly removes [Eugene] marks that I left back then and reviews related code some of those tokens got left in place, because I don't know to how fix them without imposing risks on 2.10.0
| * | | adds the `skipPackage` attribute to ScaladocEugene Burmako2012-08-151-1/+12
| |/ / | | | | | | | | | | | | Present in http://www.slideshare.net/VladUreche/scaladoc-reflection but not actually implemented in the ant task. Seems to be overlooked.
* | | Merge pull request #1140 from soc/SI-6167Paul Phillips2012-08-151-0/+2
|\ \ \ | | | | | | | | SI-6167 Override SeqLike#isEmpty for better performance
| * | | SI-6167 Override SeqLike#isEmpty for better performanceSimon Ochsenreither2012-08-141-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | This results in a faster Vector#isEmpty (and head, tail, last, init) because it avoids building a VectorIterator just to check if iterator.hasNext is false. Other classes which have not overridden the implementation of SeqLike also benefit from it.
* | | Merge pull request #1114 from scalamacros/topic/is-artifactPaul Phillips2012-08-1510-32/+38
|\ \ \ | |/ / |/| | Introduces the `isArtifact` test for symbols
| * | HIDDEN => ARTIFACTEugene Burmako2012-08-1310-49/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is necessary in the API to tell apart useful synthetic symbols (such as accessors) and low-level compilation artifacts (such as $outer). However `isHidden` (as it's currently named in the compiler) is too generic. Hence I renamed it along with the corresponding flag. Now the test says `isArtifact` and the flag is named ARTIFACT. Despite being an improvement over the first version, `isArtifact` is still a bit unlucky. The name I like is `isImplementationArtifact`, but that's a mouthful to be used in compiler hacking. Moreover, IMPLEMENTATION_ARTIFACT looks weird. For a discussion about related stuff see: http://groups.google.com/group/scala-internals/browse_thread/thread/d04e762127737968 https://github.com/scala/scala/pull/1114
* | | Merge pull request #1137 from scalamacros/topic/ensimeVlad Ureche2012-08-142-0/+28
|\ \ \ | | | | | | | | .ensime template for compiler development
| * | | .ensime template for compiler developmentEugene Burmako2012-08-122-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Provides a template of an .ensime file to be used for compiler hacking together with an ENSIME-enabled text editor. Also includes a readme that outlines what editors support ENSIME. To the best of my knowledge these are Emacs, TextMate, jEdit and Sublime Text 2
* | | | Merge pull request #1136 from ingoem/scaladoc/implicits2.10Adriaan Moors2012-08-146-18/+36
|\ \ \ \ | | | | | | | | | | Add Scaladoc flag to specify hidden implicit conversions
| * | | | Add Scaladoc flag to specify hidden implicit conversionsingoem2012-08-146-18/+36
| | | | |
* | | | | Merge pull request #1134 from adriaanm/patmat-miscAdriaan Moors2012-08-142-25/+25
|\ \ \ \ \ | |/ / / / |/| | | | patmat tweaks: compiler performance, better error on unsupported pattern
| * | | | don't catch StackOverFlowError: kills performanceAdriaan Moors2012-08-141-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead, use a recursion counter in negationNormalForm as in conjunctiveNormalForm (except we only limit recursion depth, not formula-size reuse the same config variable in hopes it'll do for both)
| * | | | don't crash on unsupported pattern -- diagnoseAdriaan Moors2012-08-142-1/+2
| | | | |
* | | | | Merge pull request #1101 from scalamacros/ticket/5940Josh Suereth2012-08-143-250/+315
|\ \ \ \ \ | |/ / / / |/| | | | SI-5940 impls are no longer in macro def pickles
| * | | | accommodated the feedback for the pull requestEugene Burmako2012-08-142-142/+119
| | | | | | | | | | | | | | | | | | | | For the discussion see: https://github.com/scala/scala/pull/1101