SI-7494 Each plugin must only be instantiated once.

The old behavior was that Plugin.loadAllFrom took a distinct
list of plugin locations.

The broken behavior incorrectly punted to the pruning
algorithm in Plugins.loadPlugins$pick.

The new behavior is to distinctify the list of class names
to load.

This is more robust; under the old scheme, specifying the
continuations.jar under two file names would fail as
described in the ticket.

Pruning a plugin by disabling (-Xplugin-disable) or because
it steps on someone else's phase name suffers the same
defect. There is no way to tell the plugin it has been
benched. And you know that global I gave you?  Can I
have it back?
Merge commit 'd93826f278' into pr/enter-elimination-mode

* commit 'd93826f278':
  Incorporated reviewer feedback.
  Incorporated reviewer feedback.
  Refactored stabilize.
  Eliminated HKmode.
  Eliminated RETmode.
  Eliminated SNDTRYmode.
  Started eliminating modes.
  Corralling Modes into a smaller pen.

Conflicts:
	src/compiler/scala/tools/nsc/typechecker/Macros.scala
	src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
	src/compiler/scala/tools/nsc/typechecker/Typers.scala
Reimplementing much of the DefaultPromise methods
Optimizations:
1) Avoiding to call 'synchronized' in tryComplete and in tryAwait
2) Implementing blocking by using an optimized latch so no blocking ops for non-blockers
3) Reducing method size of isCompleted to be cheaper to inline
4) 'result' to use Try.get instead of patmat
SI-7427 stop crashing under -Ydebug.

Change "dumpClassesAndAbort" to "devWarning". You can witness
it happen like so.

  % scalac test/files/pos/t7427.scala -Ydebug -Xdev
  ...
  [running phase cleanup on t7427.scala]
  [running phase icode on t7427.scala]
  warning: !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
  warning: !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
  [running phase inliner on t7427.scala]
  [running phase inlinehandlers on t7427.scala]

Having now lived with this for months, I have no ambition to
unravel the actual problem, I just want it to stop crashing.
Merge pull request #2565 from paulp/issue/7427

SI-7427 stop crashing under -Ydebug.
An attempt to make tests deterministic.

The nondeterminism presently showing itself in
presentation/implicit-member is a consequence of the
presentation compiler tests relying on details of the
behavior of toString calls. We need to stomp this out,
but it will take a while. Based on the check file
changes enclosed with this commit, this will suffice
for the presentation compiler tests. A broader assault
will have to take place, but not yet.
Merge pull request #2566 from paulp/pr/nondeterminism

An attempt to make tests deterministic.
Merge remote-tracking branch 'origin/master' into pr/enter-elimination-mode

* origin/master:
  An attempt to make tests deterministic.
  SI-7427 stop crashing under -Ydebug.
SI-7494 Tests for status quo

Exploit SI-6446 fix to move old pending tests for plugins to the
active pool.

Also, nuance the partest runner to allow the compiler to crash
with a FatalError if a check file is present.

Some of the plugin tests make phase assembly throw.

One of the legacy tests was moved back to pending:

There seems to be a race for who shall be deemed truly dependent.

Back to pending for you!

apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/
Selected 1 tests drawn from specified tests

> starting 1 test in neg
ok 1 - neg/t7494-cyclic-dependency

1/1 passed (elapsed time: 00:00:04)
Test Run PASSED
apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/
Selected 1 tests drawn from specified tests

> starting 1 test in neg
!! 1 - neg/t7494-cyclic-dependency               [output differs]
> 0/1 passed, 1 failed in neg

>>>>> Transcripts from failed tests >>>>>

> partest files/neg/t7494-cyclic-dependency
% scalac t7494-cyclic-dependency/ThePlugin.scala
% scalac t7494-cyclic-dependency/sample_2.scala
error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice!

% diff files/neg/t7494-cyclic-dependency-neg.log files/neg/t7494-cyclic-dependency.check
@@ -1 +1 @@
-error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice!
+error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice!

0/1 passed, 1 failed (elapsed time: 00:00:04)
Test Run FAILED
Moves AbstractFileClassLoader to scala-reflect.jar

Its string name was used in ReflectionUtils and became broken after repl
got factored out. This hints that that classloader belongs to where it is
used, i.e. to scala-reflect.jar.

Moreover AbstractFile is defined in scala-reflect.jar, so it's only
logical to also define a derived classloader in scala-reflect.jar.
Merge pull request #2562 from som-snytt/issue/double-plugin

SI-7494 Each plugin must only be instantiated once.
Harden partest against duplicate paths.

A serious issue: partest would launch the same test multiple
times if a test path was given in multiple forms (e.g. absolute
and relative paths.) Unfortunately all those tests would share
the same logfile, output directory, etc. which would predictably
lead to explosions.

Since overwriting classfiles while being loaded can lead to
jvm core dumps, it's possible this is involved in recent jvm
crashes and other test breakdowns.

This commit also alters the default partest verbosity to only
full print test transcripts under --verbose.
Merge pull request #2571 from paulp/pr/canonicalize-paths

Harden partest against duplicate paths.
Merge pull request #2492 from paulp/pr/enter-elimination-mode

Toward more organized typer state.
Cleaning up isApplicable and neighbors.

I'd really like these methods to receive greater scrutiny.
To that end I'm scrutinizing them.
Cleaning crew moves down the hall.

Swabbing the decks of isAsSpecific and isApplicableSafe.
Wow isApplicableSafe, you don't really need to declare and
allocate a two-argument case class in order to manage a
second method call.
Moving on to checkBounds.

So much dust and debris, so little time.
Scrubbing up inferPolyAlternatives.

Now you can take inferPolyAlternatives home to meet your mother.
Commented out code from 2006.

Yes, 2006. Perhaps we should have a "sunset provision"
which removes commented-out code after seven years. Or even
slightly sooner.
Commented out code from 2007.

It's not exactly 2006-era code but it's still a little ripe.