[IR BE] Don't use symbol table in SuspendFunctionLowering
This commit is contained in:
+7
-7
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.ir.util.defaultType
|
|||||||
import org.jetbrains.kotlin.ir.visitors.*
|
import org.jetbrains.kotlin.ir.visitors.*
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
|
|
||||||
abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val context: C, val symbolTable: SymbolTable) : FileLoweringPass {
|
abstract class AbstractSuspendFunctionsLowering<C : CommonBackendContext>(val context: C) : FileLoweringPass {
|
||||||
|
|
||||||
protected object STATEMENT_ORIGIN_COROUTINE_IMPL : IrStatementOriginImpl("COROUTINE_IMPL")
|
protected object STATEMENT_ORIGIN_COROUTINE_IMPL : IrStatementOriginImpl("COROUTINE_IMPL")
|
||||||
protected object DECLARATION_ORIGIN_COROUTINE_IMPL : IrDeclarationOriginImpl("COROUTINE_IMPL")
|
protected object DECLARATION_ORIGIN_COROUTINE_IMPL : IrDeclarationOriginImpl("COROUTINE_IMPL")
|
||||||
@@ -272,7 +272,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrClassImpl(
|
IrClassImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceClass(d),
|
IrClassSymbolImpl(d),
|
||||||
"${irFunction.name}COROUTINE\$${coroutineId++}".synthesizedName,
|
"${irFunction.name}COROUTINE\$${coroutineId++}".synthesizedName,
|
||||||
ClassKind.CLASS,
|
ClassKind.CLASS,
|
||||||
irFunction.visibility,
|
irFunction.visibility,
|
||||||
@@ -377,7 +377,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrConstructorImpl(
|
IrConstructorImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceConstructor(d),
|
IrConstructorSymbolImpl(d),
|
||||||
coroutineBaseClassConstructor.name,
|
coroutineBaseClassConstructor.name,
|
||||||
irFunction.visibility,
|
irFunction.visibility,
|
||||||
coroutineClass.defaultType,
|
coroutineClass.defaultType,
|
||||||
@@ -422,7 +422,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrConstructorImpl(
|
IrConstructorImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceConstructor(d),
|
IrConstructorSymbolImpl(d),
|
||||||
coroutineBaseClassConstructor.name,
|
coroutineBaseClassConstructor.name,
|
||||||
irFunction.visibility,
|
irFunction.visibility,
|
||||||
coroutineClass.defaultType,
|
coroutineClass.defaultType,
|
||||||
@@ -467,7 +467,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceSimpleFunction(d),
|
IrSimpleFunctionSymbolImpl(d),
|
||||||
Name.identifier("create"),
|
Name.identifier("create"),
|
||||||
Visibilities.PROTECTED,
|
Visibilities.PROTECTED,
|
||||||
Modality.FINAL,
|
Modality.FINAL,
|
||||||
@@ -532,7 +532,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceSimpleFunction(d),
|
IrSimpleFunctionSymbolImpl(d),
|
||||||
Name.identifier("invoke"),
|
Name.identifier("invoke"),
|
||||||
Visibilities.PROTECTED,
|
Visibilities.PROTECTED,
|
||||||
Modality.FINAL,
|
Modality.FINAL,
|
||||||
@@ -590,7 +590,7 @@ abstract class AbstractSuspendFunctionsLowering<C: CommonBackendContext>(val con
|
|||||||
IrFunctionImpl(
|
IrFunctionImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
DECLARATION_ORIGIN_COROUTINE_IMPL,
|
||||||
symbolTable.referenceSimpleFunction(d),
|
IrSimpleFunctionSymbolImpl(d),
|
||||||
stateMachineFunction.name,
|
stateMachineFunction.name,
|
||||||
stateMachineFunction.visibility,
|
stateMachineFunction.visibility,
|
||||||
Modality.FINAL,
|
Modality.FINAL,
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.ir.visitors.acceptVoid
|
|||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.utils.DFS
|
import org.jetbrains.kotlin.utils.DFS
|
||||||
|
|
||||||
class JsSuspendFunctionsLowering(ctx: JsIrBackendContext) : AbstractSuspendFunctionsLowering<JsIrBackendContext>(ctx, ctx.symbolTable) {
|
class JsSuspendFunctionsLowering(ctx: JsIrBackendContext) : AbstractSuspendFunctionsLowering<JsIrBackendContext>(ctx) {
|
||||||
|
|
||||||
private val coroutineImplExceptionPropertyGetter = ctx.coroutineImplExceptionPropertyGetter
|
private val coroutineImplExceptionPropertyGetter = ctx.coroutineImplExceptionPropertyGetter
|
||||||
private val coroutineImplExceptionPropertySetter = ctx.coroutineImplExceptionPropertySetter
|
private val coroutineImplExceptionPropertySetter = ctx.coroutineImplExceptionPropertySetter
|
||||||
|
|||||||
Reference in New Issue
Block a user