OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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: --allow-natives-syntax --use-osr --turbo-osr | 5 // Flags: --allow-natives-syntax --use-osr |
6 | 6 |
7 var counter = 188; | 7 var counter = 188; |
8 | 8 |
9 function gen(w) { // defeat compiler cache. | 9 function gen(w) { // defeat compiler cache. |
10 var num = counter++; | 10 var num = counter++; |
11 var Z = [ "", "", "", ]; | 11 var Z = [ "", "", "", ]; |
12 Z[w] = "%OptimizeOsr()"; | 12 Z[w] = "%OptimizeOsr()"; |
13 var src = | 13 var src = |
14 "function f" + num + "(a,b,c) {" + | 14 "function f" + num + "(a,b,c) {" + |
15 " var x = 0;" + | 15 " var x = 0;" + |
(...skipping 10 matching lines...) Expand all Loading... |
26 function check(x,a,b,c) { | 26 function check(x,a,b,c) { |
27 for (var i = 0; i < 3; i++) { | 27 for (var i = 0; i < 3; i++) { |
28 var f = gen(i); | 28 var f = gen(i); |
29 assertEquals(x, f(a, b, c)); | 29 assertEquals(x, f(a, b, c)); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 check(213, 3,3,3); | 33 check(213, 3,3,3); |
34 check(365, 4,5,6); | 34 check(365, 4,5,6); |
35 check(6948, 99,98,97); | 35 check(6948, 99,98,97); |
OLD | NEW |