Skip to content

Instantly share code, notes, and snippets.

@retronym
Last active November 24, 2015 04:33
Show Gist options
  • Save retronym/0d8f7126157061d72b81 to your computer and use it in GitHub Desktop.
Save retronym/0d8f7126157061d72b81 to your computer and use it in GitHub Desktop.
class Test {
def test = {
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) match {
case (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) =>
case _ =>
}
}
}
--- sandbox/old.log 2015-11-24 14:23:46.000000000 +1000
+++ sandbox/new.log 2015-11-24 14:23:26.000000000 +1000
@@ -1,203 +1,167 @@
[[syntax trees at end of patmat]] // test.scala
package <empty> {
class Test extends scala.AnyRef {
def <init>(): Test = {
Test.super.<init>();
()
};
def test: Unit = {
case <synthetic> val x1: (Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) = scala.Tuple10.apply[Int, Int, Int, Int, Int, Int, Int, Int, Int, Int](1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
case24(){
if (x1.ne(null))
{
<synthetic> val p2: Int = x1._1;
<synthetic> val p3: Int = x1._2;
<synthetic> val p4: Int = x1._3;
<synthetic> val p5: Int = x1._4;
<synthetic> val p6: Int = x1._5;
<synthetic> val p7: Int = x1._6;
<synthetic> val p8: Int = x1._7;
<synthetic> val p9: Int = x1._8;
<synthetic> val p10: Int = x1._9;
<synthetic> val p11: Int = x1._10;
- if (1.==(p2))
- if (2.==(p3))
- if (3.==(p4))
- if (4.==(p5))
- if (5.==(p6))
- if (6.==(p7))
- if (7.==(p8))
- if (8.==(p9))
- if (9.==(p10))
- if (10.==(p11))
- matchEnd23(())
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
- else
- case25()
+ if (1.==(p2).&&(2.==(p3).&&(3.==(p4).&&(4.==(p5).&&(5.==(p6).&&(6.==(p7).&&(7.==(p8).&&(8.==(p9).&&(9.==(p10).&&(10.==(p11)))))))))))
+ matchEnd23(())
else
case25()
}
else
case25()
};
case25(){
matchEnd23(())
};
matchEnd23(x: Unit){
x
}
}
}
}
Compiled from "test.scala"
public class Test {
public void test();
Code:
0: new #12 // class scala/Tuple10
3: dup
4: iconst_1
5: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
8: iconst_2
9: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
12: iconst_3
13: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
16: iconst_4
17: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
20: iconst_5
21: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
24: bipush 6
26: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
29: bipush 7
31: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
34: bipush 8
36: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
39: bipush 9
41: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
44: bipush 10
46: invokestatic #18 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
49: invokespecial #22 // Method scala/Tuple10."<init>":(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
52: astore_2
53: aload_2
54: ifnonnull 60
- 57: goto 280
+ 57: goto 253
60: aload_2
61: invokevirtual #26 // Method scala/Tuple10._1:()Ljava/lang/Object;
64: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
67: istore_3
68: aload_2
69: invokevirtual #33 // Method scala/Tuple10._2:()Ljava/lang/Object;
72: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
75: istore 4
77: aload_2
78: invokevirtual #36 // Method scala/Tuple10._3:()Ljava/lang/Object;
81: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
84: istore 5
86: aload_2
87: invokevirtual #39 // Method scala/Tuple10._4:()Ljava/lang/Object;
90: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
93: istore 6
95: aload_2
96: invokevirtual #42 // Method scala/Tuple10._5:()Ljava/lang/Object;
99: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
102: istore 7
104: aload_2
105: invokevirtual #45 // Method scala/Tuple10._6:()Ljava/lang/Object;
108: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
111: istore 8
113: aload_2
114: invokevirtual #48 // Method scala/Tuple10._7:()Ljava/lang/Object;
117: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
120: istore 9
122: aload_2
123: invokevirtual #51 // Method scala/Tuple10._8:()Ljava/lang/Object;
126: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
129: istore 10
131: aload_2
132: invokevirtual #54 // Method scala/Tuple10._9:()Ljava/lang/Object;
135: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
138: istore 11
140: aload_2
141: invokevirtual #57 // Method scala/Tuple10._10:()Ljava/lang/Object;
144: invokestatic #30 // Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I
147: istore 12
149: iconst_1
150: iload_3
151: if_icmpeq 157
- 154: goto 277
+ 154: goto 250
157: iconst_2
158: iload 4
160: if_icmpeq 166
- 163: goto 274
+ 163: goto 250
166: iconst_3
167: iload 5
169: if_icmpeq 175
- 172: goto 271
+ 172: goto 250
175: iconst_4
176: iload 6
178: if_icmpeq 184
- 181: goto 268
+ 181: goto 250
184: iconst_5
185: iload 7
187: if_icmpeq 193
- 190: goto 265
+ 190: goto 250
193: bipush 6
195: iload 8
197: if_icmpeq 203
- 200: goto 262
+ 200: goto 250
203: bipush 7
205: iload 9
207: if_icmpeq 213
- 210: goto 259
+ 210: goto 250
213: bipush 8
215: iload 10
217: if_icmpeq 223
- 220: goto 256
+ 220: goto 250
223: bipush 9
225: iload 11
227: if_icmpeq 233
- 230: goto 253
+ 230: goto 250
233: bipush 10
235: iload 12
237: if_icmpeq 243
240: goto 250
243: getstatic #63 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit;
246: astore_1
- 247: goto 290
- 250: goto 283
- 253: goto 283
- 256: goto 283
- 259: goto 283
- 262: goto 283
- 265: goto 283
- 268: goto 283
- 271: goto 283
- 274: goto 283
- 277: goto 283
- 280: goto 283
- 283: getstatic #63 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit;
- 286: astore_1
- 287: goto 290
- 290: return
+ 247: goto 263
+ 250: goto 256
+ 253: goto 256
+ 256: getstatic #63 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit;
+ 259: astore_1
+ 260: goto 263
+ 263: return
public Test();
Code:
0: aload_0
1: invokespecial #67 // Method java/lang/Object."<init>":()V
4: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment