SI-7501 Pickler: owner adjustment for param syms in annotation args

Pickling of trees within annotation arguments led to an unfortunate
situation: the MethodType of a symbol contained a value parameter
symbol that was pickled as though it were owned by the enclosing
class (the root symbol of the pickle.)

Under separate compilation, this would appear as a member of that
class.

Anyone using `@deprecatedName('oldName)` was exposed to this problem,
as the argument expands to `Symbol.apply("oldName")`.

This commit extends some similar treatment of local type parameters
to also consider value parameters.
SI-7407 fixed in GenBCode but beware, it remains a bug in GenASM

GenBCode runs only under a flag, and moreover only if -optimise
is not present (see ScalaSettings for details).

Therefore during a nightly, when tests are run under -optimise,
we need -Ynooptimise to deactivate the optimizer.
With that, GenBCode can run and tackle the test case successfuly.
GenBCode: decouple ClassNode building from classfile writing

This commit and two follow-up commits (recognizable because
of the starting words "decouple this from that" in the commit message)
are baby steps towards pipelining of class building and class writing,
ie allowing class building (which requires typer) and "the rest"
which doesn't) to run in parallel.

The commits have been broken up following a previous review comment.
GenBCode: decouple ClassNode building from encoding as byte array

To recap from the previous commit, another baby step towards
pipelining of class building and class writing.

Implementing similar functionality in GenASM is up for grabs,
see https://issues.scala-lang.org/browse/SI-6164
GenBCode: decouple ClassDef traversing from ClassNode building

In keeping with the baby steps towards pipelining of
class building and class writing, this commit gets one step closer
to that. Only thing missing: the actual thread-pool.
That will be the focus of an upcoming commit.
SI-6240 Synchronizes Names

Previously we didn't have all possible name creation facilities covered
with locks, so some of them silently misbehaved and caused much grief:
http://groups.google.com/group/scala-internals/browse_thread/thread/ec1d3e2c4bcb000a.

This patch gets all the name factories under control.

Rather than relying on subclasses to override mutating methods
and add synchronization, they should instead override `synchronizeNames`
to return true and leave the placement of the locks up to
`reflect.internal.Names`.

These locks are placed around sections that mutate `typeHashtable`
and `termHashtable`.

This is done in the reflection universe, and in the interactive
compiler. The latter change will obviate an incomplete attempt
do to the same in `ScalaPresentationCompiler` in the scala-ide
project.
SI-7779 Account for class name compactification in reflection

We have to assume that the classes we are reflecting on were
compiled with the default value for -Xmax-classfile-name (255).

With this assumption, we can apply the same name compactification
as done in the regular compiler.

The REPL is particularly prone to generating long class names
with the '$iw' prefixes, so this is an important fix for runtime
reflection.

Also adds support for getting the runtime class of `O.type` if
`O` is a module.
SI-7775 Harden against the shifting sands of System.getProperties

If another thread writes a new system property (which can happen
in pretty innocuous code such as `new Date`!), the compiler startup
could fail with a `ConcurrentModificationException` as it iterated
all bindings in the properties map in search of a boot classpath
property for esoteric JVMs.

This commit uses `Properties#getStringProperties` to get a snapshot
of the keys that isn't backed by the live map, and iterates these
instead. That method will also limit us to bindings with String
values, which is all that we expect.
SI-7782 Derive type skolems at the ground level

Rather than at the current value of `skolemizationLevel`,
which could be influenced by an in-flight existential
subtype computation.

This method is called in `PolyTypeCompleter`, which
could be constructed by the lazy type completer of the
enclosing class. So currently it is closing over a mutable
variable; hence the Heisenbug.

This issue was exposed by the changes in b74c33eb860,
which was introduced in Scala 2.10.1.
SI-7785 Preserve TypeVar suspension through TypeMaps

During `findMember`, TypeVars in `this` are placed into suspended
animation. This is to avoid running into recursive types when
matching members to those in base classes.

However, the mechanism used to do this is superficial, and doesn't
work when TypeVars are copied by TypeMaps. This seems to crop up
when using `AppliedTypeVar` with higher-kinded type vars.

In the enclosed test case, the cyclic type led to a SOE in
CommonOwnerMap.

This commit allows a TypeVar to delegate its `suspended` attribute
to the TypeVar from which it was copied. This is done in
`TypeVar#applyArgs`, which is called by:

    // TypeMap#mapOver
    case tv@TypeVar(_, constr) =>
      if (constr.instValid) this(constr.inst)
      else tv.applyArgs(mapOverArgs(tv.typeArgs, tv.params))

We should review the other places this is called to make sure
that it make sense to link in this way:

    Types#appliedType
    TypeVar#normalize
update typesafe.artifactory-online.com to private-repo
Echo the location of JUnit test failure reports in `ant test.junit`.

For other dummies like me hammering out "My First Scalac JUnit Test."
A better diagnostic error for corrupt or missing JARs.

Augment the IOException with the name of the file we're trying
to open.

Motivated by a troubleshooting session with partial downloads
of JARs from Maven central breaking the Scala build on Martin's
laptop.

The test case only tests our part of the error message, so as not
to be platform / JDK specific. Otherwise, it would check that the
correct cause exception was present and accounted for.
Merge pull request #2883 from retronym/topic/junit-zip-archive

A better diagnostic error for corrupt or missing JARs.
deprecate early type defs

This feature is neither properly supported by Scala compiler
nor a part of the language spec and therefore should be removed.
Due to source compatiblity with 2.10 we need to deprecate it first.
Merge pull request #2863 from magarciaEPFL/backendish40

(1 of 2) of the rest of the new bytecode emitter + feedback
Merge pull request #2847 from retronym/ticket/7501

SI-7501 Pickler: owner adjustment for param syms in annotation args
typedAnnotated no longer emits nulls

Adds a null-check in original synthesis for the result of typedAnnotated.
Previously it was possible for the aforementioned result to look like
TypeTree(<tpe>) setOriginal Annotated(..., null). Not anymore.
SI-7763 Avoid dropping casts in erasure

466b7d29f avoided quadratic complexity in Erasure's treatment
of chained `asInstanceOf` calls. It did so by using the typechecked
qualifier, rather than discarding it.

However, that also dropped the cast altogether! In many cases this
was masked by later inclusion of a cast to the expected type
by `adaptToType`:

	  at scala.tools.nsc.transform.Erasure$Eraser.cast(Erasure.scala:636)
	  at scala.tools.nsc.transform.Erasure$Eraser.scala$tools$nsc$transform$Erasure$Eraser$$adaptToType(Erasure.scala:665)
	  at scala.tools.nsc.transform.Erasure$Eraser.adapt(Erasure.scala:766)
	  at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5352)

This commit re-wraps the typechecked `qual` in its original
`<qual>.asInstanceOf[T]` to preserve semantics while avoiding
the big-O blowup.

The test includes the compiler option `-Ynooptimize` because dead code
elimination *also* thinks that this cast is superfluous. I'll follow up
on that problem seprately.
SI-7763 Don't eliminate CHECK_CAST in dead code elimination.

Even if the result isn't used, the potential ClassCastException
is observable, so we must retain them.