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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 ); | 302 ); |
303 } | 303 } |
304 | 304 |
305 outer(); | 305 outer(); |
306 outer(); | 306 outer(); |
307 %OptimizeFunctionOnNextCall(outer); | 307 %OptimizeFunctionOnNextCall(outer); |
308 outer(); | 308 outer(); |
309 delete forceDeopt.deopt; | 309 delete forceDeopt.deopt; |
310 outer(); | 310 outer(); |
311 })(); | 311 })(); |
| 312 |
| 313 |
| 314 // Test inlining of functions with %_Arguments and %_ArgumentsLength intrinsic. |
| 315 (function () { |
| 316 function inner(len,a,b,c) { |
| 317 assertSame(len, %_ArgumentsLength()); |
| 318 for (var i = 1; i < len; ++i) { |
| 319 var c = String.fromCharCode(96 + i); |
| 320 assertSame(c, %_Arguments(i)); |
| 321 } |
| 322 } |
| 323 |
| 324 function outer() { |
| 325 inner(1); |
| 326 inner(2, 'a'); |
| 327 inner(3, 'a', 'b'); |
| 328 inner(4, 'a', 'b', 'c'); |
| 329 inner(5, 'a', 'b', 'c', 'd'); |
| 330 inner(6, 'a', 'b', 'c', 'd', 'e'); |
| 331 } |
| 332 |
| 333 outer(); |
| 334 outer(); |
| 335 %OptimizeFunctionOnNextCall(outer); |
| 336 outer(); |
| 337 })(); |
OLD | NEW |