[K/Wasm] Optimize range checks
This commit is contained in:
@@ -115,6 +115,12 @@ private val lateinitUsageLoweringPhase = makeWasmModulePhase(
|
|||||||
description = "Insert checks for lateinit field references"
|
description = "Insert checks for lateinit field references"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
private val rangeContainsLoweringPhase = makeWasmModulePhase(
|
||||||
|
::RangeContainsLowering,
|
||||||
|
name = "RangeContainsLowering",
|
||||||
|
description = "[Optimization] Optimizes calls to contains() for ClosedRanges"
|
||||||
|
)
|
||||||
|
|
||||||
private val arrayConstructorReferencePhase = makeWasmModulePhase(
|
private val arrayConstructorReferencePhase = makeWasmModulePhase(
|
||||||
::WasmArrayConstructorReferenceLowering,
|
::WasmArrayConstructorReferenceLowering,
|
||||||
name = "ArrayConstructorReference",
|
name = "ArrayConstructorReference",
|
||||||
@@ -637,6 +643,7 @@ val wasmPhases = SameTypeNamedCompilerPhase(
|
|||||||
lateinitNullableFieldsPhase then
|
lateinitNullableFieldsPhase then
|
||||||
lateinitDeclarationLoweringPhase then
|
lateinitDeclarationLoweringPhase then
|
||||||
lateinitUsageLoweringPhase then
|
lateinitUsageLoweringPhase then
|
||||||
|
rangeContainsLoweringPhase then
|
||||||
arrayConstructorReferencePhase then
|
arrayConstructorReferencePhase then
|
||||||
arrayConstructorPhase then
|
arrayConstructorPhase then
|
||||||
sharedVariablesLoweringPhase then
|
sharedVariablesLoweringPhase then
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// TARGET_BACKEND: WASM
|
// TARGET_BACKEND: WASM
|
||||||
|
|
||||||
// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 48_430
|
// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 40_730
|
||||||
// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_552
|
// WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 4_552
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
Reference in New Issue
Block a user