summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | Changed boxing of free mutable variables to be flexible wrt when liftcode ↵Martin Odersky2012-01-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | takes place. A major redesign that unifies the various different approaches to boxing of free variables. Free variables are marked with CAPTURED and eliminated by LambdaLift. I also added some hooks in MacroContext that a reifier needs to use.
* | | | | | Fix for PartialFunction NPE.Paul Phillips2012-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Was going straight to the field and bypassing the null guard. Closes SI-5300.
* | | | | | Cleanups in Cleanup.Paul Phillips2012-01-072-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seeing about getting delayedInit working (not to mention the breakage it is inflicting elsewhere) which led me into Cleanup and some of its buddies.
* | | | | | Made Array manifests return type arguments.Paul Phillips2012-01-072-3/+3
| |_|/ / / |/| | | | | | | | | | | | | | Closes SI-3758.
* | | | | Init order issue in Manifest toStrings.Paul Phillips2012-01-051-43/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Making -Xcheckinit happy. Then cleaned up the anyval and phantom type manifests once in the neighborhood.
* | | | | More consistent use of Names.Paul Phillips2012-01-053-15/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several large helpings of tedium later, fewer strings are being discarded like so much refuse. Some names now cache a String, but only "named Names", so it's not very many and they pay for themselves pretty quickly. Many fewer name-related implicit conversions now taking place. A number of efficiency related measures.
* | | | | Added forall to Option.Paul Phillips2012-01-031-0/+7
|/ / / / | | | | | | | | | | | | Another salvo in the war against option2Iterable.
* | | | Added option -Xlog-reflective-calls.Paul Phillips2012-01-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A message is emitted when a reflective call is generated. We can now be eager consumers of this since we purged all the reflective calls at some point -- but without a backstop, they have been slipping back in.
* | | | Changed boxing of free mutable variables to be flexible wrt when liftcode ↵Martin Odersky2012-01-021-0/+15
|/ / / | | | | | | | | | | | | | | | takes place. A major redesign that unifies the various different approaches to boxing of free variables. Free variables are marked with CAPTURED and eliminated by LambdaLift. I also added some hooks in MacroContext that a reifier needs to use.
* | | More performance work.Paul Phillips2011-12-301-0/+6
| | | | | | | | | | | | | | | | | | | | | Custom versions of collections which methods which operate on 2 or 3 collections. Eliminated most users of zip/zipped. Cleaned up the kinds checking code somewhat. Reduced the number of silent typechecks being performed at named argument sites.
* | | Low-level optimization.Paul Phillips2011-12-301-3/+4
| | | | | | | | | | | | Eliminated a bunch of unnecessary array expense.
* | | Better hunting for tools.jar.Paul Phillips2011-12-301-0/+5
| | | | | | | | | | | | | | | Attempting to make the repl find it based on fewer clues so all can enjoy the javap goodness.
| | |
| \ \
| \ \
| \ \
*---. \ \ Merge remote-tracking branches 'ijuma/issue/5341', ↵Paul Phillips2011-12-272-0/+45
|\ \ \ \ \ | | | |/ / | | |/| | | | | | | 'kepler/topic/reifyclosuretests', 'kepler/topic/antscalacheck', 'szabolcsberecz/SI-5104', 'kepler/ticket/5334' and 'kepler/topic/miscfixes' into develop
| | | * | Documented emptyValDef fieldEugene Burmako2011-12-231-0/+5
| | |/ /
| * / / fixes #5104 and related NaN ordering inconsistenciesSzabolcs Berecz2011-12-251-0/+40
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was caused by the inconsistency between j.l.Math.min() and j.l.Double.compareTo() wrt NaN (j.l.Math.min() considers NaN to be less than any other value while j.l.Double.compareTo() says it's greater...) The fix changes Ordering.{FloatOrdering,DoubleOrdering) to base it's results on primitive comparisons and math.{min,max} instead of j.l.{Float,Double}.compareTo()
* | | [vpm] better codegen, especially for alternatives (suggested by Tiark)Adriaan Moors2011-12-241-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | factored out some of the optimizing codegen that had snuck into treemakers (guardtreemaker) removed `caseResult`, back to just `one` no longer emitting intermediate `one`s (using guard instead -- when not optimizing) so uncurry can't accidentally blow them away (it removes the `one` that represents the case's result, but should leave intermediate computation alone) still TODO: reusing-treemakers sharing prefixes of length 1 helps inlining suffix of alternatives if small enough
* | | [vpm] optimized codegen avoids option-boxingAdriaan Moors2011-12-241-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introducing two mutable variables per pattern match: matchRes and keepGoing keepGoing denotes whether the result was Some or None, and matchRes holds the Some's contents or the right zero for the match's type Race(() => fastMatch(list), () => virtMatch_no_option(list))(100000).converge() is a virtual tie on my machine after this see https://gist.github.com/1400910 conveniently also works around SI-5245 don't assign to Unit-typed var's, in fact, make matchRes a val when its only prospect in life is to be unit-valued propagate eventual type for matchRes thru codegen so that we can have more robust checks for unit&nothing, when assignment makes no sense also, added a hack to caseResult to avoid boxed units in if(keepGoing) { matchRes = ... } else zero after erasure, we get if(keepGoing) { matchRes = ...; BoxedUNIT } else zero genicode broke because i was sharing trees: [scalacfork] error: java.lang.AssertionError: assertion failed: type error: can't convert from UNIT to REF(class Object) in unit ScalaSig.scala at source-/Users/adriaan/git/scala-dev/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSig.scala,line-26,offset=868 fixed by duplicating -- so be it (for now -- make this more fine-grained, more efficient) dodging inliner issues with one/zero (it won't inline, so also directly inline those methods)
* | Merge remote-tracking branches 'axel22/issue/5293' and ↵Paul Phillips2011-12-195-43/+335
|\ \ | | | | | | | | | 'jsuereth/fix-5053-view-unzip' into develop
| * | unzip(3) on view now returns view.Josh Suereth2011-12-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | * Added unzip and unzip3 to TraversableViewLike * Added partest tests for unzip on views returning specific collection types. Closes SI-5053 Review by @paulp
| * | Restored some methods to List.Paul Phillips2011-12-171-0/+247
| | | | | | | | | | | | | | | Deprecated since 2.8.0 but causing far too much inconvenience by not being present.
| * | Intermediate range commit.Paul Phillips2011-12-161-106/+79
| | | | | | | | | | | | | | | | | | | | | This is not a long-term implementation - I haven't even benchmarked it -- don't worry. I did find a fairly gross bug in the version I checked in a few days ago so I wanted to erase that from the repository memory for the weekend.
| * | Merge remote-tracking branch 'repo/develop'Paul Phillips2011-12-121-0/+1
| |\ \
| | * | Clarify scala.collection.immutable.Map#withDefaultValue() docs.Blair Zajac2011-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | Copy the documentation from Map#withDefault() that get(), contains(), iterator(), and keys() keys are not affected by withDefaultValue().
| * | | Added cast to ParRange.Paul Phillips2011-12-121-1/+1
| | | | | | | | | | | | | | | | To get the same benefit as in Range. Review by @prokpec.
| * | | Range.foreach optimization.Paul Phillips2011-12-121-12/+77
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes code like 0 to 100 foreach (x += _) as fast as (often faster than, in fact) a while loop. See the comment in Range for the gory details. More investigation should be done regarding total impact on inlining behavior. Review by @odersky.
* / / Fix #5293 - changed the way hashcode is improved in hash sets.aleksandar2011-12-192-31/+81
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash code is further improved by using a special value in the hash sets called a `seed`. For sequential hash tables, this value depends on the size of the hash table. It determines the number of bits the hashcode should be rotated. This ensures that hash tables with different sizes use different bits to compute the position of the element. This way traversing the elements of the source hash table will yield them in the order where they had similar hashcodes (and hence, positions) in the source table, but different ones in the destination table. Ideally, in the future we want to be able to have a family of hash functions and assign a different hash function from that family to each hash table instance. That would statistically almost completely eliminate the possibility that the hash table element traversal causes excessive collisions. I should probably @mention extempore here.
| |
| \
| \
| \
*---. | Merge remote-tracking branches 'soc/SI-4990', ↵Paul Phillips2011-12-0724-135/+73
|\ \ \| | | | | | | | | | | | | 'fedgehog/docs_fix_for_scala.Either.cond___SI-5113' and 'kepler/ticket/5266' into develop
| | * | Fix documentation errorfedgehog2011-12-071-4/+4
| | |/
| * / Migration message and version cleanupSimon Ochsenreither2011-12-0723-131/+69
| |/ | | | | | | | | | | | | | | | | | | The @migration annotation can now be used like @deprecation. Old syntax is still supported, but deprecated. Improve wording and consistency of migration messages, migration warnings also print the version in which the change occurred now. Partially fixes SI-4990.
* / Restructed Enumeration a little.Paul Phillips2011-12-071-21/+14
|/ | | | | | Nobody should be deprecating methods without ensuring that the implementation doesn't rely on their existence (and the documentation doesn't still suggest using them.) Made it more internally consistent.
* Merge branch 'master' of /scala/trunk into developPaul Phillips2011-12-061-0/+5
|\
| * Gave Option its own nonEmpty.Paul Phillips2011-12-061-0/+5
| | | | | | | | | | A bit further down Option's slippery slope of collections methods, but those sudden implicit conversions to Iterable are legitimately annoying.
* | Fix documentation stutters.Blair Zajac2011-12-065-5/+5
|/
* Update scaladoc links to collections overview.Josh Marcus2011-12-0628-38/+34
| | | | | | Change scaladoc links in collection classes to point at re-formatted Collections Overview on docs.scala-lang.org. Fix minor typo: s/Ummutable/Immutable
* Enhanced scaladoc of collection classes with links to the relevant pages of ↵Josh Marcus2011-12-0527-0/+68
| | | | "The Scala 2.8 Collections API" overview.
*-. Merge remote-tracking branches 'kepler/topic/reifyclasses' and ↵Paul Phillips2011-12-041-9/+3
|\ \ | | | | | | | | | 'ijuma/feature/signum' into develop
| | * Delegate to Java's implementation of signum for Long and Int.Ismael Juma2011-12-031-9/+3
| |/ | | | | | | | | | | | | | | The Java implementation is faster as it doesn't have branches. java.lang.Math includes implementations of signum for Double and Float, but I didn't change the ones in scala.math because there is a difference on how negative zero is handled.
* / Add a mnemonic to help remember what's the difference between +:Daniel C. Sobral2011-12-042-0/+8
|/ | | | and :+, plus one for ++:.
*-----. Merge remote-tracking branches 'dcsobral/parser/NoSuccessMessages', ↵Paul Phillips2011-12-023-15/+70
|\ \ \ \ | | | | | | | | | | | | | | | 'dcsobral/parserFilter', 'soc/library-range-sum', 'szeiger/feature/enumeration-valueset', 'szeiger/issue/5117' and 'jsuereth/pull-binary-error-message' into develop
| | | * | Make Enumeration.ValueSet SerializableStefan Zeiger2011-12-021-2/+3
| | | | | | | | | | | | | | | | | | | | Closes SI-5117.
| | | * | Enumeration and Enumeration.ValueSet improvementsStefan Zeiger2011-12-021-15/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make Enumeration.ValueSet a SortedSet and back it by a BitSet - Add toBitMask and fromBitMask methods for value sets - Add an Ordering for the values - Deprecate names seq in the Enumeration constructor - Add + method to Value for easy ValueSet creation
| | * | | Makes Range#sum an O(1) operation instead of an O(n) one.Simon Ochsenreither2011-12-021-0/+7
| | |/ / | | | | | | | | | | | | Partially fixes SI-4658. NumericRange stays slow, thanks to the brilliant idea that Numeric doesn't need a division operation.
| * | / Add filter/withFilter method to ParserDaniel Capo Sobral2011-12-021-0/+14
| | |/ | |/| | | | | | | | | | | | | | | | Complement map and flatMap when used in for comprehensions. This is required when pattern matching is used on the result of the generators. It is implemented through a new filterWithError method on ParseResult.
* / | Add withErrorMessage/withFailureMessage to Parser.Daniel C. Sobral2011-12-021-0/+56
|/ / | | | | | | Can be used to reliably override the default no success messages.
* / Improve performance of BitSet.sizeStefan Zeiger2011-12-021-12/+1
|/ | | | | Using java.lang.Long.bitCount for the size computation is a lot faster than the previous Scala implementation. Closes SI-2196.
*-. Merge commit 'e21c05'; commit '8b8ed9'; commit '335da6'; commit '5d7da7' ↵Paul Phillips2011-12-011-1/+2
|\ \ | | | | | | | | | into develop
| | * Example in scala.sys.process didn't match the text that describes it. Fixed.Daniel C. Sobral2011-12-011-1/+2
| |/
* / Fix typo on Regex documentation.Daniel C. Sobral2011-12-011-1/+1
|/
*-. Merge remote-tracking branches 'remotes/odersky/master', ↵Paul Phillips2011-12-017-20/+113
|\ \ | | | | | | | | | 'remotes/odersky/topic/reify', 'remotes/robinst/master' and 'remotes/szeiger/bitset' into pending
| | * Improved BitSet implementationsStefan Zeiger2011-12-016-20/+111
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | - Mutable and immutable BitSets now extend SortedSet, using a fixed Ordering.Int and an efficient bit mask based rangeImpl() - fromArray methods in both implementations are deprecated in favor of new fromBitMask and fromBitMaskNoCopy methods - New toBitMask method for converting bit sets back to Array[Long] bit masks - immutable.BitSet uses a more efficient Builder, based on mutable.BitSet (closes SI-4647) - Delete scala.tools.nsc.util.BitSet (not used anywhere) Review by @odersky