JVM_IR: reorganize throw... functions in Symbols

This commit is contained in:
Georgy Bronnikov
2020-08-05 23:39:42 +03:00
parent 6a16d6a246
commit 7f4df19dd1
12 changed files with 94 additions and 82 deletions
@@ -173,19 +173,19 @@ class JsIrBackendContext(
override val ir = object : Ir<JsIrBackendContext>(this, irModuleFragment) {
override val symbols = object : Symbols<JsIrBackendContext>(this@JsIrBackendContext, irBuiltIns, symbolTable) {
override val ThrowNullPointerException =
override val throwNullPointerException =
symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_NPE"))).single())
override val ThrowNoWhenBranchMatchedException =
override val throwNoWhenBranchMatchedException =
symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("noWhenBranchMatchedException"))).single())
override val ThrowTypeCastException =
override val throwTypeCastException =
symbolTable.referenceSimpleFunction(getFunctions(kotlinPackageFqn.child(Name.identifier("THROW_CCE"))).single())
override val ThrowUninitializedPropertyAccessException =
override val throwUninitializedPropertyAccessException =
symbolTable.referenceSimpleFunction(getFunctions(FqName("kotlin.throwUninitializedPropertyAccessException")).single())
override val ThrowKotlinNothingValueException: IrSimpleFunctionSymbol =
override val throwKotlinNothingValueException: IrSimpleFunctionSymbol =
symbolTable.referenceSimpleFunction(getFunctions(FqName("kotlin.throwKotlinNothingValueException")).single())
override val defaultConstructorMarker =
@@ -39,8 +39,8 @@ class TypeOperatorLowering(val context: JsIrBackendContext) : BodyLoweringPass {
private val devMode = context.devMode
//NOTE: Should we define JS-own functions similar to current implementation?
private val throwCCE = context.ir.symbols.ThrowTypeCastException
private val throwNPE = context.ir.symbols.ThrowNullPointerException
private val throwCCE = context.ir.symbols.throwTypeCastException
private val throwNPE = context.ir.symbols.throwNullPointerException
private val eqeq = context.irBuiltIns.eqeqSymbol