summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Improving error message.Paul Phillips2012-02-281-5/+15
| | | | | Hacked filename into message to alleviate meaningless "_$1 defined twice" error condition. References SI-4893.
* Specialized NonLocalReturnControl.Paul Phillips2012-02-2711-56/+60
| | | | From the extempore archive of already implemented things.
* Fix for "." appearing on classpath.Paul Phillips2012-02-271-1/+3
| | | | | | Have to pass an empty classpath to java if we put the boot libs on the classpath, otherwise it puts the default "." on there. Closes SI-5528.
* Merge pull request #243 from jsuereth/fix-deployJosh Suereth2012-02-271-1/+1
|\ | | | | Fixed deploy script for nightly
| * Fixed deploy script for nightlyJosh Suereth2012-02-271-1/+1
| |
* | Merge remote-tracking branch 'hubertp/issue/5527-workaround' into developPaul Phillips2012-02-271-6/+7
|\ \
| * | Workaround for scaladoc bug SI-5527 that crashes the build when mixed with ↵Hubert Plociniczak2012-02-271-6/+7
| | | | | | | | | | | | range positions
* | | Some logging cleanup.Paul Phillips2012-02-2613-82/+82
| | | | | | | | | | | | | | | Quieting things down. Fixed some things revealed by quieter logs, like forwarders being generated for superaccessors.
* | | Toward a higher level abstraction than atPhase.Paul Phillips2012-02-2534-209/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I guess these are self-explanatory. @inline final def afterErasure[T](op: => T): T = afterPhase(currentRun.erasurePhase)(op) @inline final def afterExplicitOuter[T](op: => T): T = afterPhase(currentRun.explicitouterPhase)(op) ... @inline final def beforeTyper[T](op: => T): T = beforePhase(currentRun.typerPhase)(op) @inline final def beforeUncurry[T](op: => T): T = beforePhase(currentRun.uncurryPhase)(op) This commit is basically pure substitution. To get anywhere interesting with all the phase-related bugs we have to determine why we use atPhase and capture that reasoning directly. With the exception of erasure, most phases don't have much meaning outside of the compiler. How can anyone know why a block of code which says atPhase(explicitouter.prev) { ... } needs to run there? Too much cargo cult, and it should stop. Every usage of atPhase should be commented as to intention. It's easy to find bugs like atPhase(uncurryPhase.prev) which was probably intended to run before uncurry, but actually runs before whatever happens to be before uncurry - which, luckily enough, is non-deterministic because the continuations plugin inserts phases between refchecks and uncurry. % scalac -Xplugin-disable:continuations -Xshow-phases refchecks 7 reference/override checking, translate nested objects uncurry 8 uncurry, translate function values to anonymous classes % scalac -Xshow-phases selectivecps 9 uncurry 10 uncurry, translate function values to anonymous classes Expressions like atPhase(somePhase.prev) are never right or are at best highly suboptimal, because most of the time you have no guarantees about what phase precedes you. Anyway, I think most or all atPhases expressed that way only wanted to run before somePhase, and because one can never be too sure without searching for documentation whether "atPhase" means before or after, people err on the side of caution and overshoot by a phase. Unfortunately, this usually works. (I prefer bugs which never work.)
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'heathermiller/issue/5522' and ↵Paul Phillips2012-02-2513-3443/+4821
|\ \ \ \ | | | | | | | | | | | | | | | 'heathermiller/issue/5523' into develop
| | * | | Added updated ForkJoinPool, w/ necessary updates to Scala Actors.Heather Miller2012-02-2511-3442/+4810
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes Doug Lea's updates to ForkJoinPool, as of January 25th, 2012. Details of the changes and performance improvements available at: http://markmail.org/message/323vxzn6irkk5yrg. The ForkJoinPool used in this commit comes from the most recent JSR166y. Additionally, also included are minimal changes to parts of the Scala Actors library which interface with the ForkJoinPool, as the ForkJoinPool's interface has changed (prior to the release of Java 7) since we last updated it for the Scala 2.8 release. Of note- this is part of the planned overhaul of scala.concurrent, and corresponds to ticket SI-5523. For testing this was built on JDK 1.6, and passes all tests on both JDK 1.5 and 1.6. A new forkjoin.jar is necessary prior to applying these changes. Using this source, the new jar can be built by running: ant newforkjoin forkjoin.done This creates a new forkjoin.jar in build/libs/. It must replace lib/forkjoin.jar.
| * | | | Improvement to API docs: GenTraversableLike and List. Fixes SI-5522.Heather Miller2012-02-252-1/+11
| |/ / /
* / / / Mainstreaming phase awareness.Paul Phillips2012-02-255-8/+104
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As I peer into various longstanding crashes involving specialization, mixin composition, and super calls, I find a very common reason for logic to go wrong is ignoring or misusing atPhase. This is hardly surprising given how much of a secret black art the whole process of atPhase-ing is. I predict with some confidence that at least half the calls to atPhase in the compiler are at best unnecessary and more likely wrong; similarly, we are missing at least as many calls in other places. Herein we find the following: 1) log messages now include not only the current "at" phase, which in isolation was very confusing because it means what is logged is dependent on the arbitrary jumps performed by atPhase, but the entire "phase stack", anchored by the "global phase". The leftmost phase is the global phase, the one set in Global which proceeds in a predictable fashion from parser to terminal. That's the one we usually mean when we talk about during which phase something happens. The others (prefixed with an arrow) are calls to atPhase which have not yet returned. // example, assuming we've given -Ylog:expl scala> atPhase(currentRun.explicitouterPhase)(log("hi mom")) [log terminal(->typer ->explicitouter)] hi mom 2) A message will be logged if either the globalPhase matches, or the current "at" phase does. So -Ylog:erasure will log all the messages from the phase we think of as erasure, and also all those from any phase run inside of atPhase(erasurePhase) { ... } (except for times when that block uses atPhase to alter the phase yet again - it only looks at the top of the atPhase stack.) // example % scalac -Ydebug -Ylog:refchecks foo.scala [log refchecks] overriding-pairs? method size in trait TraversableOnce ... [log mixin(->refchecks)] rebindsuper trait GenTraversable <none> <notype> false 3) A number of debug/power oriented functions. All of these limit their results to phase transitions during which some change took place, as measured by the result of `op`, compared with ==. def afterEachPhase[T](op: => T): List[(Phase, T)] def changesAfterEachPhase[T](op: => List[T]): List[ChangeAfterPhase[T]] def logAfterEveryPhase[T](msg: String)(op: => T) def describeAfterEachPhase[T](op: => T): List[String] def describeAfterEveryPhase[T](op: => T): String def printAfterEachPhase[T](op: => T): Unit Some examples: scala> printAfterEachPhase(ListClass.info.members.size) [after 1/parser ] 219 [after 11/tailcalls ] 220 [after 12/specialize ] 322 [after 14/erasure ] 361 [after 18/flatten ] 357 scala> printAfterEachPhase(termMember(PredefModule, "implicitly").defString) [after 1/parser ] def implicitly[T](implicit e: T): T [after 10/uncurry ] def implicitly[T](e: T): T [after 14/erasure ] def implicitly(e: Object): Object Try this at home: scala> changesAfterEachPhase(ListClass.info.nonPrivateMembers map (_.defString)) foreach println
* | | Better fix for memory leaks in the presentation compiler. Switched to ↵Iulian Dragos2012-02-242-1/+2
| | | | | | | | | | | | perRunCaches and call clearAll from the presentation compiler
* | | -Xplugin value passed by the Eclipse IDE are incorrectly parsed when itMirco Dotta2012-02-241-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | contains whitespaces. Assume -Xplugin is given the value C:\Programs Files\plugins\Aplugin.jar C:\Programs Files\plugins\Bplugin.jar Calling ``tryToSetFromPropertyValue`` with the above value will always result in a total mess, no matter what, because it will split the string at whitespaces. The proposed solution is to change the implementation of ``tryToSetFromPropertyValue`` to use `,` (comma) as the splitting character Further, I'm quite convinced that the current implementation of ``MultiStringSetting.tryToSetFromPropertyValue`` has never worked, that is why I did not create an overload of ``tryToSetFromPropertyValue`` where the splitting character (or string) can be passed as argument. There is also an Eclipse Scala IDE associated to this issue: http://scala-ide-portfolio.assembla.com/spaces/scala-ide/tickets/1000917
* | Fleshed out the @elidable documentation.Paul Phillips2012-02-231-15/+43
| |
* | Merge remote-tracking branch 'szabolcsberecz/SI-5215' into developPaul Phillips2012-02-231-4/+7
|\ \
| * | update api docs for @elidable to match the behaviour more closely.Szabolcs Berecz2012-02-231-4/+7
| | |
* | | Followed up on two aged todos.Paul Phillips2012-02-231-65/+60
|/ / | | | | | | | | | | | | | | | | | | | | | | // to avoid infinite expansions. todo: not sure whether this is needed Survey says: if it's needed, more evidence is needed. // TODO: this should be simplified; in the stable case, one can probably // just use an Ident to the tree.symbol. Why an existential in the non-stable case? My answers are in comment form herein. I simplified as much as I was able.
* | Make partest not fail over code.jar's placement.Paul Phillips2012-02-231-3/+5
| |
* | One more to derive trees.Paul Phillips2012-02-2316-66/+99
| | | | | | | | | | | | ClassDefs, CaseDefs, and LabelDefs. Dotting eyes, crossing tees. Point of diminishing returns is reached, declare victory and withdraw.
* | Methods to derive ValDefs and Templates.Paul Phillips2012-02-2315-64/+97
|/ | | | | | It's a lot like the last one. I also found trees being duplicated before being sent to the tree copier. Looks like xerox has gotten a mole in here. Trust no one.
* Methods to derive new DefDefs.Paul Phillips2012-02-2313-109/+116
| | | | | | | | | | | I guess I'd seen DefDef(mods, name, tparams, vparamss, tpt, rhs) one too many times and went a little crazy. What do you prefer: - val DefDef(mods, name, tparams, vparamss, tpt, rhs) = tree1 - treeCopy.DefDef(tree1, mods, name, tparams, vparamss, tpt, transform(rhs)) + deriveDefDef(tree1)(transform) Me too.
* One last nudge for elidable.Paul Phillips2012-02-224-2/+8
| | | | | A method with return type Nothing elides into a call to ??? . It's the role ??? was born for.
* Reworked and restored elidable.Paul Phillips2012-02-222-115/+102
| | | | | | | | | | | | Found a better elidable implementation which is robust against other parts of the compiler doing their things. Calls to elidable methods are replaced with zero of the same type. Elidable methods themselves remain in place, but with their body replaced with a zero of the method return type. Thus is everything to be found where it is expected to be found, but nothing will be found where nothing ought to be found. Nothing of course will never be found.
* Revert recent elidable commits.Paul Phillips2012-02-223-31/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | On epfl jenkins, elidable.scala fails with: [partest] java.lang.VerifyError: (class: Test$, method: main signature: ([Ljava/lang/String;)V) Unable to pop operand off an empty stack [partest] [partest] at Test.main(elidable.scala) Strangely it is fine for me on OSX with either apple's jvm or openjdk. Since tests were not running for a while I don't know which of the recent elidable commits is responsible, so given present time demands all I can do is revert them all. Revert "Fix for SI-5215: scalac crash when @elidable used in trait" This reverts commit 5e52ce9a13f12ef159e25ac80c6be2803ec48950. Revert "Fix for SI-5215 part 2: generate return value when eliding method calls" This reverts commit 61c9b4f01d99a81e15391b270bd1b5a895f65ffd. Revert "Eliminating duplication in zero creation." This reverts commit fbb7865e137e83660257fdc79d19d29ff39c775b. Revert "Disallow eliding when Nothing is expected" This reverts commit f26a47c4e8bda2f6c689b4e9b0bb5c64ccf4c699.
* More use of perRunCaches.Paul Phillips2012-02-226-18/+14
| | | | | | | In SpecializeTypes and beyond. It is hard for me to say with confidence what might affect the IDE for the worse, but this is all intended for the IDE's benefit (if only in terms of insurance) and hopefully intention matches reality.
*-. Merge remote-tracking branches 'axel22/feature/benchmarks' and ↵Paul Phillips2012-02-221-0/+1
|\ \ | | | | | | | | | 'hubertp/topic/refinedbm'
| | * Deprecate Refined Build Manager.Hubert Plociniczak2012-02-221-0/+1
| | | | | | | | | | | | It contains bugs that we are no longer planning to work on, sbt is a recommended approach (see integration with scala-ide)
* | | Don't populate the concreteSpecMethod set in presentation compiler runs. ↵Iulian Dragos2012-02-221-1/+1
| |/ |/| | | | | | | | | | | This is safe because the presentation compiler never runs the tree transformer (where this map is needed). This is a source of serious memory leaks in the IDE, but it wasn't visible before because the IDE didn't run the info transformers far enough. Interestingly, this is not a leak in batch runs: each element of the set is removed when the tree is transformed. For a nice graph of the effect of this change, see: http://i41.tinypic.com/xe0k7o.jpg
* | Merge remote-tracking branch 'soc/SI-5034' into developPaul Phillips2012-02-211-20/+0
|\ \
| * | Removed dead code in RefChecks.Simon Ochsenreither2012-02-201-20/+0
| | | | | | | | | | | | Closes SI-5034.
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'som-snytt/elide-nothing', ↵Paul Phillips2012-02-211-0/+1
|\ \ \ \ | | | | | | | | | | | | | | | 'szabolcsberecz/SI-5316' and 'szabolcsberecz/SI-5171' into develop
| * | | | Disallow eliding when Nothing is expectedSom Snytt2012-02-211-0/+1
| |/ / /
* / / / Added the SYNTHETIC flag for BRIDGE methods. The Eclipse Java compiler ↵Iulian Dragos2012-02-211-1/+1
|/ / / | | | | | | | | | complains about duplicate methods otherwise.
* | | Eliminating duplication in zero creation.Paul Phillips2012-02-202-29/+24
| | |
* | | Merge remote-tracking branches 'jsuereth/2.10.0-milestones' and ↵Paul Phillips2012-02-201-0/+14
|\ \ \ | | | | | | | | | | | | 'szabolcsberecz/SI-5215' into develop
| * | | Fix for SI-5215 part 2: generate return value when eliding method callsSzabolcs Berecz2012-02-201-0/+14
| |/ /
* | | Speed up deployment using combined deploy settings.Josh Suereth2012-02-201-36/+10
| | |
* | | Fixed POM for sonatypes standards.v2.10.0-M2Josh Suereth2012-02-208-0/+96
| | |
* | | Added the ability to publish signed artifacts.Josh Suereth2012-02-201-2/+102
| | |
* | | Javadoc + Source jar generation is now complete for maven deployment.Josh Suereth2012-02-202-30/+40
|/ /
* | A better error message for inheritance conflict.Paul Phillips2012-02-191-1/+9
| | | | | | | | | | | | And some tests for pending. Closes SI-5358.
* | Streamlining skolemization, specialization.Paul Phillips2012-02-196-58/+75
| | | | | | | | | | | | Skolemization code doesn't belong in Typers. I carved out a little place for it. Also simplifications in specialization.
* | Merge remote-tracking branch 'TiarkRompf/SI-5506' into developPaul Phillips2012-02-192-7/+50
|\ \
| * | fixes SI-5506. better cps type propagation for polymorphic and ↵Tiark Rompf2012-02-192-7/+50
| | | | | | | | | | | | multi-argument list methods.
* | | Merge remote-tracking branch 'szabolcsberecz/SI-5215' into developPaul Phillips2012-02-192-15/+6
|\ \ \
| * | | Fix for SI-5215: scalac crash when @elidable used in traitSzabolcs Berecz2012-02-192-15/+6
| | | | | | | | | | | | | | | | The elision is now done by not emitting method calls (it was done by removing the elidable methods).
* | | | Specialize Tuple2 on more types.Paul Phillips2012-02-192-2/+2
|/ / / | | | | | | | | | This one is a no-brainer now.
* | | Fix [@spec A] to correctly induce AnyRef specialization.Erik Osheim2012-02-191-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While [@specialized A] already tries to include specialization, a bug in specializedOn prevented this from happening: any empty list could mean that the type var was unspecialized, or that it was specialized on everything. The fix is to have this function create the full list of symbols in the case where the @specialized annotation doesn't explicitly include any types.