diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-17 15:43:13 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-17 16:03:50 +0200 |
commit | 9fee7b6a2ac8663b0608b85001259320e1409a04 (patch) | |
tree | 3551b0f01c584566172438db32db508324fb633b /test | |
parent | 2bb960c68091b804d8ace1f76460279f6567a193 (diff) | |
download | scala-9fee7b6a2ac8663b0608b85001259320e1409a04.tar.gz scala-9fee7b6a2ac8663b0608b85001259320e1409a04.tar.bz2 scala-9fee7b6a2ac8663b0608b85001259320e1409a04.zip |
SI-7852 Omit null check for "".==
Although the same the code would be later optimized by -Yconst-opt,
we can offer the same lean byte code to those compiling without that
option by being more discerning when translating ==.
This helps people using bytecode based code coverage tools
such as jacoco that would emit "branch not covered" warnings
for the impossible null check.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t7852.check | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/test/files/run/t7852.check b/test/files/run/t7852.check index fdced88fa8..008639075a 100644 --- a/test/files/run/t7852.check +++ b/test/files/run/t7852.check @@ -2,29 +2,17 @@ class scala.tools.asm.tree.MethodNode LDC "" ALOAD 0 INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String; - ASTORE 1 - DUP - IFNONNULL L0 - POP - ALOAD 1 - IFNULL L1 - GOTO L2 - L0 - FRAME FULL [Lean java/lang/String] [java/lang/String] - ALOAD 1 INVOKEVIRTUAL java/lang/Object.equals (Ljava/lang/Object;)Z - IFEQ L2 - L1 - FRAME SAME + IFEQ L0 ICONST_1 - GOTO L3 - L2 + GOTO L1 + L0 FRAME SAME ICONST_0 - L3 + L1 FRAME SAME1 I POP RETURN MAXSTACK = 2 - MAXLOCALS = 2 + MAXLOCALS = 1 |