Introduce local variable type checker.
CheckLocalVariablesTableTests will now check the validity of the locals table against types of locals computed based on the bytecode. These checks and the new destructuringInFor test act as a regression test for the changes in https://github.com/JetBrains/kotlin/pull/2613 These checks also caught a similar issue for destructuring lambda parameters, where the local is introduced before the value has been written to the local slot. This change also fixes that. Finally, this change fixes the asmLike tests to correctly look up the name of parameters in the locals table.
This commit is contained in:
@@ -5,7 +5,7 @@ public final class DeepInlineKt : java/lang/Object {
|
||||
1 $i$f$block: I
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String $this$block, int $i$a$-block-DeepInlineKt$foo$1$1$1) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
14 $this$block: J
|
||||
16 $i$a$-block-DeepInlineKt$foo$1$1$1: I
|
||||
@@ -22,4 +22,4 @@ public final class DeepInlineKt : java/lang/Object {
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -5,7 +5,7 @@ public final class DeepInlineWithLabelsKt : java/lang/Object {
|
||||
1 $i$f$block: I
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String $this$b3, int $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
14 $this$b3: J
|
||||
16 $i$a$-block-DeepInlineWithLabelsKt$foo$1$1$1: I
|
||||
@@ -22,4 +22,4 @@ public final class DeepInlineWithLabelsKt : java/lang/Object {
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -27,7 +27,7 @@ final class DeepNoinlineWithLabels_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda,
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $this$b2) {
|
||||
Local variables:
|
||||
3 z: Z
|
||||
0 this: LDeepNoinlineWithLabels_afterKt$foo$1$1;
|
||||
@@ -46,7 +46,7 @@ final class DeepNoinlineWithLabels_afterKt$foo$1 : kotlin/jvm/internal/Lambda, k
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $this$b1) {
|
||||
Local variables:
|
||||
3 y: Z
|
||||
0 this: LDeepNoinlineWithLabels_afterKt$foo$1;
|
||||
@@ -60,10 +60,10 @@ public final class DeepNoinlineWithLabels_afterKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $this$foo) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -27,7 +27,7 @@ final class DeepNoinlineWithLabels_beforeKt$foo$1$1 : kotlin/jvm/internal/Lambda
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $receiver) {
|
||||
Local variables:
|
||||
3 z: Z
|
||||
0 this: LDeepNoinlineWithLabels_beforeKt$foo$1$1;
|
||||
@@ -46,7 +46,7 @@ final class DeepNoinlineWithLabels_beforeKt$foo$1 : kotlin/jvm/internal/Lambda,
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $receiver) {
|
||||
Local variables:
|
||||
3 y: Z
|
||||
0 this: LDeepNoinlineWithLabels_beforeKt$foo$1;
|
||||
@@ -60,10 +60,10 @@ public final class DeepNoinlineWithLabels_beforeKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $receiver) {
|
||||
public final static void foo(java.lang.String $receiver, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $receiver: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ final class DeepNoinline_afterKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/jv
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $this$block) {
|
||||
Local variables:
|
||||
3 z: Z
|
||||
0 this: LDeepNoinline_afterKt$foo$1$1;
|
||||
@@ -42,7 +42,7 @@ final class DeepNoinline_afterKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $this$block) {
|
||||
Local variables:
|
||||
3 y: Z
|
||||
0 this: LDeepNoinline_afterKt$foo$1;
|
||||
@@ -56,10 +56,10 @@ public final class DeepNoinline_afterKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $this$foo) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ final class DeepNoinline_beforeKt$foo$1$1 : kotlin/jvm/internal/Lambda, kotlin/j
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $receiver) {
|
||||
Local variables:
|
||||
3 z: Z
|
||||
0 this: LDeepNoinline_beforeKt$foo$1$1;
|
||||
@@ -42,7 +42,7 @@ final class DeepNoinline_beforeKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm
|
||||
|
||||
public java.lang.Object invoke(java.lang.Object p0)
|
||||
|
||||
public final void invoke(long this) {
|
||||
public final void invoke(long $receiver) {
|
||||
Local variables:
|
||||
3 y: Z
|
||||
0 this: LDeepNoinline_beforeKt$foo$1;
|
||||
@@ -56,10 +56,10 @@ public final class DeepNoinline_beforeKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $receiver) {
|
||||
public final static void foo(java.lang.String $receiver, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $receiver: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ public final class InlineReceiversKt : java/lang/Object {
|
||||
1 $i$f$block: I
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String $this$block, int $i$a$-block-InlineReceiversKt$foo$1) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
4 $this$block: J
|
||||
6 $i$a$-block-InlineReceiversKt$foo$1: I
|
||||
@@ -14,4 +14,4 @@ public final class InlineReceiversKt : java/lang/Object {
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,13 +103,13 @@ final class MangledNamesKt$foo$1 : kotlin/jvm/internal/Lambda, kotlin/jvm/functi
|
||||
|
||||
public final void invoke(Arr $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化) {
|
||||
Local variables:
|
||||
0 this: LMangledNamesKt$foo$1;
|
||||
1 $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化: LArr;
|
||||
2 a b: I
|
||||
3 b$c: I
|
||||
4 c-d: I
|
||||
5 b$$c--d: I
|
||||
6 a()§&*&^@あ化: I
|
||||
0 this: LMangledNamesKt$foo$1;
|
||||
1 $dstr$a_u20b$b_u24c$c_u2dd$b_u24_u24c_u2d_u2dd$a_u28_u29§_u26_u2a_u26_u5e_u40あ化: LArr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -22,10 +22,10 @@ public final class NonInlineReceivers_afterKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $this$foo) {
|
||||
public final static void foo(java.lang.String $this$foo, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $this$foo: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -22,10 +22,10 @@ public final class NonInlineReceivers_beforeKt : java/lang/Object {
|
||||
0 block: Lkotlin/jvm/functions/Function1;
|
||||
}
|
||||
|
||||
public final static void foo(java.lang.String x, int $receiver) {
|
||||
public final static void foo(java.lang.String $receiver, int count) {
|
||||
Local variables:
|
||||
2 x: Z
|
||||
0 $receiver: Ljava/lang/String;
|
||||
1 count: I
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user