From 97b97ddbd7069d20d077958a3df73a58c6b730b1 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Wed, 26 Feb 2020 17:04:56 +0300 Subject: [PATCH] [JS IR] Fix phases - update phase description - remove unused phases --- .../kotlin/ir/backend/js/JsLoweringPhases.kt | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt index 91282290066..96943188c2c 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt @@ -132,12 +132,6 @@ val createScriptFunctionsPhase = makeJsModulePhase( description = "Create functions for initialize and evaluate script" ).toModuleLowering() -private val moveBodilessDeclarationsToSeparatePlacePhase = makeDeclarationTransformerPhase( - ::MoveBodilessDeclarationsToSeparatePlaceLowering, - name = "MoveBodilessDeclarationsToSeparatePlaceLowering", - description = "Move bodiless declarations to a separate place" -) - private val expectDeclarationsRemovingPhase = makeDeclarationTransformerPhase( ::ExpectDeclarationsRemoveLowering, name = "ExpectDeclarationsRemoving", @@ -168,13 +162,6 @@ private val stripTypeAliasDeclarationsPhase = makeDeclarationTransformerPhase( description = "Strip typealias declarations" ) -// TODO make all lambda-related stuff work with IrFunctionExpression and drop this phase -private val provisionalFunctionExpressionPhase = makeBodyLoweringPhase( - { ProvisionalFunctionExpressionLowering() }, - name = "FunctionExpression", - description = "Transform IrFunctionExpression to a local function reference" -) - private val arrayConstructorPhase = makeBodyLoweringPhase( ::ArrayConstructorLowering, name = "ArrayConstructor", @@ -282,10 +269,10 @@ private val sharedVariablesLoweringPhase = makeBodyLoweringPhase( description = "Box captured mutable variables" ) -private val callableReferenceLoweringX = makeBodyLoweringPhase( +private val callableReferenceLowering = makeBodyLoweringPhase( ::CallableReferenceLowering, - name = "CallableReferenceLoweringXX", - description = "Build a callable reference class and capture arguments" + name = "CallableReferenceLowering", + description = "Build a lambda/callable reference class" ) private val returnableBlockLoweringPhase = makeBodyLoweringPhase( @@ -373,13 +360,13 @@ private val privateMemberUsagesLoweringPhase = makeBodyLoweringPhase( private val interopCallableReferenceLoweringPhase = makeBodyLoweringPhase( ::InteropCallableReferenceLowering, - name = "CallableReferenceLowering", - description = "Handle callable references", + name = "InteropCallableReferenceLowering", + description = "Interop layer for function references and lambdas", prerequisite = setOf( suspendFunctionsLoweringPhase, localDeclarationsLoweringPhase, localDelegatedPropertiesLoweringPhase, - callableReferenceLoweringX + callableReferenceLowering ) ) @@ -595,7 +582,7 @@ val loweringList = listOf( functionInliningPhase, copyInlineFunctionBodyLoweringPhase, createScriptFunctionsPhase, - callableReferenceLoweringX, + callableReferenceLowering, singleAbstractMethodPhase, lateinitNullableFieldsPhase, lateinitDeclarationLoweringPhase,