diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-20 10:47:02 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-30 11:19:05 -0800 |
commit | 66cc6ee5736facc0cb7670d0f334aba2274630ee (patch) | |
tree | dae1e68ab2d42226769e2e6565d104d8e37a0193 | |
parent | 75b026b3327bd17bcc46a83d2ea7f00cded0b803 (diff) | |
download | scala-66cc6ee5736facc0cb7670d0f334aba2274630ee.tar.gz scala-66cc6ee5736facc0cb7670d0f334aba2274630ee.tar.bz2 scala-66cc6ee5736facc0cb7670d0f334aba2274630ee.zip |
Optimization in backend.
Eliminated one source of the thousands of copies of the same
Strings we had/have (strongly reachable) on the heap. It is
another good example of how constructor parameters unintentionally
become fields and how that in turn brings the pain.
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/Members.scala | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/Members.scala b/src/compiler/scala/tools/nsc/backend/icode/Members.scala index 2f43d43bdd..bb7ef4468c 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/Members.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/Members.scala @@ -24,9 +24,7 @@ trait Members { self: ICodes => * This class represents the intermediate code of a method or * other multi-block piece of code, like exception handlers. */ - class Code(label: String, method: IMethod) { - def this(method: IMethod) = this(method.symbol.simpleName.toString, method) - + class Code(method: IMethod) { /** The set of all blocks */ val blocks = mutable.ListBuffer[BasicBlock]() @@ -73,7 +71,7 @@ trait Members { self: ICodes => } /** This methods returns a string representation of the ICode */ - override def toString() : String = "ICode '" + label + "'"; + override def toString() : String = "ICode '" + method.symbol.decodedName + "'"; /* Compute a unique new label */ def nextLabel: Int = { |