SI-6968 Simple Tuple patterns aren't irrefutable

Reverts part of c82ecab. The parser can't assume that
a pattern `(a, b)` will match, as results of
`.isInstanceOf[Tuple2]` can't be statically known until
after the typer.

The reopens SI-1336, SI-5589 and SI-4574, in exchange for fixing
this regression SI-6968. Keeping all of those fixed will require
a better definition of irrefutability, and some acrobatics to
ensure safe passage to the ambiguous trees through typechecking.
SI-7035 Centralize case field accessor sorting.

It is both burdensome and dangerous to expect callers
to reorder these. This was seen in the field permutation
in the unapply method; a regression in 2.10.0.
[backport] Fix for SI-6154, VerifyError originating in uncurry.

Lhs still might be an Ident.  Miguel did all the work,
I just wrote it down in code form.
(cherry picked from commit 48f8235822a2a100d6c4e8d3d7349df565ac6d40)
Optimization in AsSeenFromMap.

Despite all the eyes which have traveled over this code,
we all managed to miss this:

  // Note that pre and clazz are fixed at construction
  class AsSeenFromMap(pre: Type, clazz: Symbol) {
    ...
    def apply(tp: Type): Type =
      if (skipPrefixOf(pre, clazz)) tp
      else ...
  }

Additionally, the exclusion condition in asSeenFrom contained
a useless check, here:

  // !isPossiblePrefix(clazz) alone is enough
  pre.normalize.isTrivial && !isPossiblePrefix(clazz)
[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.
Add Bytecode test (ASM-based) to partest.

This commit introduces a new kind of test `Bytecode` that allows
one to inspect bytecode generated for given piece of Scala code.

The bytecode inspection is achieved by inspection of ASM trees.
See the included example for details.

NOTE: This commit does not introduce a new category of pratest tests.
Bytecode tests should be run in `jvm` category of partest tests.

Specific list of changes:
  * Add BytecodeTest that contains common utilities to partest
  * Add asm to classpath when compiling partest. That's not a
    new dependency as it's being already done for javac task
    we were running while compiling partest.
  * Add an example test that shows how to count null checks in
    given method.
Merge pull request #1912 from retronym/ticket/6651

SI-6651 Extension methods types may depend on the typed of the wrapped value
SI-6726 Add benchmark used for testing pattern matcher.

To be manually run, results referenced in subsequent commmits.
SI-6726 Hash consing for Pattern matching Sym-s

For the test case: https://issues.scala-lang.org/browse/SI-6726?focusedCommentId=61207&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-61207

time scalac -Ystatistics -Ystop-after:patmat sandbox/gen.scala

Before:

    real    1m47.737s
    user    2m14.314s
    sys 0m2.783s

After:

    real    1m23.574s
    user    1m51.795s
    sys 0m2.634s
SI-6726 Further optimization of pattern analysis

Manually fuse `.filterNot(..).map` in dropUnit.

Before:

    real    1m23.574s
    user    1m51.795s
    sys 0m2.634s

After:

    real    1m4.883s
    user    1m30.754s
    sys 0m1.776s
Remove gratuitous var

In favour of a somber val.
SI-6516, macros comparing types with == instead of =:=.

I gift-wrapped this ticket four months ago:

  'I think it will be enough to say "tpe =:= MacroContextClass.tpe"
   rather than == .'

Indeed. Had to open my own gift. Thanks, paulp!
Merge pull request #2025 from paulp/issue/6516

SI-6516, macros comparing types with == instead of =:=.
Merge pull request #2007 from retronym/backport/1021

[backport] Fix for SI-6154, VerifyError originating in uncurry.
Merge pull request #2020 from adriaanm/rebase-pr-1994-2.10.x

[retarget #1994 to 2.10.x] SI-6726 Improving pattern matcher analysis performance
SI-6728 Fixes crash in parser on incomplete for expression

The parser was trying to take the position of an empty expression
which would crash. Son on the empty expression case in TreeBuilder#
makeWhile it tries to do that and, if that failed, gets a position
that wraps both the condition and the body.

I also made a slight improvement to the UnsupportedOperationEx
messages in Position.
Merge pull request #2008 from paulp/pr/asSeenFromOpt

Optimization in AsSeenFromMap.