JVM IR: Avoid direct invokes in callable reference tests

Due to the direct invoke optimization, most callable reference tests
were not generating callable references/lambdas.
This commit is contained in:
Steven Schäfer
2022-06-13 14:49:49 +02:00
committed by Alexander Udalov
parent f0238766df
commit 7d59c7689c
123 changed files with 216 additions and 208 deletions
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
class Outer (val x: String) {
inner class Inner(val y: String) {
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
class C(val x: String) {
fun foo(s: String) = x + s
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
class C(x: String, y: String) {
val yx = y + x
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
fun box() =
{ k: String ->
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
fun box() =
(fun (s: String): String {
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
fun ok(s: String) = "O" + s
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
fun box() =
{ s: String ->
@@ -1,6 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 Function(^.)*.invoke
// 0 invoke
class Outer (val x: String) {
inner class Inner(val y: String) {
@@ -1,2 +1,6 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 0 invoke
fun box(): String =
(String::plus)("O", "K")