OLD | NEW |
(Empty) | |
| 1 // Shard 2. |
| 2 |
| 3 // Copyright 2016 the V8 project authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. |
| 6 |
| 7 // Flags: --allow-natives-syntax --turbo --no-always-opt |
| 8 |
| 9 // This test file was generated by tools/gen-inlining-tests.py . |
| 10 |
| 11 // Global variables |
| 12 var deopt = undefined; // either true or false |
| 13 var counter = 0; |
| 14 |
| 15 function resetState() { |
| 16 counter = 0; |
| 17 } |
| 18 |
| 19 function warmUp(f) { |
| 20 try { |
| 21 f(); |
| 22 } catch (ex) { |
| 23 // ok |
| 24 } |
| 25 try { |
| 26 f(); |
| 27 } catch (ex) { |
| 28 // ok |
| 29 } |
| 30 } |
| 31 |
| 32 function resetOptAndAssertResultEquals(expected, f) { |
| 33 warmUp(f); |
| 34 resetState(); |
| 35 // %DebugPrint(f); |
| 36 eval("'dont optimize this function itself please, but do optimize f'"); |
| 37 %OptimizeFunctionOnNextCall(f); |
| 38 assertEquals(expected, f()); |
| 39 } |
| 40 |
| 41 function resetOptAndAssertThrowsWith(expected, f) { |
| 42 warmUp(f); |
| 43 resetState(); |
| 44 // %DebugPrint(f); |
| 45 eval("'dont optimize this function itself please, but do optimize f'"); |
| 46 %OptimizeFunctionOnNextCall(f); |
| 47 try { |
| 48 var result = f(); |
| 49 fail("resetOptAndAssertThrowsWith", |
| 50 "exception: " + expected, |
| 51 "result: " + result); |
| 52 } catch (ex) { |
| 53 assertEquals(expected, ex); |
| 54 } |
| 55 } |
| 56 |
| 57 function increaseAndReturn15() { |
| 58 if (deopt) %DeoptimizeFunction(f); |
| 59 counter++; |
| 60 return 15; |
| 61 } |
| 62 |
| 63 function increaseAndThrow42() { |
| 64 if (deopt) %DeoptimizeFunction(f); |
| 65 counter++; |
| 66 throw 42; |
| 67 } |
| 68 |
| 69 function returnOrThrow(doReturn) { |
| 70 if (doReturn) { |
| 71 return increaseAndReturn15(); |
| 72 } else { |
| 73 return increaseAndThrow42(); |
| 74 } |
| 75 } |
| 76 |
| 77 // When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts |
| 78 // as the other one. |
| 79 function invertFunctionCall(f) { |
| 80 var result; |
| 81 try { |
| 82 result = f(); |
| 83 } catch (ex) { |
| 84 return ex - 27; |
| 85 } |
| 86 throw result + 27; |
| 87 } |
| 88 |
| 89 function increaseAndStore15Constructor() { |
| 90 if (deopt) %DeoptimizeFunction(f); |
| 91 ++counter; |
| 92 this.x = 15; |
| 93 } |
| 94 |
| 95 function increaseAndThrow42Constructor() { |
| 96 if (deopt) %DeoptimizeFunction(f); |
| 97 ++counter; |
| 98 this.x = 42; |
| 99 throw this.x; |
| 100 } |
| 101 |
| 102 var magic = {}; |
| 103 Object.defineProperty(magic, 'prop', { |
| 104 get: function () { |
| 105 if (deopt) %DeoptimizeFunction(f); |
| 106 return 15 + 0 * ++counter; |
| 107 }, |
| 108 |
| 109 set: function(x) { |
| 110 // argument should be 37 |
| 111 if (deopt) %DeoptimizeFunction(f); |
| 112 counter -= 36 - x; // increments counter |
| 113 throw 42; |
| 114 } |
| 115 }) |
| 116 |
| 117 // Generate type feedback. |
| 118 |
| 119 assertEquals(15, (new increaseAndStore15Constructor()).x); |
| 120 assertThrowsEquals(function() { |
| 121 return (new increaseAndThrow42Constructor()).x; |
| 122 }, |
| 123 42); |
| 124 |
| 125 function runThisShard() { |
| 126 |
| 127 // Variant flags: [alternativeFn2, tryReturns, doCatch, |
| 128 // catchReturns, catchWithLocal, endReturnLocal] |
| 129 |
| 130 f = function f___2__r__crl____l_ () { |
| 131 var local = 3; |
| 132 deopt = false; |
| 133 try { |
| 134 counter++; |
| 135 return invertFunctionCall(increaseAndThrow42); |
| 136 counter++; |
| 137 } catch (ex) { |
| 138 counter++; |
| 139 return 2 + local; |
| 140 counter++; |
| 141 } |
| 142 counter++; |
| 143 return 5 + local; |
| 144 } |
| 145 resetOptAndAssertResultEquals(15, f); |
| 146 assertEquals(2, counter); |
| 147 |
| 148 // Variant flags: [alternativeFn2, tryReturns, doCatch, |
| 149 // catchReturns, catchWithLocal, endReturnLocal, deopt] |
| 150 |
| 151 f = function f___2__r__crl____ld () { |
| 152 var local = 3; |
| 153 deopt = true; |
| 154 try { |
| 155 counter++; |
| 156 return invertFunctionCall(increaseAndThrow42); |
| 157 counter++; |
| 158 } catch (ex) { |
| 159 counter++; |
| 160 return 2 + local; |
| 161 counter++; |
| 162 } |
| 163 counter++; |
| 164 return 5 + local; |
| 165 } |
| 166 resetOptAndAssertResultEquals(15, f); |
| 167 assertEquals(2, counter); |
| 168 |
| 169 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 170 // doCatch] |
| 171 |
| 172 f = function f___2__r_lc________ () { |
| 173 var local = 3; |
| 174 deopt = false; |
| 175 try { |
| 176 counter++; |
| 177 local += invertFunctionCall(increaseAndThrow42); |
| 178 counter++; |
| 179 } catch (ex) { |
| 180 counter++; |
| 181 counter++; |
| 182 } |
| 183 counter++; |
| 184 } |
| 185 resetOptAndAssertResultEquals(undefined, f); |
| 186 assertEquals(4, counter); |
| 187 |
| 188 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 189 // doCatch, deopt] |
| 190 |
| 191 f = function f___2__r_lc_______d () { |
| 192 var local = 3; |
| 193 deopt = true; |
| 194 try { |
| 195 counter++; |
| 196 local += invertFunctionCall(increaseAndThrow42); |
| 197 counter++; |
| 198 } catch (ex) { |
| 199 counter++; |
| 200 counter++; |
| 201 } |
| 202 counter++; |
| 203 } |
| 204 resetOptAndAssertResultEquals(undefined, f); |
| 205 assertEquals(4, counter); |
| 206 |
| 207 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 208 // doCatch, endReturnLocal] |
| 209 |
| 210 f = function f___2__r_lc______l_ () { |
| 211 var local = 3; |
| 212 deopt = false; |
| 213 try { |
| 214 counter++; |
| 215 local += invertFunctionCall(increaseAndThrow42); |
| 216 counter++; |
| 217 } catch (ex) { |
| 218 counter++; |
| 219 counter++; |
| 220 } |
| 221 counter++; |
| 222 return 5 + local; |
| 223 } |
| 224 resetOptAndAssertResultEquals(23, f); |
| 225 assertEquals(4, counter); |
| 226 |
| 227 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 228 // doCatch, endReturnLocal, deopt] |
| 229 |
| 230 f = function f___2__r_lc______ld () { |
| 231 var local = 3; |
| 232 deopt = true; |
| 233 try { |
| 234 counter++; |
| 235 local += invertFunctionCall(increaseAndThrow42); |
| 236 counter++; |
| 237 } catch (ex) { |
| 238 counter++; |
| 239 counter++; |
| 240 } |
| 241 counter++; |
| 242 return 5 + local; |
| 243 } |
| 244 resetOptAndAssertResultEquals(23, f); |
| 245 assertEquals(4, counter); |
| 246 |
| 247 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 248 // doCatch, catchThrows] |
| 249 |
| 250 f = function f___2__r_lc__t_____ () { |
| 251 var local = 3; |
| 252 deopt = false; |
| 253 try { |
| 254 counter++; |
| 255 local += invertFunctionCall(increaseAndThrow42); |
| 256 counter++; |
| 257 } catch (ex) { |
| 258 counter++; |
| 259 throw 2 + ex; |
| 260 counter++; |
| 261 } |
| 262 counter++; |
| 263 } |
| 264 resetOptAndAssertResultEquals(undefined, f); |
| 265 assertEquals(4, counter); |
| 266 |
| 267 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 268 // doCatch, catchThrows, deopt] |
| 269 |
| 270 f = function f___2__r_lc__t____d () { |
| 271 var local = 3; |
| 272 deopt = true; |
| 273 try { |
| 274 counter++; |
| 275 local += invertFunctionCall(increaseAndThrow42); |
| 276 counter++; |
| 277 } catch (ex) { |
| 278 counter++; |
| 279 throw 2 + ex; |
| 280 counter++; |
| 281 } |
| 282 counter++; |
| 283 } |
| 284 resetOptAndAssertResultEquals(undefined, f); |
| 285 assertEquals(4, counter); |
| 286 |
| 287 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 288 // doCatch, catchThrows, endReturnLocal] |
| 289 |
| 290 f = function f___2__r_lc__t___l_ () { |
| 291 var local = 3; |
| 292 deopt = false; |
| 293 try { |
| 294 counter++; |
| 295 local += invertFunctionCall(increaseAndThrow42); |
| 296 counter++; |
| 297 } catch (ex) { |
| 298 counter++; |
| 299 throw 2 + ex; |
| 300 counter++; |
| 301 } |
| 302 counter++; |
| 303 return 5 + local; |
| 304 } |
| 305 resetOptAndAssertResultEquals(23, f); |
| 306 assertEquals(4, counter); |
| 307 |
| 308 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 309 // doCatch, catchThrows, endReturnLocal, deopt] |
| 310 |
| 311 f = function f___2__r_lc__t___ld () { |
| 312 var local = 3; |
| 313 deopt = true; |
| 314 try { |
| 315 counter++; |
| 316 local += invertFunctionCall(increaseAndThrow42); |
| 317 counter++; |
| 318 } catch (ex) { |
| 319 counter++; |
| 320 throw 2 + ex; |
| 321 counter++; |
| 322 } |
| 323 counter++; |
| 324 return 5 + local; |
| 325 } |
| 326 resetOptAndAssertResultEquals(23, f); |
| 327 assertEquals(4, counter); |
| 328 |
| 329 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 330 // doCatch, catchWithLocal] |
| 331 |
| 332 f = function f___2__r_lc_l______ () { |
| 333 var local = 3; |
| 334 deopt = false; |
| 335 try { |
| 336 counter++; |
| 337 local += invertFunctionCall(increaseAndThrow42); |
| 338 counter++; |
| 339 } catch (ex) { |
| 340 counter++; |
| 341 local += ex; |
| 342 counter++; |
| 343 } |
| 344 counter++; |
| 345 } |
| 346 resetOptAndAssertResultEquals(undefined, f); |
| 347 assertEquals(4, counter); |
| 348 |
| 349 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 350 // doCatch, catchWithLocal, deopt] |
| 351 |
| 352 f = function f___2__r_lc_l_____d () { |
| 353 var local = 3; |
| 354 deopt = true; |
| 355 try { |
| 356 counter++; |
| 357 local += invertFunctionCall(increaseAndThrow42); |
| 358 counter++; |
| 359 } catch (ex) { |
| 360 counter++; |
| 361 local += ex; |
| 362 counter++; |
| 363 } |
| 364 counter++; |
| 365 } |
| 366 resetOptAndAssertResultEquals(undefined, f); |
| 367 assertEquals(4, counter); |
| 368 |
| 369 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 370 // doCatch, catchWithLocal, endReturnLocal] |
| 371 |
| 372 f = function f___2__r_lc_l____l_ () { |
| 373 var local = 3; |
| 374 deopt = false; |
| 375 try { |
| 376 counter++; |
| 377 local += invertFunctionCall(increaseAndThrow42); |
| 378 counter++; |
| 379 } catch (ex) { |
| 380 counter++; |
| 381 local += ex; |
| 382 counter++; |
| 383 } |
| 384 counter++; |
| 385 return 5 + local; |
| 386 } |
| 387 resetOptAndAssertResultEquals(23, f); |
| 388 assertEquals(4, counter); |
| 389 |
| 390 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 391 // doCatch, catchWithLocal, endReturnLocal, deopt] |
| 392 |
| 393 f = function f___2__r_lc_l____ld () { |
| 394 var local = 3; |
| 395 deopt = true; |
| 396 try { |
| 397 counter++; |
| 398 local += invertFunctionCall(increaseAndThrow42); |
| 399 counter++; |
| 400 } catch (ex) { |
| 401 counter++; |
| 402 local += ex; |
| 403 counter++; |
| 404 } |
| 405 counter++; |
| 406 return 5 + local; |
| 407 } |
| 408 resetOptAndAssertResultEquals(23, f); |
| 409 assertEquals(4, counter); |
| 410 |
| 411 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 412 // doCatch, catchWithLocal, catchThrows] |
| 413 |
| 414 f = function f___2__r_lc_lt_____ () { |
| 415 var local = 3; |
| 416 deopt = false; |
| 417 try { |
| 418 counter++; |
| 419 local += invertFunctionCall(increaseAndThrow42); |
| 420 counter++; |
| 421 } catch (ex) { |
| 422 counter++; |
| 423 throw 2 + ex; |
| 424 counter++; |
| 425 } |
| 426 counter++; |
| 427 } |
| 428 resetOptAndAssertResultEquals(undefined, f); |
| 429 assertEquals(4, counter); |
| 430 |
| 431 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 432 // doCatch, catchWithLocal, catchThrows, deopt] |
| 433 |
| 434 f = function f___2__r_lc_lt____d () { |
| 435 var local = 3; |
| 436 deopt = true; |
| 437 try { |
| 438 counter++; |
| 439 local += invertFunctionCall(increaseAndThrow42); |
| 440 counter++; |
| 441 } catch (ex) { |
| 442 counter++; |
| 443 throw 2 + ex; |
| 444 counter++; |
| 445 } |
| 446 counter++; |
| 447 } |
| 448 resetOptAndAssertResultEquals(undefined, f); |
| 449 assertEquals(4, counter); |
| 450 |
| 451 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 452 // doCatch, catchWithLocal, catchThrows, endReturnLocal] |
| 453 |
| 454 f = function f___2__r_lc_lt___l_ () { |
| 455 var local = 3; |
| 456 deopt = false; |
| 457 try { |
| 458 counter++; |
| 459 local += invertFunctionCall(increaseAndThrow42); |
| 460 counter++; |
| 461 } catch (ex) { |
| 462 counter++; |
| 463 throw 2 + ex; |
| 464 counter++; |
| 465 } |
| 466 counter++; |
| 467 return 5 + local; |
| 468 } |
| 469 resetOptAndAssertResultEquals(23, f); |
| 470 assertEquals(4, counter); |
| 471 |
| 472 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 473 // doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt] |
| 474 |
| 475 f = function f___2__r_lc_lt___ld () { |
| 476 var local = 3; |
| 477 deopt = true; |
| 478 try { |
| 479 counter++; |
| 480 local += invertFunctionCall(increaseAndThrow42); |
| 481 counter++; |
| 482 } catch (ex) { |
| 483 counter++; |
| 484 throw 2 + ex; |
| 485 counter++; |
| 486 } |
| 487 counter++; |
| 488 return 5 + local; |
| 489 } |
| 490 resetOptAndAssertResultEquals(23, f); |
| 491 assertEquals(4, counter); |
| 492 |
| 493 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 494 // doCatch, catchReturns] |
| 495 |
| 496 f = function f___2__r_lcr_______ () { |
| 497 var local = 3; |
| 498 deopt = false; |
| 499 try { |
| 500 counter++; |
| 501 local += invertFunctionCall(increaseAndThrow42); |
| 502 counter++; |
| 503 } catch (ex) { |
| 504 counter++; |
| 505 return 2 + ex; |
| 506 counter++; |
| 507 } |
| 508 counter++; |
| 509 } |
| 510 resetOptAndAssertResultEquals(undefined, f); |
| 511 assertEquals(4, counter); |
| 512 |
| 513 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 514 // doCatch, catchReturns, deopt] |
| 515 |
| 516 f = function f___2__r_lcr______d () { |
| 517 var local = 3; |
| 518 deopt = true; |
| 519 try { |
| 520 counter++; |
| 521 local += invertFunctionCall(increaseAndThrow42); |
| 522 counter++; |
| 523 } catch (ex) { |
| 524 counter++; |
| 525 return 2 + ex; |
| 526 counter++; |
| 527 } |
| 528 counter++; |
| 529 } |
| 530 resetOptAndAssertResultEquals(undefined, f); |
| 531 assertEquals(4, counter); |
| 532 |
| 533 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 534 // doCatch, catchReturns, endReturnLocal] |
| 535 |
| 536 f = function f___2__r_lcr_____l_ () { |
| 537 var local = 3; |
| 538 deopt = false; |
| 539 try { |
| 540 counter++; |
| 541 local += invertFunctionCall(increaseAndThrow42); |
| 542 counter++; |
| 543 } catch (ex) { |
| 544 counter++; |
| 545 return 2 + ex; |
| 546 counter++; |
| 547 } |
| 548 counter++; |
| 549 return 5 + local; |
| 550 } |
| 551 resetOptAndAssertResultEquals(23, f); |
| 552 assertEquals(4, counter); |
| 553 |
| 554 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 555 // doCatch, catchReturns, endReturnLocal, deopt] |
| 556 |
| 557 f = function f___2__r_lcr_____ld () { |
| 558 var local = 3; |
| 559 deopt = true; |
| 560 try { |
| 561 counter++; |
| 562 local += invertFunctionCall(increaseAndThrow42); |
| 563 counter++; |
| 564 } catch (ex) { |
| 565 counter++; |
| 566 return 2 + ex; |
| 567 counter++; |
| 568 } |
| 569 counter++; |
| 570 return 5 + local; |
| 571 } |
| 572 resetOptAndAssertResultEquals(23, f); |
| 573 assertEquals(4, counter); |
| 574 |
| 575 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 576 // doCatch, catchReturns, catchWithLocal] |
| 577 |
| 578 f = function f___2__r_lcrl______ () { |
| 579 var local = 3; |
| 580 deopt = false; |
| 581 try { |
| 582 counter++; |
| 583 local += invertFunctionCall(increaseAndThrow42); |
| 584 counter++; |
| 585 } catch (ex) { |
| 586 counter++; |
| 587 return 2 + local; |
| 588 counter++; |
| 589 } |
| 590 counter++; |
| 591 } |
| 592 resetOptAndAssertResultEquals(undefined, f); |
| 593 assertEquals(4, counter); |
| 594 |
| 595 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 596 // doCatch, catchReturns, catchWithLocal, deopt] |
| 597 |
| 598 f = function f___2__r_lcrl_____d () { |
| 599 var local = 3; |
| 600 deopt = true; |
| 601 try { |
| 602 counter++; |
| 603 local += invertFunctionCall(increaseAndThrow42); |
| 604 counter++; |
| 605 } catch (ex) { |
| 606 counter++; |
| 607 return 2 + local; |
| 608 counter++; |
| 609 } |
| 610 counter++; |
| 611 } |
| 612 resetOptAndAssertResultEquals(undefined, f); |
| 613 assertEquals(4, counter); |
| 614 |
| 615 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 616 // doCatch, catchReturns, catchWithLocal, endReturnLocal] |
| 617 |
| 618 f = function f___2__r_lcrl____l_ () { |
| 619 var local = 3; |
| 620 deopt = false; |
| 621 try { |
| 622 counter++; |
| 623 local += invertFunctionCall(increaseAndThrow42); |
| 624 counter++; |
| 625 } catch (ex) { |
| 626 counter++; |
| 627 return 2 + local; |
| 628 counter++; |
| 629 } |
| 630 counter++; |
| 631 return 5 + local; |
| 632 } |
| 633 resetOptAndAssertResultEquals(23, f); |
| 634 assertEquals(4, counter); |
| 635 |
| 636 // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, |
| 637 // doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt] |
| 638 |
| 639 f = function f___2__r_lcrl____ld () { |
| 640 var local = 3; |
| 641 deopt = true; |
| 642 try { |
| 643 counter++; |
| 644 local += invertFunctionCall(increaseAndThrow42); |
| 645 counter++; |
| 646 } catch (ex) { |
| 647 counter++; |
| 648 return 2 + local; |
| 649 counter++; |
| 650 } |
| 651 counter++; |
| 652 return 5 + local; |
| 653 } |
| 654 resetOptAndAssertResultEquals(23, f); |
| 655 assertEquals(4, counter); |
| 656 |
| 657 // Variant flags: [alternativeFn2, tryThrows, doCatch] |
| 658 |
| 659 f = function f___2_t___c________ () { |
| 660 var local = 3; |
| 661 deopt = false; |
| 662 try { |
| 663 counter++; |
| 664 return invertFunctionCall(increaseAndReturn15); |
| 665 counter++; |
| 666 } catch (ex) { |
| 667 counter++; |
| 668 counter++; |
| 669 } |
| 670 counter++; |
| 671 } |
| 672 resetOptAndAssertResultEquals(undefined, f); |
| 673 assertEquals(5, counter); |
| 674 |
| 675 // Variant flags: [alternativeFn2, tryThrows, doCatch, deopt] |
| 676 |
| 677 f = function f___2_t___c_______d () { |
| 678 var local = 3; |
| 679 deopt = true; |
| 680 try { |
| 681 counter++; |
| 682 return invertFunctionCall(increaseAndReturn15); |
| 683 counter++; |
| 684 } catch (ex) { |
| 685 counter++; |
| 686 counter++; |
| 687 } |
| 688 counter++; |
| 689 } |
| 690 resetOptAndAssertResultEquals(undefined, f); |
| 691 assertEquals(5, counter); |
| 692 |
| 693 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchThrows] |
| 694 |
| 695 f = function f___2_t___c__t_____ () { |
| 696 var local = 3; |
| 697 deopt = false; |
| 698 try { |
| 699 counter++; |
| 700 return invertFunctionCall(increaseAndReturn15); |
| 701 counter++; |
| 702 } catch (ex) { |
| 703 counter++; |
| 704 throw 2 + ex; |
| 705 counter++; |
| 706 } |
| 707 counter++; |
| 708 } |
| 709 resetOptAndAssertThrowsWith(44, f); |
| 710 assertEquals(3, counter); |
| 711 |
| 712 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchThrows, |
| 713 // deopt] |
| 714 |
| 715 f = function f___2_t___c__t____d () { |
| 716 var local = 3; |
| 717 deopt = true; |
| 718 try { |
| 719 counter++; |
| 720 return invertFunctionCall(increaseAndReturn15); |
| 721 counter++; |
| 722 } catch (ex) { |
| 723 counter++; |
| 724 throw 2 + ex; |
| 725 counter++; |
| 726 } |
| 727 counter++; |
| 728 } |
| 729 resetOptAndAssertThrowsWith(44, f); |
| 730 assertEquals(3, counter); |
| 731 |
| 732 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 733 // catchWithLocal] |
| 734 |
| 735 f = function f___2_t___c_l______ () { |
| 736 var local = 3; |
| 737 deopt = false; |
| 738 try { |
| 739 counter++; |
| 740 return invertFunctionCall(increaseAndReturn15); |
| 741 counter++; |
| 742 } catch (ex) { |
| 743 counter++; |
| 744 local += ex; |
| 745 counter++; |
| 746 } |
| 747 counter++; |
| 748 } |
| 749 resetOptAndAssertResultEquals(undefined, f); |
| 750 assertEquals(5, counter); |
| 751 |
| 752 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 753 // catchWithLocal, deopt] |
| 754 |
| 755 f = function f___2_t___c_l_____d () { |
| 756 var local = 3; |
| 757 deopt = true; |
| 758 try { |
| 759 counter++; |
| 760 return invertFunctionCall(increaseAndReturn15); |
| 761 counter++; |
| 762 } catch (ex) { |
| 763 counter++; |
| 764 local += ex; |
| 765 counter++; |
| 766 } |
| 767 counter++; |
| 768 } |
| 769 resetOptAndAssertResultEquals(undefined, f); |
| 770 assertEquals(5, counter); |
| 771 |
| 772 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 773 // catchWithLocal, endReturnLocal] |
| 774 |
| 775 f = function f___2_t___c_l____l_ () { |
| 776 var local = 3; |
| 777 deopt = false; |
| 778 try { |
| 779 counter++; |
| 780 return invertFunctionCall(increaseAndReturn15); |
| 781 counter++; |
| 782 } catch (ex) { |
| 783 counter++; |
| 784 local += ex; |
| 785 counter++; |
| 786 } |
| 787 counter++; |
| 788 return 5 + local; |
| 789 } |
| 790 resetOptAndAssertResultEquals(50, f); |
| 791 assertEquals(5, counter); |
| 792 |
| 793 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 794 // catchWithLocal, endReturnLocal, deopt] |
| 795 |
| 796 f = function f___2_t___c_l____ld () { |
| 797 var local = 3; |
| 798 deopt = true; |
| 799 try { |
| 800 counter++; |
| 801 return invertFunctionCall(increaseAndReturn15); |
| 802 counter++; |
| 803 } catch (ex) { |
| 804 counter++; |
| 805 local += ex; |
| 806 counter++; |
| 807 } |
| 808 counter++; |
| 809 return 5 + local; |
| 810 } |
| 811 resetOptAndAssertResultEquals(50, f); |
| 812 assertEquals(5, counter); |
| 813 |
| 814 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 815 // catchWithLocal, catchThrows] |
| 816 |
| 817 f = function f___2_t___c_lt_____ () { |
| 818 var local = 3; |
| 819 deopt = false; |
| 820 try { |
| 821 counter++; |
| 822 return invertFunctionCall(increaseAndReturn15); |
| 823 counter++; |
| 824 } catch (ex) { |
| 825 counter++; |
| 826 throw 2 + ex; |
| 827 counter++; |
| 828 } |
| 829 counter++; |
| 830 } |
| 831 resetOptAndAssertThrowsWith(44, f); |
| 832 assertEquals(3, counter); |
| 833 |
| 834 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 835 // catchWithLocal, catchThrows, deopt] |
| 836 |
| 837 f = function f___2_t___c_lt____d () { |
| 838 var local = 3; |
| 839 deopt = true; |
| 840 try { |
| 841 counter++; |
| 842 return invertFunctionCall(increaseAndReturn15); |
| 843 counter++; |
| 844 } catch (ex) { |
| 845 counter++; |
| 846 throw 2 + ex; |
| 847 counter++; |
| 848 } |
| 849 counter++; |
| 850 } |
| 851 resetOptAndAssertThrowsWith(44, f); |
| 852 assertEquals(3, counter); |
| 853 |
| 854 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 855 // catchWithLocal, catchThrows, endReturnLocal] |
| 856 |
| 857 f = function f___2_t___c_lt___l_ () { |
| 858 var local = 3; |
| 859 deopt = false; |
| 860 try { |
| 861 counter++; |
| 862 return invertFunctionCall(increaseAndReturn15); |
| 863 counter++; |
| 864 } catch (ex) { |
| 865 counter++; |
| 866 throw 2 + ex; |
| 867 counter++; |
| 868 } |
| 869 counter++; |
| 870 return 5 + local; |
| 871 } |
| 872 resetOptAndAssertThrowsWith(44, f); |
| 873 assertEquals(3, counter); |
| 874 |
| 875 // Variant flags: [alternativeFn2, tryThrows, doCatch, |
| 876 // catchWithLocal, catchThrows, endReturnLocal, deopt] |
| 877 |
| 878 f = function f___2_t___c_lt___ld () { |
| 879 var local = 3; |
| 880 deopt = true; |
| 881 try { |
| 882 counter++; |
| 883 return invertFunctionCall(increaseAndReturn15); |
| 884 counter++; |
| 885 } catch (ex) { |
| 886 counter++; |
| 887 throw 2 + ex; |
| 888 counter++; |
| 889 } |
| 890 counter++; |
| 891 return 5 + local; |
| 892 } |
| 893 resetOptAndAssertThrowsWith(44, f); |
| 894 assertEquals(3, counter); |
| 895 |
| 896 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns] |
| 897 |
| 898 f = function f___2_t___cr_______ () { |
| 899 var local = 3; |
| 900 deopt = false; |
| 901 try { |
| 902 counter++; |
| 903 return invertFunctionCall(increaseAndReturn15); |
| 904 counter++; |
| 905 } catch (ex) { |
| 906 counter++; |
| 907 return 2 + ex; |
| 908 counter++; |
| 909 } |
| 910 counter++; |
| 911 } |
| 912 resetOptAndAssertResultEquals(44, f); |
| 913 assertEquals(3, counter); |
| 914 |
| 915 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, |
| 916 // deopt] |
| 917 |
| 918 f = function f___2_t___cr______d () { |
| 919 var local = 3; |
| 920 deopt = true; |
| 921 try { |
| 922 counter++; |
| 923 return invertFunctionCall(increaseAndReturn15); |
| 924 counter++; |
| 925 } catch (ex) { |
| 926 counter++; |
| 927 return 2 + ex; |
| 928 counter++; |
| 929 } |
| 930 counter++; |
| 931 } |
| 932 resetOptAndAssertResultEquals(44, f); |
| 933 assertEquals(3, counter); |
| 934 |
| 935 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, |
| 936 // catchWithLocal] |
| 937 |
| 938 f = function f___2_t___crl______ () { |
| 939 var local = 3; |
| 940 deopt = false; |
| 941 try { |
| 942 counter++; |
| 943 return invertFunctionCall(increaseAndReturn15); |
| 944 counter++; |
| 945 } catch (ex) { |
| 946 counter++; |
| 947 return 2 + local; |
| 948 counter++; |
| 949 } |
| 950 counter++; |
| 951 } |
| 952 resetOptAndAssertResultEquals(5, f); |
| 953 assertEquals(3, counter); |
| 954 |
| 955 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, |
| 956 // catchWithLocal, deopt] |
| 957 |
| 958 f = function f___2_t___crl_____d () { |
| 959 var local = 3; |
| 960 deopt = true; |
| 961 try { |
| 962 counter++; |
| 963 return invertFunctionCall(increaseAndReturn15); |
| 964 counter++; |
| 965 } catch (ex) { |
| 966 counter++; |
| 967 return 2 + local; |
| 968 counter++; |
| 969 } |
| 970 counter++; |
| 971 } |
| 972 resetOptAndAssertResultEquals(5, f); |
| 973 assertEquals(3, counter); |
| 974 |
| 975 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, |
| 976 // catchWithLocal, endReturnLocal] |
| 977 |
| 978 f = function f___2_t___crl____l_ () { |
| 979 var local = 3; |
| 980 deopt = false; |
| 981 try { |
| 982 counter++; |
| 983 return invertFunctionCall(increaseAndReturn15); |
| 984 counter++; |
| 985 } catch (ex) { |
| 986 counter++; |
| 987 return 2 + local; |
| 988 counter++; |
| 989 } |
| 990 counter++; |
| 991 return 5 + local; |
| 992 } |
| 993 resetOptAndAssertResultEquals(5, f); |
| 994 assertEquals(3, counter); |
| 995 |
| 996 // Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, |
| 997 // catchWithLocal, endReturnLocal, deopt] |
| 998 |
| 999 f = function f___2_t___crl____ld () { |
| 1000 var local = 3; |
| 1001 deopt = true; |
| 1002 try { |
| 1003 counter++; |
| 1004 return invertFunctionCall(increaseAndReturn15); |
| 1005 counter++; |
| 1006 } catch (ex) { |
| 1007 counter++; |
| 1008 return 2 + local; |
| 1009 counter++; |
| 1010 } |
| 1011 counter++; |
| 1012 return 5 + local; |
| 1013 } |
| 1014 resetOptAndAssertResultEquals(5, f); |
| 1015 assertEquals(3, counter); |
| 1016 |
| 1017 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1018 // doCatch] |
| 1019 |
| 1020 f = function f___2_t__lc________ () { |
| 1021 var local = 3; |
| 1022 deopt = false; |
| 1023 try { |
| 1024 counter++; |
| 1025 local += invertFunctionCall(increaseAndReturn15); |
| 1026 counter++; |
| 1027 } catch (ex) { |
| 1028 counter++; |
| 1029 counter++; |
| 1030 } |
| 1031 counter++; |
| 1032 } |
| 1033 resetOptAndAssertResultEquals(undefined, f); |
| 1034 assertEquals(5, counter); |
| 1035 |
| 1036 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1037 // doCatch, deopt] |
| 1038 |
| 1039 f = function f___2_t__lc_______d () { |
| 1040 var local = 3; |
| 1041 deopt = true; |
| 1042 try { |
| 1043 counter++; |
| 1044 local += invertFunctionCall(increaseAndReturn15); |
| 1045 counter++; |
| 1046 } catch (ex) { |
| 1047 counter++; |
| 1048 counter++; |
| 1049 } |
| 1050 counter++; |
| 1051 } |
| 1052 resetOptAndAssertResultEquals(undefined, f); |
| 1053 assertEquals(5, counter); |
| 1054 |
| 1055 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1056 // doCatch, endReturnLocal] |
| 1057 |
| 1058 f = function f___2_t__lc______l_ () { |
| 1059 var local = 3; |
| 1060 deopt = false; |
| 1061 try { |
| 1062 counter++; |
| 1063 local += invertFunctionCall(increaseAndReturn15); |
| 1064 counter++; |
| 1065 } catch (ex) { |
| 1066 counter++; |
| 1067 counter++; |
| 1068 } |
| 1069 counter++; |
| 1070 return 5 + local; |
| 1071 } |
| 1072 resetOptAndAssertResultEquals(8, f); |
| 1073 assertEquals(5, counter); |
| 1074 |
| 1075 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1076 // doCatch, endReturnLocal, deopt] |
| 1077 |
| 1078 f = function f___2_t__lc______ld () { |
| 1079 var local = 3; |
| 1080 deopt = true; |
| 1081 try { |
| 1082 counter++; |
| 1083 local += invertFunctionCall(increaseAndReturn15); |
| 1084 counter++; |
| 1085 } catch (ex) { |
| 1086 counter++; |
| 1087 counter++; |
| 1088 } |
| 1089 counter++; |
| 1090 return 5 + local; |
| 1091 } |
| 1092 resetOptAndAssertResultEquals(8, f); |
| 1093 assertEquals(5, counter); |
| 1094 |
| 1095 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1096 // doCatch, catchThrows] |
| 1097 |
| 1098 f = function f___2_t__lc__t_____ () { |
| 1099 var local = 3; |
| 1100 deopt = false; |
| 1101 try { |
| 1102 counter++; |
| 1103 local += invertFunctionCall(increaseAndReturn15); |
| 1104 counter++; |
| 1105 } catch (ex) { |
| 1106 counter++; |
| 1107 throw 2 + ex; |
| 1108 counter++; |
| 1109 } |
| 1110 counter++; |
| 1111 } |
| 1112 resetOptAndAssertThrowsWith(44, f); |
| 1113 assertEquals(3, counter); |
| 1114 |
| 1115 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1116 // doCatch, catchThrows, deopt] |
| 1117 |
| 1118 f = function f___2_t__lc__t____d () { |
| 1119 var local = 3; |
| 1120 deopt = true; |
| 1121 try { |
| 1122 counter++; |
| 1123 local += invertFunctionCall(increaseAndReturn15); |
| 1124 counter++; |
| 1125 } catch (ex) { |
| 1126 counter++; |
| 1127 throw 2 + ex; |
| 1128 counter++; |
| 1129 } |
| 1130 counter++; |
| 1131 } |
| 1132 resetOptAndAssertThrowsWith(44, f); |
| 1133 assertEquals(3, counter); |
| 1134 |
| 1135 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1136 // doCatch, catchThrows, endReturnLocal] |
| 1137 |
| 1138 f = function f___2_t__lc__t___l_ () { |
| 1139 var local = 3; |
| 1140 deopt = false; |
| 1141 try { |
| 1142 counter++; |
| 1143 local += invertFunctionCall(increaseAndReturn15); |
| 1144 counter++; |
| 1145 } catch (ex) { |
| 1146 counter++; |
| 1147 throw 2 + ex; |
| 1148 counter++; |
| 1149 } |
| 1150 counter++; |
| 1151 return 5 + local; |
| 1152 } |
| 1153 resetOptAndAssertThrowsWith(44, f); |
| 1154 assertEquals(3, counter); |
| 1155 |
| 1156 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1157 // doCatch, catchThrows, endReturnLocal, deopt] |
| 1158 |
| 1159 f = function f___2_t__lc__t___ld () { |
| 1160 var local = 3; |
| 1161 deopt = true; |
| 1162 try { |
| 1163 counter++; |
| 1164 local += invertFunctionCall(increaseAndReturn15); |
| 1165 counter++; |
| 1166 } catch (ex) { |
| 1167 counter++; |
| 1168 throw 2 + ex; |
| 1169 counter++; |
| 1170 } |
| 1171 counter++; |
| 1172 return 5 + local; |
| 1173 } |
| 1174 resetOptAndAssertThrowsWith(44, f); |
| 1175 assertEquals(3, counter); |
| 1176 |
| 1177 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1178 // doCatch, catchWithLocal] |
| 1179 |
| 1180 f = function f___2_t__lc_l______ () { |
| 1181 var local = 3; |
| 1182 deopt = false; |
| 1183 try { |
| 1184 counter++; |
| 1185 local += invertFunctionCall(increaseAndReturn15); |
| 1186 counter++; |
| 1187 } catch (ex) { |
| 1188 counter++; |
| 1189 local += ex; |
| 1190 counter++; |
| 1191 } |
| 1192 counter++; |
| 1193 } |
| 1194 resetOptAndAssertResultEquals(undefined, f); |
| 1195 assertEquals(5, counter); |
| 1196 |
| 1197 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1198 // doCatch, catchWithLocal, deopt] |
| 1199 |
| 1200 f = function f___2_t__lc_l_____d () { |
| 1201 var local = 3; |
| 1202 deopt = true; |
| 1203 try { |
| 1204 counter++; |
| 1205 local += invertFunctionCall(increaseAndReturn15); |
| 1206 counter++; |
| 1207 } catch (ex) { |
| 1208 counter++; |
| 1209 local += ex; |
| 1210 counter++; |
| 1211 } |
| 1212 counter++; |
| 1213 } |
| 1214 resetOptAndAssertResultEquals(undefined, f); |
| 1215 assertEquals(5, counter); |
| 1216 |
| 1217 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1218 // doCatch, catchWithLocal, endReturnLocal] |
| 1219 |
| 1220 f = function f___2_t__lc_l____l_ () { |
| 1221 var local = 3; |
| 1222 deopt = false; |
| 1223 try { |
| 1224 counter++; |
| 1225 local += invertFunctionCall(increaseAndReturn15); |
| 1226 counter++; |
| 1227 } catch (ex) { |
| 1228 counter++; |
| 1229 local += ex; |
| 1230 counter++; |
| 1231 } |
| 1232 counter++; |
| 1233 return 5 + local; |
| 1234 } |
| 1235 resetOptAndAssertResultEquals(50, f); |
| 1236 assertEquals(5, counter); |
| 1237 |
| 1238 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1239 // doCatch, catchWithLocal, endReturnLocal, deopt] |
| 1240 |
| 1241 f = function f___2_t__lc_l____ld () { |
| 1242 var local = 3; |
| 1243 deopt = true; |
| 1244 try { |
| 1245 counter++; |
| 1246 local += invertFunctionCall(increaseAndReturn15); |
| 1247 counter++; |
| 1248 } catch (ex) { |
| 1249 counter++; |
| 1250 local += ex; |
| 1251 counter++; |
| 1252 } |
| 1253 counter++; |
| 1254 return 5 + local; |
| 1255 } |
| 1256 resetOptAndAssertResultEquals(50, f); |
| 1257 assertEquals(5, counter); |
| 1258 |
| 1259 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1260 // doCatch, catchWithLocal, catchThrows] |
| 1261 |
| 1262 f = function f___2_t__lc_lt_____ () { |
| 1263 var local = 3; |
| 1264 deopt = false; |
| 1265 try { |
| 1266 counter++; |
| 1267 local += invertFunctionCall(increaseAndReturn15); |
| 1268 counter++; |
| 1269 } catch (ex) { |
| 1270 counter++; |
| 1271 throw 2 + ex; |
| 1272 counter++; |
| 1273 } |
| 1274 counter++; |
| 1275 } |
| 1276 resetOptAndAssertThrowsWith(44, f); |
| 1277 assertEquals(3, counter); |
| 1278 |
| 1279 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1280 // doCatch, catchWithLocal, catchThrows, deopt] |
| 1281 |
| 1282 f = function f___2_t__lc_lt____d () { |
| 1283 var local = 3; |
| 1284 deopt = true; |
| 1285 try { |
| 1286 counter++; |
| 1287 local += invertFunctionCall(increaseAndReturn15); |
| 1288 counter++; |
| 1289 } catch (ex) { |
| 1290 counter++; |
| 1291 throw 2 + ex; |
| 1292 counter++; |
| 1293 } |
| 1294 counter++; |
| 1295 } |
| 1296 resetOptAndAssertThrowsWith(44, f); |
| 1297 assertEquals(3, counter); |
| 1298 |
| 1299 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1300 // doCatch, catchWithLocal, catchThrows, endReturnLocal] |
| 1301 |
| 1302 f = function f___2_t__lc_lt___l_ () { |
| 1303 var local = 3; |
| 1304 deopt = false; |
| 1305 try { |
| 1306 counter++; |
| 1307 local += invertFunctionCall(increaseAndReturn15); |
| 1308 counter++; |
| 1309 } catch (ex) { |
| 1310 counter++; |
| 1311 throw 2 + ex; |
| 1312 counter++; |
| 1313 } |
| 1314 counter++; |
| 1315 return 5 + local; |
| 1316 } |
| 1317 resetOptAndAssertThrowsWith(44, f); |
| 1318 assertEquals(3, counter); |
| 1319 |
| 1320 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1321 // doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt] |
| 1322 |
| 1323 f = function f___2_t__lc_lt___ld () { |
| 1324 var local = 3; |
| 1325 deopt = true; |
| 1326 try { |
| 1327 counter++; |
| 1328 local += invertFunctionCall(increaseAndReturn15); |
| 1329 counter++; |
| 1330 } catch (ex) { |
| 1331 counter++; |
| 1332 throw 2 + ex; |
| 1333 counter++; |
| 1334 } |
| 1335 counter++; |
| 1336 return 5 + local; |
| 1337 } |
| 1338 resetOptAndAssertThrowsWith(44, f); |
| 1339 assertEquals(3, counter); |
| 1340 |
| 1341 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1342 // doCatch, catchReturns] |
| 1343 |
| 1344 f = function f___2_t__lcr_______ () { |
| 1345 var local = 3; |
| 1346 deopt = false; |
| 1347 try { |
| 1348 counter++; |
| 1349 local += invertFunctionCall(increaseAndReturn15); |
| 1350 counter++; |
| 1351 } catch (ex) { |
| 1352 counter++; |
| 1353 return 2 + ex; |
| 1354 counter++; |
| 1355 } |
| 1356 counter++; |
| 1357 } |
| 1358 resetOptAndAssertResultEquals(44, f); |
| 1359 assertEquals(3, counter); |
| 1360 |
| 1361 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1362 // doCatch, catchReturns, deopt] |
| 1363 |
| 1364 f = function f___2_t__lcr______d () { |
| 1365 var local = 3; |
| 1366 deopt = true; |
| 1367 try { |
| 1368 counter++; |
| 1369 local += invertFunctionCall(increaseAndReturn15); |
| 1370 counter++; |
| 1371 } catch (ex) { |
| 1372 counter++; |
| 1373 return 2 + ex; |
| 1374 counter++; |
| 1375 } |
| 1376 counter++; |
| 1377 } |
| 1378 resetOptAndAssertResultEquals(44, f); |
| 1379 assertEquals(3, counter); |
| 1380 |
| 1381 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1382 // doCatch, catchReturns, endReturnLocal] |
| 1383 |
| 1384 f = function f___2_t__lcr_____l_ () { |
| 1385 var local = 3; |
| 1386 deopt = false; |
| 1387 try { |
| 1388 counter++; |
| 1389 local += invertFunctionCall(increaseAndReturn15); |
| 1390 counter++; |
| 1391 } catch (ex) { |
| 1392 counter++; |
| 1393 return 2 + ex; |
| 1394 counter++; |
| 1395 } |
| 1396 counter++; |
| 1397 return 5 + local; |
| 1398 } |
| 1399 resetOptAndAssertResultEquals(44, f); |
| 1400 assertEquals(3, counter); |
| 1401 |
| 1402 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1403 // doCatch, catchReturns, endReturnLocal, deopt] |
| 1404 |
| 1405 f = function f___2_t__lcr_____ld () { |
| 1406 var local = 3; |
| 1407 deopt = true; |
| 1408 try { |
| 1409 counter++; |
| 1410 local += invertFunctionCall(increaseAndReturn15); |
| 1411 counter++; |
| 1412 } catch (ex) { |
| 1413 counter++; |
| 1414 return 2 + ex; |
| 1415 counter++; |
| 1416 } |
| 1417 counter++; |
| 1418 return 5 + local; |
| 1419 } |
| 1420 resetOptAndAssertResultEquals(44, f); |
| 1421 assertEquals(3, counter); |
| 1422 |
| 1423 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1424 // doCatch, catchReturns, catchWithLocal] |
| 1425 |
| 1426 f = function f___2_t__lcrl______ () { |
| 1427 var local = 3; |
| 1428 deopt = false; |
| 1429 try { |
| 1430 counter++; |
| 1431 local += invertFunctionCall(increaseAndReturn15); |
| 1432 counter++; |
| 1433 } catch (ex) { |
| 1434 counter++; |
| 1435 return 2 + local; |
| 1436 counter++; |
| 1437 } |
| 1438 counter++; |
| 1439 } |
| 1440 resetOptAndAssertResultEquals(5, f); |
| 1441 assertEquals(3, counter); |
| 1442 |
| 1443 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1444 // doCatch, catchReturns, catchWithLocal, deopt] |
| 1445 |
| 1446 f = function f___2_t__lcrl_____d () { |
| 1447 var local = 3; |
| 1448 deopt = true; |
| 1449 try { |
| 1450 counter++; |
| 1451 local += invertFunctionCall(increaseAndReturn15); |
| 1452 counter++; |
| 1453 } catch (ex) { |
| 1454 counter++; |
| 1455 return 2 + local; |
| 1456 counter++; |
| 1457 } |
| 1458 counter++; |
| 1459 } |
| 1460 resetOptAndAssertResultEquals(5, f); |
| 1461 assertEquals(3, counter); |
| 1462 |
| 1463 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1464 // doCatch, catchReturns, catchWithLocal, endReturnLocal] |
| 1465 |
| 1466 f = function f___2_t__lcrl____l_ () { |
| 1467 var local = 3; |
| 1468 deopt = false; |
| 1469 try { |
| 1470 counter++; |
| 1471 local += invertFunctionCall(increaseAndReturn15); |
| 1472 counter++; |
| 1473 } catch (ex) { |
| 1474 counter++; |
| 1475 return 2 + local; |
| 1476 counter++; |
| 1477 } |
| 1478 counter++; |
| 1479 return 5 + local; |
| 1480 } |
| 1481 resetOptAndAssertResultEquals(5, f); |
| 1482 assertEquals(3, counter); |
| 1483 |
| 1484 // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, |
| 1485 // doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt] |
| 1486 |
| 1487 f = function f___2_t__lcrl____ld () { |
| 1488 var local = 3; |
| 1489 deopt = true; |
| 1490 try { |
| 1491 counter++; |
| 1492 local += invertFunctionCall(increaseAndReturn15); |
| 1493 counter++; |
| 1494 } catch (ex) { |
| 1495 counter++; |
| 1496 return 2 + local; |
| 1497 counter++; |
| 1498 } |
| 1499 counter++; |
| 1500 return 5 + local; |
| 1501 } |
| 1502 resetOptAndAssertResultEquals(5, f); |
| 1503 assertEquals(3, counter); |
| 1504 |
| 1505 // Variant flags: [alternativeFn3, tryReturns, doCatch] |
| 1506 |
| 1507 f = function f__3___r__c________ () { |
| 1508 var local = 3; |
| 1509 deopt = false; |
| 1510 try { |
| 1511 counter++; |
| 1512 return (new increaseAndStore15Constructor()).x; |
| 1513 counter++; |
| 1514 } catch (ex) { |
| 1515 counter++; |
| 1516 counter++; |
| 1517 } |
| 1518 counter++; |
| 1519 } |
| 1520 resetOptAndAssertResultEquals(15, f); |
| 1521 assertEquals(2, counter); |
| 1522 |
| 1523 // Variant flags: [alternativeFn3, tryReturns, doCatch, deopt] |
| 1524 |
| 1525 f = function f__3___r__c_______d () { |
| 1526 var local = 3; |
| 1527 deopt = true; |
| 1528 try { |
| 1529 counter++; |
| 1530 return (new increaseAndStore15Constructor()).x; |
| 1531 counter++; |
| 1532 } catch (ex) { |
| 1533 counter++; |
| 1534 counter++; |
| 1535 } |
| 1536 counter++; |
| 1537 } |
| 1538 resetOptAndAssertResultEquals(15, f); |
| 1539 assertEquals(2, counter); |
| 1540 |
| 1541 // Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows] |
| 1542 |
| 1543 f = function f__3___r__c__t_____ () { |
| 1544 var local = 3; |
| 1545 deopt = false; |
| 1546 try { |
| 1547 counter++; |
| 1548 return (new increaseAndStore15Constructor()).x; |
| 1549 counter++; |
| 1550 } catch (ex) { |
| 1551 counter++; |
| 1552 throw 2 + ex; |
| 1553 counter++; |
| 1554 } |
| 1555 counter++; |
| 1556 } |
| 1557 resetOptAndAssertResultEquals(15, f); |
| 1558 assertEquals(2, counter); |
| 1559 |
| 1560 // Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows, |
| 1561 // deopt] |
| 1562 |
| 1563 f = function f__3___r__c__t____d () { |
| 1564 var local = 3; |
| 1565 deopt = true; |
| 1566 try { |
| 1567 counter++; |
| 1568 return (new increaseAndStore15Constructor()).x; |
| 1569 counter++; |
| 1570 } catch (ex) { |
| 1571 counter++; |
| 1572 throw 2 + ex; |
| 1573 counter++; |
| 1574 } |
| 1575 counter++; |
| 1576 } |
| 1577 resetOptAndAssertResultEquals(15, f); |
| 1578 assertEquals(2, counter); |
| 1579 |
| 1580 // Variant flags: [alternativeFn3, tryReturns, doCatch, |
| 1581 // catchReturns] |
| 1582 |
| 1583 f = function f__3___r__cr_______ () { |
| 1584 var local = 3; |
| 1585 deopt = false; |
| 1586 try { |
| 1587 counter++; |
| 1588 return (new increaseAndStore15Constructor()).x; |
| 1589 counter++; |
| 1590 } catch (ex) { |
| 1591 counter++; |
| 1592 return 2 + ex; |
| 1593 counter++; |
| 1594 } |
| 1595 counter++; |
| 1596 } |
| 1597 resetOptAndAssertResultEquals(15, f); |
| 1598 assertEquals(2, counter); |
| 1599 |
| 1600 // Variant flags: [alternativeFn3, tryReturns, doCatch, |
| 1601 // catchReturns, deopt] |
| 1602 |
| 1603 f = function f__3___r__cr______d () { |
| 1604 var local = 3; |
| 1605 deopt = true; |
| 1606 try { |
| 1607 counter++; |
| 1608 return (new increaseAndStore15Constructor()).x; |
| 1609 counter++; |
| 1610 } catch (ex) { |
| 1611 counter++; |
| 1612 return 2 + ex; |
| 1613 counter++; |
| 1614 } |
| 1615 counter++; |
| 1616 } |
| 1617 resetOptAndAssertResultEquals(15, f); |
| 1618 assertEquals(2, counter); |
| 1619 |
| 1620 // Variant flags: [alternativeFn3, tryThrows, doCatch] |
| 1621 |
| 1622 f = function f__3__t___c________ () { |
| 1623 var local = 3; |
| 1624 deopt = false; |
| 1625 try { |
| 1626 counter++; |
| 1627 return (new increaseAndThrow42Constructor()).x; |
| 1628 counter++; |
| 1629 } catch (ex) { |
| 1630 counter++; |
| 1631 counter++; |
| 1632 } |
| 1633 counter++; |
| 1634 } |
| 1635 resetOptAndAssertResultEquals(undefined, f); |
| 1636 assertEquals(5, counter); |
| 1637 |
| 1638 // Variant flags: [alternativeFn3, tryThrows, doCatch, deopt] |
| 1639 |
| 1640 f = function f__3__t___c_______d () { |
| 1641 var local = 3; |
| 1642 deopt = true; |
| 1643 try { |
| 1644 counter++; |
| 1645 return (new increaseAndThrow42Constructor()).x; |
| 1646 counter++; |
| 1647 } catch (ex) { |
| 1648 counter++; |
| 1649 counter++; |
| 1650 } |
| 1651 counter++; |
| 1652 } |
| 1653 resetOptAndAssertResultEquals(undefined, f); |
| 1654 assertEquals(5, counter); |
| 1655 |
| 1656 // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows] |
| 1657 |
| 1658 f = function f__3__t___c__t_____ () { |
| 1659 var local = 3; |
| 1660 deopt = false; |
| 1661 try { |
| 1662 counter++; |
| 1663 return (new increaseAndThrow42Constructor()).x; |
| 1664 counter++; |
| 1665 } catch (ex) { |
| 1666 counter++; |
| 1667 throw 2 + ex; |
| 1668 counter++; |
| 1669 } |
| 1670 counter++; |
| 1671 } |
| 1672 resetOptAndAssertThrowsWith(44, f); |
| 1673 assertEquals(3, counter); |
| 1674 |
| 1675 // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows, |
| 1676 // deopt] |
| 1677 |
| 1678 f = function f__3__t___c__t____d () { |
| 1679 var local = 3; |
| 1680 deopt = true; |
| 1681 try { |
| 1682 counter++; |
| 1683 return (new increaseAndThrow42Constructor()).x; |
| 1684 counter++; |
| 1685 } catch (ex) { |
| 1686 counter++; |
| 1687 throw 2 + ex; |
| 1688 counter++; |
| 1689 } |
| 1690 counter++; |
| 1691 } |
| 1692 resetOptAndAssertThrowsWith(44, f); |
| 1693 assertEquals(3, counter); |
| 1694 |
| 1695 // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns] |
| 1696 |
| 1697 f = function f__3__t___cr_______ () { |
| 1698 var local = 3; |
| 1699 deopt = false; |
| 1700 try { |
| 1701 counter++; |
| 1702 return (new increaseAndThrow42Constructor()).x; |
| 1703 counter++; |
| 1704 } catch (ex) { |
| 1705 counter++; |
| 1706 return 2 + ex; |
| 1707 counter++; |
| 1708 } |
| 1709 counter++; |
| 1710 } |
| 1711 resetOptAndAssertResultEquals(44, f); |
| 1712 assertEquals(3, counter); |
| 1713 |
| 1714 // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns, |
| 1715 // deopt] |
| 1716 |
| 1717 f = function f__3__t___cr______d () { |
| 1718 var local = 3; |
| 1719 deopt = true; |
| 1720 try { |
| 1721 counter++; |
| 1722 return (new increaseAndThrow42Constructor()).x; |
| 1723 counter++; |
| 1724 } catch (ex) { |
| 1725 counter++; |
| 1726 return 2 + ex; |
| 1727 counter++; |
| 1728 } |
| 1729 counter++; |
| 1730 } |
| 1731 resetOptAndAssertResultEquals(44, f); |
| 1732 assertEquals(3, counter); |
| 1733 |
| 1734 // Variant flags: [alternativeFn4, tryReturns, doCatch] |
| 1735 |
| 1736 f = function f_4____r__c________ () { |
| 1737 var local = 3; |
| 1738 deopt = false; |
| 1739 try { |
| 1740 counter++; |
| 1741 return magic.prop /* returns 15 */; |
| 1742 counter++; |
| 1743 } catch (ex) { |
| 1744 counter++; |
| 1745 counter++; |
| 1746 } |
| 1747 counter++; |
| 1748 } |
| 1749 resetOptAndAssertResultEquals(15, f); |
| 1750 assertEquals(2, counter); |
| 1751 |
| 1752 // Variant flags: [alternativeFn4, tryReturns, doCatch, deopt] |
| 1753 |
| 1754 f = function f_4____r__c_______d () { |
| 1755 var local = 3; |
| 1756 deopt = true; |
| 1757 try { |
| 1758 counter++; |
| 1759 return magic.prop /* returns 15 */; |
| 1760 counter++; |
| 1761 } catch (ex) { |
| 1762 counter++; |
| 1763 counter++; |
| 1764 } |
| 1765 counter++; |
| 1766 } |
| 1767 resetOptAndAssertResultEquals(15, f); |
| 1768 assertEquals(2, counter); |
| 1769 |
| 1770 // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows] |
| 1771 |
| 1772 f = function f_4____r__c__t_____ () { |
| 1773 var local = 3; |
| 1774 deopt = false; |
| 1775 try { |
| 1776 counter++; |
| 1777 return magic.prop /* returns 15 */; |
| 1778 counter++; |
| 1779 } catch (ex) { |
| 1780 counter++; |
| 1781 throw 2 + ex; |
| 1782 counter++; |
| 1783 } |
| 1784 counter++; |
| 1785 } |
| 1786 resetOptAndAssertResultEquals(15, f); |
| 1787 assertEquals(2, counter); |
| 1788 |
| 1789 // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows, |
| 1790 // deopt] |
| 1791 |
| 1792 f = function f_4____r__c__t____d () { |
| 1793 var local = 3; |
| 1794 deopt = true; |
| 1795 try { |
| 1796 counter++; |
| 1797 return magic.prop /* returns 15 */; |
| 1798 counter++; |
| 1799 } catch (ex) { |
| 1800 counter++; |
| 1801 throw 2 + ex; |
| 1802 counter++; |
| 1803 } |
| 1804 counter++; |
| 1805 } |
| 1806 resetOptAndAssertResultEquals(15, f); |
| 1807 assertEquals(2, counter); |
| 1808 |
| 1809 // Variant flags: [alternativeFn4, tryReturns, doCatch, |
| 1810 // catchReturns] |
| 1811 |
| 1812 f = function f_4____r__cr_______ () { |
| 1813 var local = 3; |
| 1814 deopt = false; |
| 1815 try { |
| 1816 counter++; |
| 1817 return magic.prop /* returns 15 */; |
| 1818 counter++; |
| 1819 } catch (ex) { |
| 1820 counter++; |
| 1821 return 2 + ex; |
| 1822 counter++; |
| 1823 } |
| 1824 counter++; |
| 1825 } |
| 1826 resetOptAndAssertResultEquals(15, f); |
| 1827 assertEquals(2, counter); |
| 1828 |
| 1829 // Variant flags: [alternativeFn4, tryReturns, doCatch, |
| 1830 // catchReturns, deopt] |
| 1831 |
| 1832 f = function f_4____r__cr______d () { |
| 1833 var local = 3; |
| 1834 deopt = true; |
| 1835 try { |
| 1836 counter++; |
| 1837 return magic.prop /* returns 15 */; |
| 1838 counter++; |
| 1839 } catch (ex) { |
| 1840 counter++; |
| 1841 return 2 + ex; |
| 1842 counter++; |
| 1843 } |
| 1844 counter++; |
| 1845 } |
| 1846 resetOptAndAssertResultEquals(15, f); |
| 1847 assertEquals(2, counter); |
| 1848 |
| 1849 // Variant flags: [alternativeFn4, tryThrows, doCatch] |
| 1850 |
| 1851 f = function f_4___t___c________ () { |
| 1852 var local = 3; |
| 1853 deopt = false; |
| 1854 try { |
| 1855 counter++; |
| 1856 return (magic.prop = 37 /* throws 42 */); |
| 1857 counter++; |
| 1858 } catch (ex) { |
| 1859 counter++; |
| 1860 counter++; |
| 1861 } |
| 1862 counter++; |
| 1863 } |
| 1864 resetOptAndAssertResultEquals(undefined, f); |
| 1865 assertEquals(5, counter); |
| 1866 |
| 1867 // Variant flags: [alternativeFn4, tryThrows, doCatch, deopt] |
| 1868 |
| 1869 f = function f_4___t___c_______d () { |
| 1870 var local = 3; |
| 1871 deopt = true; |
| 1872 try { |
| 1873 counter++; |
| 1874 return (magic.prop = 37 /* throws 42 */); |
| 1875 counter++; |
| 1876 } catch (ex) { |
| 1877 counter++; |
| 1878 counter++; |
| 1879 } |
| 1880 counter++; |
| 1881 } |
| 1882 resetOptAndAssertResultEquals(undefined, f); |
| 1883 assertEquals(5, counter); |
| 1884 |
| 1885 // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows] |
| 1886 |
| 1887 f = function f_4___t___c__t_____ () { |
| 1888 var local = 3; |
| 1889 deopt = false; |
| 1890 try { |
| 1891 counter++; |
| 1892 return (magic.prop = 37 /* throws 42 */); |
| 1893 counter++; |
| 1894 } catch (ex) { |
| 1895 counter++; |
| 1896 throw 2 + ex; |
| 1897 counter++; |
| 1898 } |
| 1899 counter++; |
| 1900 } |
| 1901 resetOptAndAssertThrowsWith(44, f); |
| 1902 assertEquals(3, counter); |
| 1903 |
| 1904 // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows, |
| 1905 // deopt] |
| 1906 |
| 1907 f = function f_4___t___c__t____d () { |
| 1908 var local = 3; |
| 1909 deopt = true; |
| 1910 try { |
| 1911 counter++; |
| 1912 return (magic.prop = 37 /* throws 42 */); |
| 1913 counter++; |
| 1914 } catch (ex) { |
| 1915 counter++; |
| 1916 throw 2 + ex; |
| 1917 counter++; |
| 1918 } |
| 1919 counter++; |
| 1920 } |
| 1921 resetOptAndAssertThrowsWith(44, f); |
| 1922 assertEquals(3, counter); |
| 1923 |
| 1924 // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns] |
| 1925 |
| 1926 f = function f_4___t___cr_______ () { |
| 1927 var local = 3; |
| 1928 deopt = false; |
| 1929 try { |
| 1930 counter++; |
| 1931 return (magic.prop = 37 /* throws 42 */); |
| 1932 counter++; |
| 1933 } catch (ex) { |
| 1934 counter++; |
| 1935 return 2 + ex; |
| 1936 counter++; |
| 1937 } |
| 1938 counter++; |
| 1939 } |
| 1940 resetOptAndAssertResultEquals(44, f); |
| 1941 assertEquals(3, counter); |
| 1942 |
| 1943 // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns, |
| 1944 // deopt] |
| 1945 |
| 1946 f = function f_4___t___cr______d () { |
| 1947 var local = 3; |
| 1948 deopt = true; |
| 1949 try { |
| 1950 counter++; |
| 1951 return (magic.prop = 37 /* throws 42 */); |
| 1952 counter++; |
| 1953 } catch (ex) { |
| 1954 counter++; |
| 1955 return 2 + ex; |
| 1956 counter++; |
| 1957 } |
| 1958 counter++; |
| 1959 } |
| 1960 resetOptAndAssertResultEquals(44, f); |
| 1961 assertEquals(3, counter); |
| 1962 |
| 1963 } |
| 1964 %NeverOptimizeFunction(runThisShard); |
| 1965 |
| 1966 // 92 tests in this shard. |
| 1967 // 186 tests up to here. |
| 1968 |
| 1969 runThisShard(); |
OLD | NEW |