[JS IR] Materialize Unit more aggressively for IrCalls
Unit materialization for IrCall is required for operations with dynamic type. However it produces useless Unit_getInstance() calls, especially in return expressions. The pach also adds some heuristics for reducing the amount of Unit_getInstance() calls from return expressions: do not add Unit_getInstance() if return value has Unit type. Relaited to KT-51139 ^KT-23252 Fixed
This commit is contained in:
committed by
Space
parent
677ec12b50
commit
57f16e801f
@@ -5352,6 +5352,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessAndInitializer.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessNoSideEffect.kt")
|
||||
public void testPropertyAccessNoSideEffect() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessNoSideEffect.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessWithSideEffect.kt")
|
||||
public void testPropertyAccessWithSideEffect() throws Exception {
|
||||
|
||||
+18
@@ -756,6 +756,18 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/coercion/unitMaterializationInOverriddenMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unitMaterializationOnAssign.kt")
|
||||
public void testUnitMaterializationOnAssign() throws Exception {
|
||||
runTest("js/js.translator/testData/box/coercion/unitMaterializationOnAssign.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unitMaterializationOnCall.kt")
|
||||
public void testUnitMaterializationOnCall() throws Exception {
|
||||
runTest("js/js.translator/testData/box/coercion/unitMaterializationOnCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unitNullCheck.kt")
|
||||
public void testUnitNullCheck() throws Exception {
|
||||
@@ -5742,6 +5754,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
runTest("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessAndInitializer.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessNoSideEffect.kt")
|
||||
public void testPropertyAccessNoSideEffect() throws Exception {
|
||||
runTest("js/js.translator/testData/box/inlineEvaluationOrder/propertyAccessNoSideEffect.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessWithSideEffect.kt")
|
||||
public void testPropertyAccessWithSideEffect() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user