[WASM] Function call codegen refactoring
This commit is contained in:
+10
-9
@@ -269,16 +269,17 @@ class BodyGenerator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Some intrinsics are a special case because we want to remove them completely, including their arguments.
|
// Some intrinsics are a special case because we want to remove them completely, including their arguments.
|
||||||
val removableIntrinsics = buildList {
|
if (!backendContext.configuration.getNotNull(JSConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS)) {
|
||||||
if (backendContext.configuration.getNotNull(JSConfigurationKeys.WASM_ENABLE_ARRAY_RANGE_CHECKS) == false)
|
if (call.symbol == wasmSymbols.rangeCheck) {
|
||||||
add(wasmSymbols.rangeCheck)
|
body.buildGetUnit()
|
||||||
if (backendContext.configuration.getNotNull(JSConfigurationKeys.WASM_ENABLE_ASSERTS) == false)
|
return
|
||||||
addAll(wasmSymbols.assertFuncs)
|
}
|
||||||
}
|
}
|
||||||
|
if (!backendContext.configuration.getNotNull(JSConfigurationKeys.WASM_ENABLE_ASSERTS)) {
|
||||||
if (call.symbol in removableIntrinsics) {
|
if (call.symbol in wasmSymbols.assertFuncs) {
|
||||||
body.buildGetUnit()
|
body.buildGetUnit()
|
||||||
return
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val function: IrFunction = call.symbol.owner.realOverrideTarget
|
val function: IrFunction = call.symbol.owner.realOverrideTarget
|
||||||
|
|||||||
Reference in New Issue
Block a user