scala/scala — pull request #1060 by adriaanm (2012-08-06 11:43:56+00:00)
Title: SI-5739 (bis) vals for subpatterns when -g:patmatvars

To facilitate debugging pattern matches, we store the values for
sub-patterns of extractor (synthetic or user-defined) patterns when -g:patmatvars.
Normally we inline them directly unless compiling under -g:patmatvars

For soundness, SI-5158, SI-6070, we must always store the values of mutable case class fields.

We don't always do this since it may affect performance.
Also, the total cost in byte code size is about 1% for the compiler&stdlib
when run with -optimize and -g:patmatvars
(but see SI-6193: dead case class field accessor calls are not eliminated).

There were suspicions that emitting this many local variables may impact run-time performance
(it surely affects compiler performance) thus, I've decided to make these definitions opt-in.
Simply pass `-g:patmatvars` to scalac to facilitate debugging of pattern matches.