[Wasm] Major compiler and stdlib update

This commit is contained in:
Svyatoslav Kuzmich
2020-04-27 14:39:20 +03:00
parent 3be38d1796
commit bfd0f21e9d
196 changed files with 12635 additions and 4774 deletions
@@ -295,6 +295,9 @@ abstract class Symbols<out T : CommonBackendContext>(val context: T, irBuiltIns:
abstract val throwKotlinNothingValueException: IrSimpleFunctionSymbol
open val throwISE: IrSimpleFunctionSymbol
get() = error("throwISE is not implemented")
abstract val stringBuilder: IrClassSymbol
abstract val defaultConstructorMarker: IrClassSymbol
@@ -271,9 +271,13 @@ class InlineClassLowering(val context: CommonBackendContext) {
}
}
private fun Name.toInlineClassImplementationName() = when {
isSpecial -> Name.special(asString() + INLINE_CLASS_IMPL_SUFFIX)
else -> Name.identifier(asString() + INLINE_CLASS_IMPL_SUFFIX)
private fun IrFunction.toInlineClassImplementationName(): Name {
val klass = this.parentAsClass!!
val newName = klass.name.asString() + "__" + name.asString() + INLINE_CLASS_IMPL_SUFFIX
return when {
name.isSpecial -> Name.special("<" + newName + ">")
else -> Name.identifier(newName)
}
}
private fun collectTypeParameters(declaration: IrTypeParametersContainer): List<IrTypeParameter> {
@@ -292,7 +296,7 @@ class InlineClassLowering(val context: CommonBackendContext) {
private fun createStaticBodilessMethod(function: IrFunction): IrSimpleFunction =
context.irFactory.createStaticFunctionWithReceivers(
function.parent,
function.name.toInlineClassImplementationName(),
function.toInlineClassImplementationName(),
function,
typeParametersFromContext = collectTypeParameters(function.parentAsClass)
)