OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --use-osr --turbo-osr | 5 // Flags: --use-osr |
6 | 6 |
7 function foo(a) { | 7 function foo(a) { |
8 var sum = 0; | 8 var sum = 0; |
9 var inc = a ? 100 : 200; | 9 var inc = a ? 100 : 200; |
10 for (var i = 0; i < 100000; i++) { | 10 for (var i = 0; i < 100000; i++) { |
11 sum += inc; | 11 sum += inc; |
12 } | 12 } |
13 return sum + inc; | 13 return sum + inc; |
14 } | 14 } |
15 | 15 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 assertEquals(tv, func(true)); | 52 assertEquals(tv, func(true)); |
53 assertEquals(fv, func(false)); | 53 assertEquals(fv, func(false)); |
54 assertEquals(tv, func(true)); | 54 assertEquals(tv, func(true)); |
55 assertEquals(fv, func(false)); | 55 assertEquals(fv, func(false)); |
56 } | 56 } |
57 | 57 |
58 test(foo, 10000100, 20000200); | 58 test(foo, 10000100, 20000200); |
59 test(bar, 5, 6); | 59 test(bar, 5, 6); |
60 test(baz, true, false); | 60 test(baz, true, false); |
61 test(qux, false, false); | 61 test(qux, false, false); |
OLD | NEW |