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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 assertEquals(4, z); | 81 assertEquals(4, z); |
82 assertEquals(5, u); | 82 assertEquals(5, u); |
83 assertEquals(6, v); | 83 assertEquals(6, v); |
84 assertEquals(7, a.foo()); | 84 assertEquals(7, a.foo()); |
85 assertEquals(8, b.foo()); | 85 assertEquals(8, b.foo()); |
86 } | 86 } |
87 } | 87 } |
88 for (var j = 0; j < 5; ++j) f3(1); | 88 for (var j = 0; j < 5; ++j) f3(1); |
89 %OptimizeFunctionOnNextCall(f3); | 89 %OptimizeFunctionOnNextCall(f3); |
90 f3(1); | 90 f3(1); |
| 91 assertTrue(%GetOptimizationStatus(f3) != 2); |
91 | 92 |
92 | 93 |
93 | 94 |
94 // Dynamic lookup from closure. | 95 // Dynamic lookup from closure. |
95 function f4(one) { | 96 function f4(one) { |
96 var x = one + 1; | 97 var x = one + 1; |
97 let y = one + 2; | 98 let y = one + 2; |
98 const u = one + 4; | 99 const u = one + 4; |
99 class a { static foo() { return one + 6; } } | 100 class a { static foo() { return one + 6; } } |
100 { | 101 { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 301 } |
301 for (var j = 0; j < 10; j++) { | 302 for (var j = 0; j < 10; j++) { |
302 y = j + 10; | 303 y = j + 10; |
303 assertEquals(j, let_accessors[j]()); | 304 assertEquals(j, let_accessors[j]()); |
304 assertEquals(y, var_accessors[j]()); | 305 assertEquals(y, var_accessors[j]()); |
305 assertEquals(j, const_accessors[j]()); | 306 assertEquals(j, const_accessors[j]()); |
306 assertEquals(j, class_accessors[j]().foo()); | 307 assertEquals(j, class_accessors[j]().foo()); |
307 } | 308 } |
308 } | 309 } |
309 f8(); | 310 f8(); |
OLD | NEW |