Index: test/mjsunit/elements-transition-hoisting.js |
diff --git a/test/mjsunit/elements-transition-hoisting.js b/test/mjsunit/elements-transition-hoisting.js |
index 76f7b82b5ae4d15711364ccbf0e3db1c86ae6e36..5e78f10a0b4a2f58842dfc4b956beb9f7e4feb3d 100644 |
--- a/test/mjsunit/elements-transition-hoisting.js |
+++ b/test/mjsunit/elements-transition-hoisting.js |
@@ -170,4 +170,42 @@ if (support_smi_only_arrays) { |
testHoistingWithSideEffect(new Array(5)); |
testHoistingWithSideEffect(new Array(5)); |
assertTrue(2 != %GetOptimizationStatus(testHoistingWithSideEffect)); |
+ |
+ function testStraightLineDupeElinination(a,b,c,d,e,f) { |
+ var count = 3; |
+ do { |
+ assertTrue(true); |
+ a[0] = b; |
+ a[1] = c; |
+ a[2] = d; |
+ assertTrue(true); |
+ a[3] = e; // TransitionElementsKind should be eliminated despite call. |
+ a[4] = f; |
+ } while (--count > 3); |
+ } |
+ |
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,0,.5); |
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,.5,0); |
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,.5,0,0); |
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,.5,0,0,0); |
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),.5,0,0,0,0); |
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,0,.5); |
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,.5,0); |
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,.5,0,0); |
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,.5,0,0,0); |
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),.5,0,0,0,0); |
+ testStraightLineDupeElinination(new Array(5),.5,0,0,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,.5,0,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,.5,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,0,.5,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,0,0,.5); |
+ testStraightLineDupeElinination(new Array(5),.5,0,0,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,.5,0,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,.5,0,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,0,.5,0); |
+ testStraightLineDupeElinination(new Array(5),0,0,0,0,.5); |
+ %OptimizeFunctionOnNextCall(testStraightLineDupeElinination); |
+ testStraightLineDupeElinination(new Array(5)); |
+ testStraightLineDupeElinination(new Array(5)); |
+ assertTrue(2 != %GetOptimizationStatus(testStraightLineDupeElinination)); |
} |