JVM IR: Remove bridge construction from CallableReferenceLowering

This commit is contained in:
Steven Schäfer
2019-07-25 16:52:15 +02:00
committed by Georgy Bronnikov
parent ebb59d51d2
commit 6aa8ecd745
9 changed files with 214 additions and 304 deletions
@@ -1,6 +1,6 @@
// !LANGUAGE: +FunctionTypesWithBigArity
// WITH_RUNTIME
// TARGET_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: J.java
// import kotlin.jvm.functions.Arity;
@@ -20,7 +20,7 @@ public class J {
throw new AssertionError("Bad return value from function");
}
} catch (IllegalArgumentException e) {
if (i == 3 || i == 13 || i == 30 || i == 33) {
if (i == 30) {
throw new AssertionError(String.format("Call with %d arguments is expected to succeed", i), e);
}
// OK
@@ -35,7 +35,7 @@ public class J {
"Incorrect exception (IllegalArgumentException expected): " + e.getClass().getName() + ", i = " + i, e
);
}
if (i != 3 && i != 13 && i != 30 && i != 33) {
if (i != 30) {
throw new AssertionError ("IllegalArgumentException expected, but nothing was thrown, i = " + i);
}
}
@@ -47,9 +47,7 @@ public class J {
class Fun : (Int, Int, Int) -> Int,
(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) -> Int,
(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int,
Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) -> Int,
(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int,
Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) -> Int {
Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int) -> Int {
override fun invoke(p00: Int, p01: Int, p02: Int): Int = 303
override fun invoke(
@@ -62,13 +60,6 @@ class Fun : (Int, Int, Int) -> Int,
p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int,
p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int
): Int = 330
override fun invoke(
p00: Int, p01: Int, p02: Int, p03: Int, p04: Int, p05: Int, p06: Int, p07: Int, p08: Int, p09: Int,
p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int,
p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int,
p30: Int, p31: Int, p32: Int
): Int = 333
}
fun box(): String {