Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip restoring this when generating spill and unspill for coroutines #5386

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tripleCC
Copy link

As described in the associated YouTrack issue,there seems to be no need to restore this variable for suspend instance method.

@@ -657,7 +657,9 @@ class CoroutineTransformerMethodVisitor(
// Also, we spill and unspill null for visible dead variables
// `generateSpillAndUnspill` calls the probe from stdlib for us.
for (referenceToSpill in referencesToSpillBySuspensionPointIndex[suspensionPointIndex]) {
generateSpillAndUnspill(methodNode, suspension, referenceToSpill, suspendLambdaParameters)
// skip restoring this
val isInstanceThisVariable = !isStatic(methodNode.access) && referenceToSpill.slot == 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, move the variable into the generateSpillAndUnspill function. This way, you get rid of the parameter.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants