| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 } | 259 } |
| 260 | 260 |
| 261 for (var a = 1; a <= 3; a++) { | 261 for (var a = 1; a <= 3; a++) { |
| 262 for (var b = 1; b <= 3; b++) { | 262 for (var b = 1; b <= 3; b++) { |
| 263 for (var c = 1; c <= 3; c++) { | 263 for (var c = 1; c <= 3; c++) { |
| 264 test(a,b,c); | 264 test(a,b,c); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 } | 267 } |
| 268 })(); | 268 })(); |
| 269 | |
| 270 | |
| 271 // Test materialization of arguments object with values in registers. | |
| 272 (function () { | |
| 273 "use strict"; | |
| 274 var forceDeopt = { deopt:false }; | |
| 275 function inner(a,b,c,d,e,f,g,h,i,j) { | |
| 276 var args = arguments; | |
| 277 forceDeopt.deopt; | |
| 278 assertSame(10, args.length); | |
| 279 assertSame(a, args[0]); | |
| 280 assertSame(b, args[1]); | |
| 281 assertSame(c, args[2]); | |
| 282 assertSame(d, args[3]); | |
| 283 assertSame(e, args[4]); | |
| 284 assertSame(f, args[5]); | |
| 285 assertSame(g, args[6]); | |
| 286 assertSame(h, args[7]); | |
| 287 assertSame(i, args[8]); | |
| 288 assertSame(j, args[9]); | |
| 289 } | |
| 290 | |
| 291 var a = 0.5; | |
| 292 var b = 1.7; | |
| 293 var c = 123; | |
| 294 function outer() { | |
| 295 inner( | |
| 296 a - 0.3, // double in double register | |
| 297 b + 2.3, // integer in double register | |
| 298 c + 321, // integer in general register | |
| 299 c - 456, // integer in stack slot | |
| 300 a + 0.1, a + 0.2, a + 0.3, a + 0.4, a + 0.5, | |
| 301 a + 0.6 // double in stack slot | |
| 302 ); | |
| 303 } | |
| 304 | |
| 305 outer(); | |
| 306 outer(); | |
| 307 %OptimizeFunctionOnNextCall(outer); | |
| 308 outer(); | |
| 309 delete forceDeopt.deopt; | |
| 310 outer(); | |
| 311 })(); | |
| OLD | NEW |