Don't relocate temporary variable which receives property access, unless it's provable that this property don't have side effects

This commit is contained in:
Alexey Andreev
2016-03-29 14:17:26 +03:00
parent cfdce8eaca
commit 4a53f5c0b8
13 changed files with 189 additions and 16 deletions
@@ -32,4 +32,6 @@ class TemporaryVariableEliminationTest : BasicOptimizerTest("temporary-variable"
@Test fun tryCatch() = box()
@Test fun nonSideEffect() = box()
@Test fun propertyAccess() = box()
}
@@ -245,6 +245,12 @@ public class InlineEvaluationOrderTestGenerated extends AbstractInlineEvaluation
doTest(fileName);
}
@TestMetadata("propertyAccessWithSideEffect.kt")
public void testPropertyAccessWithSideEffect() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/propertyAccessWithSideEffect.kt");
doTest(fileName);
}
@TestMetadata("ternaryConditional.kt")
public void testTernaryConditional() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/inlineEvaluationOrder/cases/ternaryConditional.kt");