SI-7622 Phase assembly is testable

Fixing hash on nodes makes fault detection deterministic,
which aids testing.

Error messages are shortened and .dot files are dumped
automatically on faults to guard against future flakiness.
SI-7622 -Xgenerate-phase-graph is an info option

-Xgenerate-phase-graph is comparable to -Xshow-phases.

The knowledge about what is an info-only option is refactored
to Settings, which also knows which group of options comprise
the optimiser set.
SI-7622 Phases are enabled or not

Refactor the calculation of the "phase chain" a bit.
In particular, initial and terminal phases are not special
except that they must be head and last.

When done, filter for enabled phases. At this commit,
nobody claims to be disabled.

Additional sanity support of phases settings.
SI-7622 -Xshow-phases can show disabled phases

With -Ydebug, -Xshow-phases will show phases that are skipped
or not enabled.

The code is slightly refactored, so the flags table will also benefit.
SI-7622 Plugins can be not enabled

Plugins can interrogate options and declare themselves not
enabled.  The plugin itself can return false from its init
if the options do not compute.  A plugin phase component
can declare itself not enabled, same as an internal phase.

No one exploits this facility at this commit.
SI-7622 Clean Up Phase Assembly

Let optimiser components and continuations plugin opt-out
when required flags are not set.

Wasted time on a whitespace error in check file, so let
--debug dump the processed check file and its diff.
SI-7622 Scaladoc and error message polish

Restores the verbiage "run right after".
Alter TailRec to have map and flatMap

As described in the "Stackless Scala with Free Monads" paper

scala> import scala.util.control.TailCalls._
import scala.util.control.TailCalls._

scala> :paste
// Entering paste mode (ctrl-D to finish)

def isEven(xs: List[Int]): TailRec[Boolean] =
  if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail))

def isOdd(xs: List[Int]): TailRec[Boolean] =
  if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail))

// Exiting paste mode, now interpreting.

isEven: (xs: List[Int])util.control.TailCalls.TailRec[Boolean]
isOdd: (xs: List[Int])util.control.TailCalls.TailRec[Boolean]

scala> isEven((1 to 100000).toList).result
res0: Boolean = true

scala> def fib(n: Int): TailRec[Int] =
     |   if (n < 2) done(n) else for {
     |     x <- tailcall(fib(n - 1))
     |     y <- tailcall(fib(n - 2))
     |   } yield (x + y)
fib: (n: Int)util.control.TailCalls.TailRec[Int]

scala> fib(40).result
res1: Int = 102334155
Stackless implementation of TailRec in constant memory.
Merge branch '2.10.2' into 2.10.3

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
Merge pull request #2878 from JamesIry/2.10.3

Merge 2.10.2 into 2.10.3
SI-7269 Rework MapLike#retains to account for desugaring change

`MapLike#retains` contains a for-comprehension that relied on the strict
`filter` by its generator. You can't, in general, iterate a mutable map
and remove items in the same pass.

Here's the history of the desugaring of:

    def retain[A, B](thiz: mutable.Map[A, B])(p: (A, B) => Boolean): thiz.type = {
      thiz.foreach {
        case (k, v) =>
          if (p(k, v)) thiz -= k
      }

Before regression (c82ecabad6~1):

    thiz.filter(((check$ifrefutable$1) => check$ifrefutable$1: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => true
       case _ => false
    })).withFilter(((x$1) => x$1: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang
    })).foreach(((x$2) => x$2: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k)
    }));

After regression (c82ecabad6, which incorrectly assumed in the parser that
no filter is required for isInstanceOf[Tuple2])

    thiz.withFilter(((x$1) => x$1: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang
    })).foreach(((x$2) => x$2: @scala.unchecked match {
      case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k)
    }));

After the reversion of c82ecabad6, v2.10.2
This is also after 365bb2b4e, which uses `withFilter` rather than `filter`.

    thiz.withFilter(((check$q$1) => check$ifrefutable$1: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => true
       case _ => false
    })).withFilter(((x$1) => x$1: @scala.unchecked match {
       case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang
    })).foreach(((x$2) => x$2: @scala.unchecked match {
      case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k)
    }));

This commit does the same as `SetLike#retains`, and converts the map to
an immutable list before the rest of the operation.
update typesafe.artifactory-online.com to private-repo
Removing orphan check/flag files.
Limit bad advice given for erroneous pattern.

Don't suggest "_: <none>" as an alternative when the pattern
type doesn't conform to the expected type.
Restore --show-diff to partest-ack.

Looks like that issue was operator error. However partest
option --show-log really has gone missing.
[nomaster] SI-7652 Bad tools fails loudly

A brief message is all that's required to
alleviate the look of consternation on the
face of your user.
[nomaster] SI-7652 REPL extended quest for tools

Javap tries harder and fails louder when
looking for tools.jar

This is a backport of the method as it
was first coded for partest.

If JAVA_HOME is wrong, it will either
fail with a message or succeed after
rooting about.

```
apm@mara:~/tmp/q$ JAVA_HOME=$JAVA7_HOME JAVACMD='/usr/lib/jvm/java-6-openjdk-amd64/bin/java' /home/apm/projects/snytt/build/pack/bin/scala
Welcome to Scala version 2.10.3-20130829-123337-59d6568daa (OpenJDK 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :javap
:javap [-lcsvp] [path1 path2 ...]

scala> :javap java.lang.Object
Failed: Could not load javap tool. Check that JAVA_HOME is correct.

apm@mara:~/tmp/q$ JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/jre JAVACMD='/usr/lib/jvm/java-6-openjdk-amd64/bin/java' /home/apm/projects/snytt/build/pack/bin/scala
Welcome to Scala version 2.10.3-20130829-123337-59d6568daa (OpenJDK 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.

scala>

scala> :javap
:javap [-lcsvp] [path1 path2 ...]

scala> :javap java.lang.Object
Compiled from "Object.java"
```
Correcting scaladoc for all classes defining withDefaultValue method.
The description of the single parameter seems to be a copy and paste mistake from withDefault method.
SI-7810 Reflect private constructor

`JavaMirror.constructorToJava` uses `getDeclaredConstructor` now
instead of `getConstructor`.