scala/scala — pull request #1025 by VladUreche (2012-07-30 21:54:16+00:00)
Title: Hiding AnyRef specialization under a flag

The current AnyRef specialization is still fragile, so we'll let the
users choose whether to use it or not via the -Xanyref-specialization
compiler flag. Source code can always be compiled against a previously
AnyRef-specialized classes, but will only be AnyRef-specialized itself
if the flag is set.

In this patch, an anti-annotation is introduced to mark the fact that
AnyRef specialization should be excluded (@specializedExcludeAnyRef).
This anti-specialization annotation is added automatically by the
compiler to all @specialized type parameters, iregardless of whether
the type parameter is going to be specialized on AnyRef or not. The
reason is that the logic necessary to decode the types involved in the
specialization should not be moved outside SpecializeTypes.scala.

Once @specializedExcludeAnyRef is set (in superaccessors) and pickled
into the class file, all further scalac runs will specialize the
signature for all given types except AnyRef.

The instrument.jar archive is generated from the current source, thus
there's no need for an extra bootstrapping commit.

Review by @paulp and @non.