RFR: 8262891: Compiler implementation for Pattern Matching for switch (Preview) [v4]
Rémi Forax
forax at openjdk.java.net
Tue May 25 14:16:59 UTC 2021
On Tue, 25 May 2021 12:20:02 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> Thanks Evgeny, I'll take a look.
>
> @forax, do you mean why there is "0" in:
> 11: invokedynamic #13, 0
> ?
Not this one, the one on the stack.
7: iconst_0 <---- this zero
8: istore_3
9: aload_2
10: iload_3
11: invokedynamic #13, 0 // InvokeDynamic
#0:typeSwitch:(Ljava/lang/Object;I)I
Why the descriptor is (Ljava/lang/Object;I)I instead of (Ljava/lang/Object;)I,
what is the semantics associated to that integer ?
> The "0" is an artifact of how invokedynamic is represented in the classfile (invokedynamic, 2 bytes of constant pool reference, byte 0, byte 0) - javap shows the value of the first zero byte. That is probably not needed anymore, but there is nothing special in this patch, I think - all invokedynamic calls look like this, AFAIK.
I know that a little to well, i'm one of the guys behind the design of indy :)
-------------
PR: https://git.openjdk.java.net/jdk/pull/3863
More information about the core-libs-dev
mailing list