RFR: 8262891: Compiler implementation for Pattern Matching for switch (Preview) [v5]
Evgeny Mandrikov
godin at openjdk.java.net
Thu May 27 18:31:09 UTC 2021
On Thu, 27 May 2021 18:19:38 GMT, Rémi Forax <forax at openjdk.org> wrote:
> in your example, there is no guard so no backward goto
@forax btw this example is not about switch pattern matching - it is about already existing string switch, where indy not involed
void example(java.lang.String);
descriptor: (Ljava/lang/String;)V
flags: (0x0000)
Code:
stack=2, locals=4, args_size=2
0: aload_1
1: astore_2
2: iconst_m1
3: istore_3
4: aload_2
5: invokevirtual #7 // Method java/lang/String.hashCode:()I
8: lookupswitch { // 1
97: 28
default: 39
}
28: aload_2
29: ldc #13 // String a
31: invokevirtual #15 // Method java/lang/String.equals:(Ljava/lang/Object;)Z
34: ifeq 39
37: iconst_0
38: istore_3
39: iload_3
40: lookupswitch { // 1
0: 60
default: 68
}
60: getstatic #19 // Field java/lang/System.out:Ljava/io/PrintStream;
63: ldc #13 // String a
65: invokevirtual #25 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
68: return
LineNumberTable:
line 3: 0
line 5: 60
line 7: 68
StackMapTable: number_of_entries = 5
frame_type = 253 /* append */
offset_delta = 4
locals = [ class java/lang/String, int ]
frame_type = 23 /* same */
frame_type = 10 /* same */
frame_type = 20 /* same */
frame_type = 249 /* chop */
offset_delta = 7
-------------
PR: https://git.openjdk.java.net/jdk/pull/3863
More information about the compiler-dev
mailing list