summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix some issues in parallel Ctrie.Aleksandar Prokopec2012-02-036-46/+75
| | | | | | | | | | | | | | | | | | | | | | This change resolves some issues with ParCtrie splitters and their `remaining` method, which currently evaluates the size of the Ctrie. Since this is still not done lazily, nor in parallel, it has a certain cost, which is unacceptable. Change #1: The `shouldSplitFurther` method is by default implemented by calling the `remaining` method. This method now forwards the call to the same method in the splitter which is by default implemented in the same way as before, but can be overridden by custom collections such as the ParCtrie. Change #2: ParCtrie splitter now has a `level` member which just counts how many times the method has been split. This information is used to override the default `shouldSplitFurther` implementation. Change #3: The tasks and splitters rely heavily on the `remaining` method in the splitter for most operations. There is an additional method called `isRemainingCheap` which returns true by default, but can be overridden by custom collections such as the `Ctrie`.
* Add parallel Ctrie parallel collection.Aleksandar Prokopec2012-02-025-10/+151
|
* Incorporate Ctrie into standard library.Aleksandar Prokopec2012-02-024-13/+106
| | | | Implemented Ctrie serialization. Improved hashcode computation.
* Add the Ctrie concurrent map implementation.Aleksandar Prokopec2012-02-0113-0/+2055
| | | | | | | | | | | | | Ctrie is a scalable concurrent map implementation that supports constant time lock-free lazy snapshots. Due to the well-known private volatile field problem, atomic reference updaters cannot be used efficiently in Scala yet. For this reason, 4 java files had to be included as well. None of these pollute the namespace, as most of the classes are private. Unit tests and a scalacheck check is also included.
* Remove ParIterator and SignalContextPassingIterator.Aleksandar Prokopec2012-02-0114-182/+113
| | | | | This unclutters the namespace and makes defining custom parallel collections a lot easier.
* Add support for combiner sharing to parallel collections.Aleksandar Prokopec2012-02-014-119/+193
| | | | | | | | | | | | | | | | | | | | | | | | | Concurrent (thread-safe) collections can implement builders directly for parallel collections by having themselves as builders, similar to buffers being builders for themselves in sequential collections. Combining 2 shared combiners can be expensive (more than logn), but is never done, since `combine` is always called with `this` (receiver) combiner, so `combine` just returns `this`. This commit adds support for implementing a parallel collection by having itself as combiner (parallel builder). To do this, clients must now merely implement their combiners by overriding the method `canBeShared` and having it return `true`. The support is implemented by refining the abstraction which creates combiners in tasks - this abstraction is provided by the protected `combinerFactory` method, previously `cbfactory`. The essential difference is that if the combiner can be shared, this method returns a combiner factory which always returns the same combiner. Otherwise, it always creates a new combiner. Span and takeWhile had to be modified for shared combiners to make this work, but for all other collections they work as before. Several other tasks had to be modified slightly, as well.
* Test case closes SI-5352.Paul Phillips2012-01-313-0/+29
|
* Improved warning for insensible comparisons.Paul Phillips2012-01-315-5/+35
| | | | | Utilize knowledge of case class synthetic equals to rule out some comparisons statically. Closes SI-5426.
* Have ant notice starr out of date.Paul Phillips2012-01-301-2/+13
| | | | | If your compiler .desired.sha1 is newer than the jar, it will go download it.
* Print compound types legibly.Paul Phillips2012-01-302-19/+35
| | | | | | | | | This one's about a million years overdue. Try this on for size, from the command line: printf ":power\nList(1).?.baseClasses.sigs >\n" | scala Also, a little more power mode refinement.
* Merge branch 'develop'Paul Phillips2012-01-3011-137/+642
|\
| *-. Merge remote-tracking branches 'axel22/issue/4147', 'axel22/issue/5374' and ↵Paul Phillips2012-01-303-2/+21
| |\ \ | | | | | | | | | | | | 'hubertp/ticket/4336' into develop
| | | * Closes #4336.Hubert Plociniczak2012-01-302-1/+20
| | | | | | | | | | | | | | | | Some of the type params might already be instantiated if explicit type application is done. Review by @adriaanm
| | * | Merge branch 'master' into issue/5374aleksandar2012-01-30170-6097/+8456
| | |\|
| | * | Changed the serialVersionUID in List serialization start marker.aleksandar2012-01-301-1/+1
| | | |
| * | | Fixed the benchmarks a bit.aleksandar2012-01-303-18/+27
| | | |
| * | | Merge pull request #1 from lpereir4/avlAleksandar Prokopec2012-01-308-135/+612
| |\ \ \ | | |_|/ | |/| | AvlTree performance improvements
| | * | Scalacheck test in order to ensure AVL invariants are respected.Lucien Pereira2012-01-281-0/+114
| | | |
| | * | Added benchmarking files, in order to easily compare variousLucien Pereira2012-01-285-0/+328
| | | | | | | | | | | | | | | | implementations performances.
| | * | Use of polymorphic dispatch instead of pattern matching.Lucien Pereira2012-01-282-127/+168
| | | | | | | | | | | | | | | | Use a specialized iterator.
| | * | Getting rid of closure creation occuring for each rebalancing. Tail ↵Lucien Pereira2012-01-151-34/+28
| | | | | | | | | | | | | | | | recursion is not necessary here.
| | * | syntactic error correctionLucien Pereira2012-01-141-1/+1
| | | |
* | | | A couple power mod conveniences.Paul Phillips2012-01-302-56/+91
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And disambiguations. And renamed all kinds of methods to something less inscrutable. Moved all the instance-to-compiler-structure implicit behind a wrapper to avoid accidental conversions. The wrapper has a single method, ?, which you can experience like so: // Sorry tab completion doesn't yet figure out implicit conversions scala> val x = Map(1 -> 2).? x: $r.power.InternalInfo[scala.collection.immutable.Map[Int,Int]] = Map(1 -> 2) (Map) scala> x. asInstanceOf baseTypeSeq baseTypeSeqMap baseTypeWhichDefines companion decls declsOriginal declsOverride erasure fullManifest glb info isInstanceOf lub memberMethods memberTypes members membersDeclared membersInherited membersUnabridged moduleClass name owner owners pkg pkgClass pkgClassSymbols pkgClasses pkgMembers pkgName pkgSymbols shortClass signature symbol toString tpe // This uses an implicit to install sigs (and another for '>' which is // the generic printing function) but transparency, one step at a time. scala> Map(1 -> 2).?.membersDeclared.sigs > def $init$(): Unit override def empty: scala.collection.immutable.Map[A,B] override def toMap[T,U](implicit ev: <:<[(A, B),(T, U)]): scala.collection.immutable.Map[T,U] override def seq: scala.collection.immutable.Map[A,B] def withDefault[B1 >: B](d: A => B1): scala.collection.immutable.Map[A,B1] def withDefaultValue[B1 >: B](d: B1): scala.collection.immutable.Map[A,B1] override def updated[B1 >: B](key: A,value: B1): scala.collection.immutable.Map[A,B1] def +[B1 >: B](kv: (A, B1)): scala.collection.immutable.Map[A,B1]
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'scalamacros/topic/yshowsymkinds' and ↵Paul Phillips2012-01-299-39/+92
|\ \ \ \ | | | | | | | | | | | | | | | 'scalamacros/ticket/5418' into develop
| | * | | Test for https://issues.scala-lang.org/browse/SI-5418Eugene Burmako2012-01-292-0/+14
| | | | |
| * | | | -Yshow-symkinds: prints kinds next to symbol namesEugene Burmako2012-01-287-39/+78
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This very situational option proved to be very useful when debugging https://issues.scala-lang.org/browse/SI-5415 With the help of -Yshow-symkinds, it became possible to distinguish a free var from a module symbol, which gave precise indication of the root of the bug.
* | | | Test case closes SI-4515.Paul Phillips2012-01-292-0/+47
| | | |
* | | | Bonus test case for SI-3999.Paul Phillips2012-01-281-0/+20
| | | |
* | | | More method synthesis unification.Paul Phillips2012-01-286-171/+182
| | | |
* | | | Cleaned up polymorphic method creation.Paul Phillips2012-01-283-67/+54
| | | | | | | | | | | | | | | | | | | | I love the smell of polymorphic method synthesis in the early afternoon.
* | | | Test case closes SI-3854.Paul Phillips2012-01-272-0/+20
| | | |
* | | | Changed partest to use UTF-8.Paul Phillips2012-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Finally had a concrete motivation to change partest's inexplicable ISO-8859-1 encoding to UTF-8. My test case would cause it to barf "illegal character". Is this going to break on windows or something? If so, it's time to fix the broken place which can't handle UTF-8.
* | | | Make 'illegal' characters less annoying.Paul Phillips2012-01-271-1/+1
| | | | | | | | | | | | | | | | At least tell us what they are.
* | | | Revert "-Yshow-symkinds: prints kinds next to symbol names"Paul Phillips2012-01-277-77/+39
| | | | | | | | | | | | | | | | This reverts commit 6a5901461c1aaac7dd8786cb374b079520895527.
| | | |
| \ \ \
*-. \ \ \ Merge remote-tracking branches 'scalamacros/topic/yshowsymkinds' and ↵Paul Phillips2012-01-2711-68/+114
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'axel22/feature/immutable-thread-safe' into develop
| | * | | | Set fields in immutable hash maps and hash sets to vals.aleksandar2012-01-264-29/+37
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of an effort to make the immutable collections (more) thread safe. The `::` still has non-final member fields for head and tail, but there is not much that can be done right now about that, since these fields are used by list buffers. Tried writing a test with unsafe initialization, but could not invent a scenario which actually fails, at least on the JDK6.
| * / / / -Yshow-symkinds: prints kinds next to symbol namesEugene Burmako2012-01-277-39/+77
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This very situational option proved to be very useful when debugging https://issues.scala-lang.org/browse/SI-5415 With the help of -Yshow-symkinds, it became possible to distinguish a free var from a module symbol, which gave precise indication of the root of the bug. This changeset also upgrades stringification of symbols and types, so I'd like to get a review by @paulp and @odersky.
* | | | Disabled "not found" suggestions.Paul Phillips2012-01-264-5/+9
| | | | | | | | | | | | | | | | | | | | The benchmarks charts are confusing me and I want to rule it out as a problem by not having it exist for a while.
* | | | Intercept assert and require calls.Paul Phillips2012-01-2621-74/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And abort calls, and unhandled exceptions, all so I can supplement the error message with a little of the vast quantity of useful information which we possess but do not reveal. "Details are sketchy," says the officer tasked with investigating the crash, but no longer. Also took the opportunity to eliminate a bunch of one-argument assertions and requirements if I thought there was any chance I'd someday be facing them on the wrong end of an incident. Have you ever dreamed that instead of this experience: % scalac -optimise <long list of files> error: java.lang.AssertionError: assertion failed: Record Record(anonymous class JavaToScala$$anonfun$makeScalaPackage$1,Map()) does not contain a field value owner$1 Things could proceed more like this: % scalac -optimise <long list of files> error: while compiling: src/compiler/scala/reflect/runtime/JavaToScala.scala current phase: closelim library version: version 2.10.0.rdev-4267-2012-01-25-gc94d342 compiler version: version 2.10.0.rdev-4270-2012-01-26-gd540ddf reconstructed args: -Ydead-code -optimise -Yinline -Yclosure-elim -Yinline-handlers -d /tmp error: java.lang.AssertionError: [etc] You are not dreaming! IT'S ALL HAPPENING
* | | | Fix for recently induced -optimise crasher.Paul Phillips2012-01-264-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | "Induced" but not in my estimation "caused". Would like to understand why the enclosed test case crashes under -optimise without this change to AddInterfaces.
* | | | Put a stake in partest-alternative.Paul Phillips2012-01-2630-3852/+0
|/ / / | | | | | | | | | I look forward to partest-emo and partest-trance.
* | | Added caching to binary resolution.Josh Suereth2012-01-251-3/+24
| | | | | | | | | | | | | | | | | | * Duplicated binary repo cache in ~/.sbt/cache/scala/ * Resolved to cache before copying to local dir if jar is misisng * Does *not* check SHA in cache currently
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'axel22/issue/5374' and 'axel22/issue/5375' ↵Paul Phillips2012-01-259-41/+150
|\ \ \ \ | | |_|/ | |/| | | | | | into develop
| | * | Fix for SI-5375.aleksandar2012-01-255-27/+55
| | | | | | | | | | | | | | | | | | | | Changed CompositeThrowable to inherit Exception instead of Throwable. A few minor fixes for the jdk1.5 parallel collection tasks.
| * | | Refine fix for SI-5374 - make list deserialization backward-compatible.aleksandar2012-01-254-14/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done by structurally serializing list nodes, but prepending a special `ListSerializationStart` symbol ahead of the list. If this symbol is not in the object input stream, the deserialization reverts to the old mode. Note there is not much to be done for list buffers - their serialization was broken before, so legacy serialized list buffers are no longer deserializable. However, their serialVersionUID was changed to reflect this, so deserializing a legacy list buffer should fail fast.
* | | | Merge remote-tracking branch 'odersky/topic/reflect' into developPaul Phillips2012-01-2546-467/+932
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/reflect/internal/Symbols.scala src/compiler/scala/reflect/internal/Types.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/reflect/api/Trees.scala
| * | | | Tightening of constructors in Symbols, to force everyone to use the factory ↵Martin Odersky2012-01-251-10/+10
| | | | | | | | | | | | | | | | | | | | methods that take account of synchronization when run under reflection.
| * | | | More work on making reflection thread-safe.Martin Odersky2012-01-258-27/+35
| | | | |
| * | | | Protecting the constructors of Scopes and Symbols so that everyone is forced ↵Martin Odersky2012-01-252-3/+11
| | | | | | | | | | | | | | | | | | | | to go through the factory method, which adds on synchronization when run under reflection.
| * | | | Making Definitions thread-safe by replacing a bunch of vars with lazy vals.Martin Odersky2012-01-251-58/+53
| | | | |