From e3184e407d4f547b6827c6cfa40d918c449ad930 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Fri, 7 Feb 2020 14:42:25 -0800 Subject: [PATCH] KT-20844 Re-enable stack spilling during inline. `dx` has entered the final stage of sunset: https://android-developers.googleblog.com/2020/02/the-path-to-dx-deprecation.html --- .../src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt | 5 ----- .../codegen/bytecodeText/storeStackBeforeInline/simple.kt | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt index ea369419f42..7d0e4e7d3cd 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.kt @@ -150,12 +150,7 @@ abstract class InlineCodegen( } } - @Suppress("UNREACHABLE_CODE") private fun canSkipStackSpillingOnInline(methodNode: MethodNode): Boolean { - // TODO: Temporary disable this optimization until - // https://issuetracker.google.com/issues/68796377 is fixed - // or until d8 substitute dex - return false // Stack spilling before inline function 'f' call is required if: // - 'f' is a suspend function // - 'f' has try-catch blocks diff --git a/compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt b/compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt index 5a4f6634e82..c5decec1944 100644 --- a/compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt +++ b/compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt @@ -9,6 +9,6 @@ fun foo() : Int { } // fake inline variables occupy 2 ISTOREs. -// 5 ISTORE -// 7 ILOAD +// 3 ISTORE +// 5 ILOAD // 0 InlineMarker