Do not duplicate $result in LVT
#KT-47749
This commit is contained in:
+1
-1
@@ -1315,7 +1315,7 @@ private fun updateLvtAccordingToLiveness(method: MethodNode, isForNamedFunction:
|
|||||||
if (isAlive(insnIndex, variableIndex) && !isAlive(insnIndex + 1, variableIndex)) {
|
if (isAlive(insnIndex, variableIndex) && !isAlive(insnIndex + 1, variableIndex)) {
|
||||||
// No variable in LVT -> do not add one
|
// No variable in LVT -> do not add one
|
||||||
val lvtRecord = oldLvt.findRecord(insnIndex, variableIndex) ?: continue
|
val lvtRecord = oldLvt.findRecord(insnIndex, variableIndex) ?: continue
|
||||||
if (lvtRecord.name == CONTINUATION_VARIABLE_NAME) continue
|
if (lvtRecord.name == CONTINUATION_VARIABLE_NAME || lvtRecord.name == SUSPEND_CALL_RESULT_NAME) continue
|
||||||
// End the local when it is no longer live. Since it is not live, we will not spill and unspill it across
|
// End the local when it is no longer live. Since it is not live, we will not spill and unspill it across
|
||||||
// suspension points. It is tempting to keep it alive until the next suspension point to leave it visible in
|
// suspension points. It is tempting to keep it alive until the next suspension point to leave it visible in
|
||||||
// the debugger for as long as possible. However, in the case of loops, the resumption after suspension can
|
// the debugger for as long as possible. However, in the case of loops, the resumption after suspension can
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ class A {
|
|||||||
// BEs generate continuation classes differently, JVM_IR generates more correctly
|
// BEs generate continuation classes differently, JVM_IR generates more correctly
|
||||||
|
|
||||||
// foo, c's lambda and foo's continuation
|
// foo, c's lambda and foo's continuation
|
||||||
// 8 LOCALVARIABLE \$result Ljava/lang/Object;
|
// 3 LOCALVARIABLE \$result Ljava/lang/Object;
|
||||||
|
|
||||||
// foo x 3 since we split the local over restore code for the two calls to block(), and <init>
|
// foo x 3 since we split the local over restore code for the two calls to block(), and <init>
|
||||||
// 4 LOCALVARIABLE this LA;
|
// 4 LOCALVARIABLE this LA;
|
||||||
|
|||||||
Reference in New Issue
Block a user