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); | |
92 | 91 |
93 | 92 |
94 | 93 |
95 // Dynamic lookup from closure. | 94 // Dynamic lookup from closure. |
96 function f4(one) { | 95 function f4(one) { |
97 var x = one + 1; | 96 var x = one + 1; |
98 let y = one + 2; | 97 let y = one + 2; |
99 const u = one + 4; | 98 const u = one + 4; |
100 class a { static foo() { return one + 6; } } | 99 class a { static foo() { return one + 6; } } |
101 { | 100 { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 300 } |
302 for (var j = 0; j < 10; j++) { | 301 for (var j = 0; j < 10; j++) { |
303 y = j + 10; | 302 y = j + 10; |
304 assertEquals(j, let_accessors[j]()); | 303 assertEquals(j, let_accessors[j]()); |
305 assertEquals(y, var_accessors[j]()); | 304 assertEquals(y, var_accessors[j]()); |
306 assertEquals(j, const_accessors[j]()); | 305 assertEquals(j, const_accessors[j]()); |
307 assertEquals(j, class_accessors[j]().foo()); | 306 assertEquals(j, class_accessors[j]().foo()); |
308 } | 307 } |
309 } | 308 } |
310 f8(); | 309 f8(); |
OLD | NEW |