OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // Flags: --turbo-deoptimization --allow-natives-syntax | |
6 | |
7 (function() { | |
8 var a = function() { | |
9 return %_GetCallerJSFunction(); | |
10 } | |
11 var b = function() { | |
12 return a(); | |
13 } | |
14 assertEquals(b, b()); | |
15 | |
16 var b2 = function() { | |
17 return a(); | |
18 } | |
19 assertEquals(b2, b2()); | |
20 assertEquals(b2, b2()); | |
21 %SetForceInlineFlag(a); | |
22 %OptimizeFunctionOnNextCall(b2); | |
23 assertEquals(b2, b2()); | |
24 assertEquals(b2, b2()); | |
25 | |
26 var c = function() { | |
27 return b(); | |
28 } | |
29 assertEquals(b, c()); | |
30 assertEquals(b, c()); | |
31 %SetForceInlineFlag(b); | |
32 %OptimizeFunctionOnNextCall(c); | |
33 assertEquals(b, c()); | |
34 assertEquals(b, c()); | |
35 | |
36 %SetForceInlineFlag(c); | |
37 var d = function() { | |
38 return c(); | |
39 } | |
40 assertEquals(b, d()); | |
41 assertEquals(b, d()); | |
42 %OptimizeFunctionOnNextCall(d); | |
43 assertEquals(b, d()); | |
44 assertEquals(b, d()); | |
45 | |
46 var b_mismatch = function() { | |
47 return a(1,2,3) | |
Michael Starzinger
2015/05/22 12:41:12
As discussed offline: Can we have another test cas
| |
48 } | |
49 assertEquals(b_mismatch, b_mismatch()); | |
50 }()); | |
OLD | NEW |