summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
Commit message (Collapse)AuthorAgeFilesLines
* Remove ICodeSimon Ochsenreither2015-10-311-201/+0
|
* Absolutized paths involving the scala package.Paul Phillips2013-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
* Banish needless semicolons.Jason Zaugg2013-02-241-32/+32
|
* Be explicit about empty param list calls.Jason Zaugg2013-02-241-2/+2
| | | | With the exception of toString and the odd JavaBean getter.
* Expunged the .net backend.Paul Phillips2012-12-051-138/+0
| | | | | | | | It lives on in a branch born from this commit's parent. It's abrupt; no attempt is made to offer a "smooth transition" for the serious msil userbase, population zero. If anyone feels very strongly that such a transition is necessary, I will be happy to talk you into feeling differently.
* Removed unused imports.Paul Phillips2012-11-061-1/+0
| | | | | | | | | A dizzying number of unused imports, limited to files in src/compiler. I especially like that the unused import option (not quite ready for checkin itself) finds places where feature implicits have been imported which are no longer necessary, e.g. this commit includes half a dozen removals of "import scala.language.implicitConversions".
* Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
|
* Eliminate breaking relative names in source.Paul Phillips2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These things are killing me. Constructions like package scala.foo.bar.baz import foo.Other DO NOT WORK in general. Such files are not really in the "scala" package, because it is not declared package scala package foo.bar.baz And there is a second problem: using a relative path name means compilation will fail in the presence of a directory of the same name, e.g. % mkdir reflect % scalac src/reflect/scala/reflect/internal/util/Position.scala src/reflect/scala/reflect/internal/util/Position.scala:9: error: object ClassTag is not a member of package reflect import reflect.ClassTag ^ src/reflect/scala/reflect/internal/util/Position.scala:10: error: object base is not a member of package reflect import reflect.base.Attachments ^ As a rule, do not use relative package paths unless you have explicitly imported the path to which you think you are relative. Better yet, don't use them at all. Unfortunately they mostly work because scala variously thinks everything scala.* is in the scala package and/or because you usually aren't bootstrapping and it falls through to an existing version of the class already on the classpath. Making the paths explicit is not a complete solution - in particular, we remain enormously vulnerable to any directory or package called "scala" which isn't ours - but it greatly limts the severity of the problem.
* update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* Optimization/robustness in the backend.Paul Phillips2012-01-031-7/+7
| | | | | | | | | | Trying to help icode/jvm get through their business a bit faster, and also make things more robust. Less null, more distinguished objects. More encapsulation, fewer public vars. Helping updateSuccessorList() to avoid assembling a list of successors on every call only to find most of the time that it's the same list it already had (e.g. compiling quick.lib it says "59076 calls, 690 requiring allocation" rather than 59076 calls, 59076 requiring allocation.)
* Fix documentation stutters.Blair Zajac2011-12-061-1/+1
|
* Fix/workaround for inliner bug uncovered by fin...Paul Phillips2011-07-271-1/+6
| | | | | | | | | | Fix/workaround for inliner bug uncovered by finalizing Option methods. Something in the backend is leaving open but empty blocks in the worklist. Rather than freaking out at the merest mention of an empty block, I quietly remove the empty ones. A proper fix will involve not leaving empty blocks lying around but we're on a schedule here people. Review by dragos.
* Imported sbt.Process into trunk, in the guise o...Paul Phillips2011-01-121-2/+2
| | | | | | | | | | | | | | | | | | | Imported sbt.Process into trunk, in the guise of package scala.sys.process. It is largely indistinguishable from the version in sbt, at least from the outside. Also, I renamed package system to sys. I wanted to do that from the beginning and the desire has only grown since then. Sometimes a short identifier is just critical to usability: with a function like error("") called from hundreds of places, the difference between system.error and sys.error is too big. sys.error and sys.exit have good vibes (at least as good as the vibes can be for functions which error and exit.) Note: this is just the first cut. I need to check this in to finish fixing partest. I will be going over it with a comb and writing documentation which will leave you enchanted, as well as removing other bits which are now redundant or inferior. No review.
* More elimination of avoidable calls to List#len...Paul Phillips2010-12-211-8/+7
| | | | | More elimination of avoidable calls to List#length. No review.
* This commit is about not calling .length or .si...Paul Phillips2010-12-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is about not calling .length or .size on Lists. Sometimes it is unavoidable; not often. I created some methods for the compiler which should probably be in the collections, which do things like test if two sequences have the same length in a more efficient manner than calling length on each. Also, wouldn't it be wonderful to have some mechanism for finding these issues in a more automated way. Like say an annotation: LinearSeqLike { @badjuju("Calling length on linear seqs is O(n)") def length: Int = whee } Or since I imagine everyone thinks they're calling length with lists of 2 or 3, an optional runtime check which yelled if it sees you calling length on a 600 element list, or worse: var i = 0 while (i < myList.length) { // you don't want to see what this does f(myList(i)) ; i += 1; } Uniformity of interface without uniformity of behavior leaves us with traps. No review.
* I'm wandering around trunk looking for slowness.Paul Phillips2010-12-201-28/+22
| | | | | | | | | | | | | | | | | are constant distractions which I've meant forever to fix anyway, such as the importing of collection.mutable._ (or any other package with lots of reused names.) Why is this relevant to performance? Well, var x = new HashSet[Int] What's that? What does 'x += 1' mean? These are questions we can all live without. There's almost nothing left which references HashSet or HashMap or Stack or other ambiguous classes without a qualifier: I can finish trunk but I can't keep it clean on my own. (Where should I be writing this stuff down, I wonder.) No review.
* Mopping up after the deprecation of exit and er...Paul Phillips2010-12-051-2/+2
| | | | | | | | | | | | | | Mopping up after the deprecation of exit and error. It is decidedly non-trivial (at least for the IDE-impaired) to be completely sure of which error function was being called when there were about twenty with the same signature in trunk and they are being variously inherited, imported, shadowed, etc. So although I was careful, the possibility exists that something is now calling a different "error" function than before. Caveat programmer. (And let's all make it our policy not to name anything "error" or "exit" from here on out....) No review.
* This is work on -Ycheck:icode.Paul Phillips2010-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | distribution can now be built with that option, with or without optimization, and almost all tests cases can. (Those which can't are due to different -Ycheck: issues.) Major changes of interest are as follows: * LOAD_EXCEPTION and THROW are parameterized on the throwable symbol. * Does not squash all traits down to AnyRef, but instead deals with issues as they arise. By observation the cases where one needs a "Foo with Product" to manifest as both a "Foo" and a "Product" at different places are quite rare, so we need not throw out the whole baby. * Exception handlers now have positions. * The remaining checker failures removed, such as CALL_METHOD wanting to pop a value off the stack after calling a constructor. * Many multiply defined values such as REFERENCE(ObjectClass) put in one place (ICodes.scala) and reused. * -Ycheck:icode output (if also given -Ydebug) worthy of Michelangelo. Here is a class and the -Ycheck:icode -Ydebug output for f's block. class A { def f(x: Int, y: String) = try println(x + y.length) catch { case x: NullPointerException => () } } ** Checking Block 4 [S: 3, 2] [P: 1] <closed> 1-> REF(singleton class Predef) 3 + LOAD_MODULE object Predef 2-> INT 3 + LOAD_LOCAL(value x) 3-> REF(class String) 3 + LOAD_LOCAL(value y) 2<- REF(class String) 3 - CALL_METHOD java.lang.String.length (dynamic) 3-> INT 3 + CALL_METHOD java.lang.String.length (dynamic) 2<- INT 3 - CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - """ 2-> INT 3 + CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - BOX INT 2-> REF(class Integer) 3 + BOX INT 1<- REF(class Integer) 3 - CALL_METHOD scala.Predef.println (dynamic) 0<- REF(singleton class Predef) 3 - CALL_METHOD scala.Predef.println (dynamic) Review by dragos (I marked the specific spots I thought of interest with "PP to ID" which makes it sound like I'm talking to my primal self. Next week on programmer theater: "PP to SUPEREGO.")
* Removed more than 3400 svn '$Id' keywords and r...Antonio Cunei2010-05-121-1/+0
| | | | | Removed more than 3400 svn '$Id' keywords and related junk.
* Leveraged -Xmigration to burn off some warts wh...Paul Phillips2010-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Leveraged -Xmigration to burn off some warts which arose in the new collections. Warnings put in place for behavioral changes, allowing the following. 1) Buffers: create new collections on ++ and -- like all the other collections. 2) Maps: eliminated never-shipped redundant method valuesIterable and supplied these return types: def keys: Iterable[A] def keysIterator: Iterator[A] def values: Iterable[B] def valuesIterator: Iterator[B] def keySet: Set[A] I concluded that keys should return Iterable because keySet also exists on Map, and is not solely in the province of Maps even if we wanted to change it: it's defined on Sorted and also appears in some Sets. So it seems sensible to have keySet return a Set and keys return the more general type. Closes #3089, #3145. Review by odersky.
* Took a swing at sorting out sorting.Paul Phillips2010-02-021-1/+1
| | | | | | | | | | | | rewriting the Sorting methods to accept Orderings and adding a sorted method to SeqLike, because we should all be pretty tired of writing ".sortWith(_ < _)" by now. I think it should be called "sort", not "sorted", but that refuses to coexist gracefully with the deprecated sort in List. Review by moors (chosen pretty arbitrarily, someone at epfl should review it but I don't know who deserves the nomination.)
* fix msil code generation for exception handlers.Lukas Rytz2009-12-011-2/+140
|
* switch to unnested packages.Martin Odersky2009-07-241-1/+3
|
* In "Iterable" and in all its subclasses, "itera...Gilles Dubochet2009-05-271-1/+1
| | | | | | In "Iterable" and in all its subclasses, "iterator" replaces "elements" (and assorted changes).
* massive new collections checkin.Martin Odersky2009-05-081-3/+4
|
* unify mutable and immutable stacks behavior (#957)stepancheg2008-06-061-1/+0
|
* Updated outdated comment.Iulian Dragos2007-07-121-1/+0
|
* Fixed linearization order and a small inefficie...Iulian Dragos2007-07-111-2/+8
| | | | | | Fixed linearization order and a small inefficiency regarding null literals
* deprecated &f, .f, requires.Martin Odersky2007-06-051-5/+5
| | | | | Added existential types.
* Major rewrite of optimization phases.Iulian Dragos2007-03-211-0/+25
|
* Fixed bugs 570/571.v2.1.4Iulian Dragos2006-05-011-1/+6
|
* performed some renamings in the compiler & libraryMartin Odersky2006-03-091-1/+1
| | | | | | | All -> Bottom AllRef -> Null mixin class -> trait
* use 'mixin/abstract class' instead of 'trait'mihaylov2006-03-041-1/+1
|
* Refactored ICode and added basic inlining capab...Iulian Dragos2006-02-141-0/+9
| | | | | Refactored ICode and added basic inlining capabilities.
* Added option '-Xlinearizer:<lin>' and made 'rev...Iulian Dragos2006-01-201-1/+70
| | | | | | | Added option '-Xlinearizer:<lin>' and made 'reverse post order' the default linearization strategy, to greatly improve performance on java 1.4
* (no commit message)Martin Odersky2006-01-071-1/+1
|
* Switching to the new build system and to the ne...Gilles Dubochet2005-12-191-0/+89
Switching to the new build system and to the new build system. This is a MAJOR commit, so be careful when updating.