[Wasm] Implement IrLinkageError end enable partial linker
KT-58088
This commit is contained in:
committed by
Space Team
parent
2e787c50be
commit
c0f387dbd1
@@ -795,7 +795,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
mode = arguments.partialLinkageMode,
|
||||
logLevel = arguments.partialLinkageLogLevel,
|
||||
compilerModeAllowsUsingPartialLinkage =
|
||||
/* disabled for WASM for now */ !arguments.wasm && /* no PL when producing KLIB */ arguments.includes != null,
|
||||
/* no PL when producing KLIB */ arguments.includes != null,
|
||||
onWarning = { messageCollector.report(WARNING, it) },
|
||||
onError = { messageCollector.report(ERROR, it) }
|
||||
)
|
||||
|
||||
@@ -110,6 +110,8 @@ class WasmSymbols(
|
||||
override val returnIfSuspended =
|
||||
getInternalFunction("returnIfSuspended")
|
||||
|
||||
val throwLinkageError = getInternalFunction("throwLinkageError")
|
||||
|
||||
val enumEntries = getIrClass(FqName.fromSegments(listOf("kotlin", "enums", "EnumEntries")))
|
||||
val createEnumEntries = findFunctions(enumsInternalPackage.memberScope, Name.identifier("enumEntries"))
|
||||
.find { it.valueParameters.firstOrNull()?.type?.isFunctionType == false }
|
||||
|
||||
+3
@@ -43,6 +43,9 @@ class BuiltInsLowering(val context: WasmBackendContext) : FileLoweringPass {
|
||||
builder: DeclarationIrBuilder
|
||||
): IrExpression {
|
||||
when (val symbol = call.symbol) {
|
||||
irBuiltins.linkageErrorSymbol -> {
|
||||
return irCall(call, context.wasmSymbols.throwLinkageError)
|
||||
}
|
||||
irBuiltins.ieee754equalsFunByOperandType[irBuiltins.floatClass] -> {
|
||||
if (call.getValueArgument(0)!!.type.isNullable() || call.getValueArgument(1)!!.type.isNullable()) {
|
||||
return irCall(call, symbols.nullableFloatIeee754Equals)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package kotlin.wasm.internal
|
||||
|
||||
internal class IrLinkageError(message: String?) : Error(message)
|
||||
|
||||
internal fun throwLinkageError(message: String?): Nothing {
|
||||
throw IrLinkageError(message)
|
||||
}
|
||||
Reference in New Issue
Block a user