Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement unit suspend functions tail-call optimisation
Unlike previously, this optimisation works on every callee return type. Tail-calls inside unit functions can be either INVOKE... ARETURN or INVOKE POP GETSTATIC kotlin/Unit.INSTANCE ARETURN The first pattern is already covered. The second one is a bit tricky, since we cannot just assume than the function is tail-call, we also need to check whether the callee returned COROUTINE_SUSPENDED marker. Thus, resulting bytecode of function's 'epilogue' look like DUP INVOKESTATIC getCOROUTINE_SUSPENDED IF_ACMPNE LN ARETURN LN: POP #KT-28938 Fixed
- Loading branch information
Showing
13 changed files
with
156 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.