Skip to content

Commit

Permalink
Skip restoring this when generating spill and unspill for coroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
songruiwang committed Dec 19, 2024
1 parent eacf69f commit bca64cc
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@ class CoroutineTransformerMethodVisitor(
)
})

if (spillableVariable.slot !in suspendLambdaParameters) {
// skip restoring this
val isInstanceThisVariable = !isStatic(methodNode.access) && spillableVariable.slot == 0
if (spillableVariable.slot !in suspendLambdaParameters && !isInstanceThisVariable) {
// restore variable after suspension call
insert(suspension.tryCatchBlockEndLabelAfterSuspensionCall, withInstructionAdapter {
load(continuationIndex, AsmTypes.OBJECT_TYPE)
Expand Down

0 comments on commit bca64cc

Please sign in to comment.