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