diff options
author | Paul Phillips <paulp@improving.org> | 2011-01-15 23:21:25 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-01-15 23:21:25 +0000 |
commit | 866801385f81417a2ac33916280df918e4bd5b3b (patch) | |
tree | 17cf474ab89a37804af270c97852d580a576beec /test/files/neg | |
parent | 604797b64518cbd75583e6ac14876552d6598c9d (diff) | |
download | scala-866801385f81417a2ac33916280df918e4bd5b3b.tar.gz scala-866801385f81417a2ac33916280df918e4bd5b3b.tar.bz2 scala-866801385f81417a2ac33916280df918e4bd5b3b.zip |
Optimization to string concatenation.
with a primitive CONCAT and several opcodes, I'm assuming nobody will
oppose this on principle. Given an expression of the exact form "" + x
(that is, the NPE-immune and much less ugly way to call .toString) we
used to get 4x the bytecode and create an unneeded StringBuilder. Now
this:
0: aload_1
1: invokestatic #20; //Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
4: areturn
Closes #4160, review by dragos.
Diffstat (limited to 'test/files/neg')
0 files changed, 0 insertions, 0 deletions