scala/scala — pull request #2388 by paulp (2013-04-13 00:21:59+00:00)
Title: Removed all the Statistics code.

I think we should acknowledge this is the wrong way to approach
the issue. Statistics can be gathered in a way which does not
pollute the compiler codebase and is not rigidly tied into
statically generated logic, via instrumentation. Here are some
reasons why this code should go:

- it greatly obfuscates the logic of key methods
- it is untested
- it cannot even be enabled without recompiling
- it is inflexible in other ways
- it is almost certainly hurting performance

As to the last point, are we really that confident that a
difference like this in a hot method isn't going to have any
impact? I'm definitely not.

```diff
- : getstatic # // Field util/Statistics$.MODULE$:Lutil/Statist
- : invokevirtual # // Method util/Statistics$.canEnable:()Z
- : ifeq
- : getstatic # // Field util/Statistics$.MODULE$:Lutil/Statisti
- : getstatic # // Field TypesStats$.MODULE$:LTypesStats$;
- : invokevirtual # // Method TypesStats$.findMembersCount:()Lutil/S
- : invokevirtual # // Method util/Statistics$.incCounter:(Lutil/St
- : getstatic # // Field util/Statistics$.MODULE$:Lutil/Statisti
- : invokevirtual # // Method util/Statistics$.canEnable:()Z
- : ifeq
- : getstatic # // Field util/Statistics$.MODULE$:Lutil/Statisti
- : getstatic # // Field TypesStats$.MODULE$:LTypesStats$;
- : invokevirtual # // Method TypesStats$.typeOpsStack:()Lutil/Stati
- : new # // class Types$Type$$anonfun$
- : dup
- : invokespecial # // Method Types$Type$$anonfun$ ."":(LTypes
- : invokevirtual # // Method util/Statistics$.pushTimer:(Lutil/Stat
- : goto
- : aconst_null
- : astore
- : lload_3
- : lstore
- : lload_1
- : ldc _w # // long l
+ : lload_3
+ : lstore
+ : lload_1
+ : ldc _w # // long l
```