OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 assertTrue(true); | 163 assertTrue(true); |
164 a[0] = object; | 164 a[0] = object; |
165 } while (--count > 3); | 165 } while (--count > 3); |
166 } | 166 } |
167 | 167 |
168 testHoistingWithSideEffect(new Array(5)); | 168 testHoistingWithSideEffect(new Array(5)); |
169 %OptimizeFunctionOnNextCall(testHoistingWithSideEffect); | 169 %OptimizeFunctionOnNextCall(testHoistingWithSideEffect); |
170 testHoistingWithSideEffect(new Array(5)); | 170 testHoistingWithSideEffect(new Array(5)); |
171 testHoistingWithSideEffect(new Array(5)); | 171 testHoistingWithSideEffect(new Array(5)); |
172 assertTrue(2 != %GetOptimizationStatus(testHoistingWithSideEffect)); | 172 assertTrue(2 != %GetOptimizationStatus(testHoistingWithSideEffect)); |
| 173 |
| 174 function testStraightLineDupeElinination(a,b,c,d,e,f) { |
| 175 var count = 3; |
| 176 do { |
| 177 assertTrue(true); |
| 178 a[0] = b; |
| 179 a[1] = c; |
| 180 a[2] = d; |
| 181 assertTrue(true); |
| 182 a[3] = e; // TransitionElementsKind should be eliminated despite call. |
| 183 a[4] = f; |
| 184 } while (--count > 3); |
| 185 } |
| 186 |
| 187 testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,0,.5); |
| 188 testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,.5,0); |
| 189 testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,.5,0,0); |
| 190 testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,.5,0,0,0); |
| 191 testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),.5,0,0,0,0); |
| 192 testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,0,.5); |
| 193 testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,.5,0); |
| 194 testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,.5,0,0); |
| 195 testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,.5,0,0,0); |
| 196 testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),.5,0,0,0,0); |
| 197 testStraightLineDupeElinination(new Array(5),.5,0,0,0,0); |
| 198 testStraightLineDupeElinination(new Array(5),0,.5,0,0,0); |
| 199 testStraightLineDupeElinination(new Array(5),0,0,.5,0,0); |
| 200 testStraightLineDupeElinination(new Array(5),0,0,0,.5,0); |
| 201 testStraightLineDupeElinination(new Array(5),0,0,0,0,.5); |
| 202 testStraightLineDupeElinination(new Array(5),.5,0,0,0,0); |
| 203 testStraightLineDupeElinination(new Array(5),0,.5,0,0,0); |
| 204 testStraightLineDupeElinination(new Array(5),0,0,.5,0,0); |
| 205 testStraightLineDupeElinination(new Array(5),0,0,0,.5,0); |
| 206 testStraightLineDupeElinination(new Array(5),0,0,0,0,.5); |
| 207 %OptimizeFunctionOnNextCall(testStraightLineDupeElinination); |
| 208 testStraightLineDupeElinination(new Array(5)); |
| 209 testStraightLineDupeElinination(new Array(5)); |
| 210 assertTrue(2 != %GetOptimizationStatus(testStraightLineDupeElinination)); |
173 } | 211 } |
OLD | NEW |