Generate separate methods for inline and noinline uses of inline suspend functions
Previously, inline suspend functions were effectively inline only, but ordinary inline functions can be used as noinline. To fix the issue, I generate two functions: one for inline with suffix $$forInline and without state machine; and the other one without any suffix and state machine for direct calls. This change does not affect effectively inline only suspend functions, i.e. functions with reified generics, annotated with @InlineOnly annotation and functions with crossinline parameters. #KT-20219: Fixed
This commit is contained in:
+1
@@ -107,6 +107,7 @@ abstract class AbstractLightAnalysisModeTest : CodegenTestCase() {
|
||||
|
||||
override fun shouldWriteMethod(access: Int, name: String, desc: String) = when {
|
||||
name == "<clinit>" -> false
|
||||
name.contains("\$\$forInline") -> false
|
||||
AsmTypes.DEFAULT_CONSTRUCTOR_MARKER.descriptor in desc -> false
|
||||
name.startsWith("access$") && (access and ACC_STATIC != 0) && (access and ACC_SYNTHETIC != 0) -> false
|
||||
else -> true
|
||||
|
||||
@@ -128,6 +128,9 @@ object InlineTestUtil {
|
||||
if (skipMethodsOfThisClass) {
|
||||
return null
|
||||
}
|
||||
if (name == "doResume" && desc == "(Ljava/lang/Object;Ljava/lang/Throwable;)Ljava/lang/Object;") {
|
||||
return null
|
||||
}
|
||||
|
||||
return object : MethodNode(Opcodes.ASM5, access, name, desc, signature, exceptions) {
|
||||
override fun visitMethodInsn(opcode: Int, owner: String, name: String, desc: String, itf: Boolean) {
|
||||
|
||||
Reference in New Issue
Block a user