[K/JS] Process JS-specific returnable blocks before the state machine building

^KT-60785 Fixed
^KT-63207 Fixed
This commit is contained in:
Artem Kobzar
2023-11-16 13:25:51 +00:00
committed by Space Team
parent 36452b5db7
commit 890fbd6b0b
15 changed files with 75 additions and 10 deletions
@@ -429,7 +429,8 @@ private val innerClassConstructorCallsLoweringPhase = makeIrModulePhase<JsIrBack
private val suspendFunctionsLoweringPhase = makeIrModulePhase(
::JsSuspendFunctionsLowering,
name = "SuspendFunctionsLowering",
description = "Transform suspend functions into CoroutineImpl instance and build state machine"
description = "Transform suspend functions into CoroutineImpl instance and build state machine",
prerequisite = setOf(returnableBlockLoweringPhase)
)
private val addContinuationToNonLocalSuspendFunctionsLoweringPhase = makeIrModulePhase(
@@ -826,6 +827,7 @@ val loweringList = listOf<SimpleNamedCompilerPhase<JsIrBackendContext, IrModuleF
enumUsageLoweringPhase,
externalEnumUsageLoweringPhase,
enumEntryRemovalLoweringPhase,
returnableBlockLoweringPhase,
suspendFunctionsLoweringPhase,
propertyReferenceLoweringPhase,
interopCallableReferenceLoweringPhase,
@@ -833,7 +835,6 @@ val loweringList = listOf<SimpleNamedCompilerPhase<JsIrBackendContext, IrModuleF
addContinuationToNonLocalSuspendFunctionsLoweringPhase,
addContinuationToLocalSuspendFunctionsLoweringPhase,
addContinuationToFunctionCallsLoweringPhase,
returnableBlockLoweringPhase,
rangeContainsLoweringPhase,
forLoopsLoweringPhase,
primitiveCompanionLoweringPhase,