[backport] Disabled SI-6987.

It causes spurious failures - a typical example:

[partest] testing: [...]/files/run/t6987.scala                                  [FAILED]
[partest] did not get the string expected, full results were:
[partest] Fast Scala compiler version 2.11.0-20130126-111937-f01e001c77 -- Copyright 2002-2013, LAMP/EPFL
[partest] [Given arguments: -shutdown -verbose]
[partest] [Transformed arguments: -shutdown -verbose -current-dir /localhome/jenkins/b/workspace/scala-checkin-manual]
[partest] [VM arguments: ]
[partest] java.net.ConnectException: Connection refused
[partest] [Connecting to compilation daemon at port 32808 failed; re-trying...]
[partest] [No compilation server running.]
[partest]
(cherry picked from commit 53d5df5c1d52b941732c243159de4f44456f03b4)
Merge pull request #2010 from retronym/backport/1985

[backport] Disabled SI-6987.
SI-6651 Substitute `this` in extension method sigs

This allows for the likes of:

    class A[X](val x: X) extends AnyVal {
      def foo(xy: x.Y) {}
    }

We have to do this in both directions, when synthesizing
the extension method in `Extender#transform`, and later on
when Erasure tries to find the corresponding extension
methods by backing out the original signatures from
the signatures of the synthesized methods in the companion.

In the first case, we have to be careful to use a stable
reference to the `self` parameter, which can satisfy the
dependent types.
SI-6551 Expand test case into uncomfortable areas.

    trait T { type U }
    class A(val a: T) extends AnyVal {
      def foo[TT <: a.U] = 0
    }

It works! But it's pure serendipity. After extmethods,
the careful student of ASTs will find:

    object A {
      final def foo$extension[TT >: Nothing <: A.this.a.U]($this: A): Int = 0;
    }

`A.this` doesn't belong.

For now we just include this case under our test umbrella.
Merge pull request #1912 from retronym/ticket/6651

SI-6651 Extension methods types may depend on the typed of the wrapped value
synchronizes symbols

Synchronization via decoration would be neat if it actually worked.
Unfortunately, root symbols never got decorated, therefore their children
also never got decorated and all the way down to the very turtles.

This commit fixes this sad issue by turning root symbols from objects
to lazy vals. Yes, this is going to induce a performance penalty, which
will hopefully not be high enough to invalidate this cornerstone of our
synchronization strategy.

Now when root symbols are lazy vals, they can be overridden in the runtime
reflexive universe and decorated with SynchronizedSymbol, which makes their
children sync and sound.
reflection no longer uses atPhase and friends

Mentioned methods mutate the global `atPhaseStack` variable, which can
easily lead to imbalances and, ultimately, to the empty stack error.

Luckily for us, there's only one dummy phase, SomePhase, which is used
by runtime reflection, so there is absolutely zero need to invoke atPhase
in non-compiler reflexive universes.
synchronizes PackageScope.negatives

We don't have to serialize access to this cache, but we ought to
make the cache safe for being accessed from multiple threads at once.
synchronizes runtimeMirror
synchronizes toolboxes

We don't guarantee thread-safety of the front end, but everything else
looks good now.
synchronizes symbol materializers

Since runtime reflection doesn't have a luxury of enumerating all classes
on the classpath, it has to materialize symbols for top-level definitions
(packages, classes, objects) on demand.

Someone asks us for a class named `foo.Bar`? Easy. Let's speculatively create
a package named `foo` and then look up `newTypeName("bar")` in its decls.
This lookup, implemented in `SymbolLoaders.PackageScope` tests the waters by
trying to to `Class.forName("foo.Bar")` and then creates a ClassSymbol upon
success (the whole story is a bit longer, but the rest is irrelevant here).

That's all neat, but these non-deterministic mutations of the global symbol
table give a lot of trouble in multi-threaded setting. One of the popular
reflection crashes happens when multiple threads happen to trigger symbol
materialization multiple times for the same symbol, making subsequent
reflective operations stumble upon outrageous stuff like overloaded packages.

Short of significantly changing SymbolLoaders I see no other way than just
to slap a global lock on materialization in runtime reflection.
cleans up initialization of runtime reflection

At first I just tried to remove syntheticCoreClasses from missingHook
and put them into the initializer of freshly created mirrors in order to
reduce the non-determinism in mutations of the global symbol table.

And then it didn't work, crashing on me claiming that AnyRef is missing.
Apparently we still need AnyRefClass in missingHook, just because it's
impossible to initialize (i.e. unpickle) ScalaPackageClass without it.

And then it still didn't work, whining about multiple overloaded defs
of some synthetic symbols. That was really tricky, but I figured it out
as well by initializing ScalaPackageClass first before forcing any
synthetic symbols (see the details in comments).
restores the assertion in missingHook

Now when bootstrapping no longer enters some symbols twice (see the
previous commit for a detailed explanation), we can safely restore
this assertion in missingHook.
runtime reflection: death from thousand threads

not anymore
introducing GIL to Scala reflection

On a serious note, I feel really uncomfortable about having to juggle
this slew of locks. Despite that I can't immediately find a deadlock,
I'm 100% sure there is one hiding in the shadows. Hence, I'm abandoning
all runtime reflection locks in favor of a single per-universe one.
optimizes Scala reflection GIL

First of all, GIL should only apply to runtime reflection, because noone
is going to run toolboxes in multiple threads: a) that's impossible, b/c
the compiler isn't thread safe, b) ToolBox api prevents that.

Secondly, the only things in symbols which require synchronization are:
1) info/validTo (completers aren't thread-safe),
2) rawInfo and its dependencies (it shares a mutable field with info)
3) non-trivial caches like in typeAsMemberOfLock

If you think about it, other things like sourceModule or associatedFile
don't need synchronization, because they are either set up when a symbol
is created or cloned or when it's completed.

We can say that symbols can be in four possible states: 1) being created,
2) created, but not yet initialized, 3) initializing, 4) initialized.
#1 doesn't need synchronization, because it's always performed by a
single thread. #2 and #4 don't need synchronization either, because the
only mutation symbols in runtime reflection can undergo is init. #3 is
dangerous and needs protection.