inline-exception-2.js 45.4 KB
Newer Older
1 2 3 4 5 6
// Shard 2.

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

7
// Flags: --allow-natives-syntax --no-always-opt
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

// This test file was generated by tools/gen-inlining-tests.py .

// Global variables
var deopt = undefined; // either true or false
var counter = 0;

function resetState() {
  counter = 0;
}

function warmUp(f) {
  try {
    f();
  } catch (ex) {
    // ok
  }
  try {
    f();
  } catch (ex) {
    // ok
  }
}

function resetOptAndAssertResultEquals(expected, f) {
33
  %PrepareFunctionForOptimization(f);
34 35 36 37 38 39 40 41 42
  warmUp(f);
  resetState();
  // %DebugPrint(f);
  eval("'dont optimize this function itself please, but do optimize f'");
  %OptimizeFunctionOnNextCall(f);
  assertEquals(expected, f());
}

function resetOptAndAssertThrowsWith(expected, f) {
43
  %PrepareFunctionForOptimization(f);
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
  warmUp(f);
  resetState();
  // %DebugPrint(f);
  eval("'dont optimize this function itself please, but do optimize f'");
  %OptimizeFunctionOnNextCall(f);
  try {
    var result = f();
    fail("resetOptAndAssertThrowsWith",
        "exception: " + expected,
        "result: " + result);
  } catch (ex) {
    assertEquals(expected, ex);
  }
}

function increaseAndReturn15() {
  if (deopt) %DeoptimizeFunction(f);
  counter++;
  return 15;
}

function increaseAndThrow42() {
  if (deopt) %DeoptimizeFunction(f);
  counter++;
  throw 42;
}

71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
function increaseAndReturn15_noopt_inner() {
  if (deopt) %DeoptimizeFunction(f);
  counter++;
  return 15;
}

%NeverOptimizeFunction(increaseAndReturn15_noopt_inner);

function increaseAndThrow42_noopt_inner() {
  if (deopt) %DeoptimizeFunction(f);
  counter++;
  throw 42;
}

%NeverOptimizeFunction(increaseAndThrow42_noopt_inner);

// Alternative 1

89 90 91 92 93 94 95 96
function returnOrThrow(doReturn) {
  if (doReturn) {
    return increaseAndReturn15();
  } else {
    return increaseAndThrow42();
  }
}

97 98 99 100 101 102 103 104 105 106 107
// Alternative 2

function increaseAndReturn15_calls_noopt() {
  return increaseAndReturn15_noopt_inner();
}

function increaseAndThrow42_calls_noopt() {
  return increaseAndThrow42_noopt_inner();
}

// Alternative 3.
108 109 110 111 112 113 114 115 116 117 118 119
// When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts
// as the other one.
function invertFunctionCall(f) {
  var result;
  try {
    result = f();
  } catch (ex) {
    return ex - 27;
  }
  throw result + 27;
}

120
// Alternative 4: constructor
121 122 123 124 125 126 127 128 129 130 131 132 133
function increaseAndStore15Constructor() {
  if (deopt) %DeoptimizeFunction(f);
  ++counter;
  this.x = 15;
}

function increaseAndThrow42Constructor() {
  if (deopt) %DeoptimizeFunction(f);
  ++counter;
  this.x = 42;
  throw this.x;
}

134
// Alternative 5: property
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
var magic = {};
Object.defineProperty(magic, 'prop', {
  get: function () {
    if (deopt) %DeoptimizeFunction(f);
    return 15 + 0 * ++counter;
  },

  set: function(x) {
    // argument should be 37
    if (deopt) %DeoptimizeFunction(f);
    counter -= 36 - x; // increments counter
    throw 42;
  }
})

// Generate type feedback.

152 153 154
assertEquals(15, increaseAndReturn15_calls_noopt());
assertThrowsEquals(function() { return increaseAndThrow42_noopt_inner() }, 42);

155 156 157 158 159 160 161 162
assertEquals(15, (new increaseAndStore15Constructor()).x);
assertThrowsEquals(function() {
        return (new increaseAndThrow42Constructor()).x;
    },
    42);

function runThisShard() {

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
  // Variant flags: [alternativeFn3, tryReturns, doCatch,
  //   catchReturns, deopt]

  f = function f___3___r__cr______d () {
    var local = 888;
    deopt = true;
    try {
      counter++;
      return 4 + invertFunctionCall(increaseAndThrow42);
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(19, f);
  assertEquals(2, counter);

  // Variant flags: [alternativeFn3, tryReturns, doCatch,
  //   catchReturns, catchWithLocal]

  f = function f___3___r__crl______ () {
    var local = 888;
    deopt = false;
    try {
      counter++;
      return 4 + invertFunctionCall(increaseAndThrow42);
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(19, f);
  assertEquals(2, counter);

  // Variant flags: [alternativeFn3, tryReturns, doCatch,
  //   catchReturns, catchWithLocal, deopt]

  f = function f___3___r__crl_____d () {
    var local = 888;
    deopt = true;
    try {
      counter++;
      return 4 + invertFunctionCall(increaseAndThrow42);
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(19, f);
  assertEquals(2, counter);

  // Variant flags: [alternativeFn3, tryReturns, doCatch,
224 225
  //   catchReturns, catchWithLocal, endReturnLocal]

226 227
  f = function f___3___r__crl____l_ () {
    var local = 888;
228 229 230
    deopt = false;
    try {
      counter++;
231
      return 4 + invertFunctionCall(increaseAndThrow42);
232 233 234 235 236 237 238 239 240
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
241
  resetOptAndAssertResultEquals(19, f);
242 243
  assertEquals(2, counter);

244
  // Variant flags: [alternativeFn3, tryReturns, doCatch,
245 246
  //   catchReturns, catchWithLocal, endReturnLocal, deopt]

247 248
  f = function f___3___r__crl____ld () {
    var local = 888;
249 250 251
    deopt = true;
    try {
      counter++;
252
      return 4 + invertFunctionCall(increaseAndThrow42);
253 254 255 256 257 258 259 260 261
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
262
  resetOptAndAssertResultEquals(19, f);
263 264
  assertEquals(2, counter);

265
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
266 267
  //   doCatch]

268 269
  f = function f___3___r_lc________ () {
    var local = 888;
270 271 272
    deopt = false;
    try {
      counter++;
273
      local += 4 + invertFunctionCall(increaseAndThrow42);
274 275 276 277 278 279 280 281 282 283
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

284
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
285 286
  //   doCatch, deopt]

287 288
  f = function f___3___r_lc_______d () {
    var local = 888;
289 290 291
    deopt = true;
    try {
      counter++;
292
      local += 4 + invertFunctionCall(increaseAndThrow42);
293 294 295 296 297 298 299 300 301 302
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

303
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
304 305
  //   doCatch, endReturnLocal]

306 307
  f = function f___3___r_lc______l_ () {
    var local = 888;
308 309 310
    deopt = false;
    try {
      counter++;
311
      local += 4 + invertFunctionCall(increaseAndThrow42);
312 313 314 315 316 317 318 319
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
    return 5 + local;
  }
320
  resetOptAndAssertResultEquals(912, f);
321 322
  assertEquals(4, counter);

323
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
324 325
  //   doCatch, endReturnLocal, deopt]

326 327
  f = function f___3___r_lc______ld () {
    var local = 888;
328 329 330
    deopt = true;
    try {
      counter++;
331
      local += 4 + invertFunctionCall(increaseAndThrow42);
332 333 334 335 336 337 338 339
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
    return 5 + local;
  }
340
  resetOptAndAssertResultEquals(912, f);
341 342
  assertEquals(4, counter);

343
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
344 345
  //   doCatch, catchThrows]

346 347
  f = function f___3___r_lc__t_____ () {
    var local = 888;
348 349 350
    deopt = false;
    try {
      counter++;
351
      local += 4 + invertFunctionCall(increaseAndThrow42);
352 353 354 355 356 357 358 359 360 361 362
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

363
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
364 365
  //   doCatch, catchThrows, deopt]

366 367
  f = function f___3___r_lc__t____d () {
    var local = 888;
368 369 370
    deopt = true;
    try {
      counter++;
371
      local += 4 + invertFunctionCall(increaseAndThrow42);
372 373 374 375 376 377 378 379 380 381 382
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

383
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
384 385
  //   doCatch, catchThrows, endReturnLocal]

386 387
  f = function f___3___r_lc__t___l_ () {
    var local = 888;
388 389 390
    deopt = false;
    try {
      counter++;
391
      local += 4 + invertFunctionCall(increaseAndThrow42);
392 393 394 395 396 397 398 399 400
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
401
  resetOptAndAssertResultEquals(912, f);
402 403
  assertEquals(4, counter);

404
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
405 406
  //   doCatch, catchThrows, endReturnLocal, deopt]

407 408
  f = function f___3___r_lc__t___ld () {
    var local = 888;
409 410 411
    deopt = true;
    try {
      counter++;
412
      local += 4 + invertFunctionCall(increaseAndThrow42);
413 414 415 416 417 418 419 420 421
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
422
  resetOptAndAssertResultEquals(912, f);
423 424
  assertEquals(4, counter);

425
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
426 427
  //   doCatch, catchWithLocal]

428 429
  f = function f___3___r_lc_l______ () {
    var local = 888;
430 431 432
    deopt = false;
    try {
      counter++;
433
      local += 4 + invertFunctionCall(increaseAndThrow42);
434 435 436 437 438 439 440 441 442 443 444
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

445
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
446 447
  //   doCatch, catchWithLocal, deopt]

448 449
  f = function f___3___r_lc_l_____d () {
    var local = 888;
450 451 452
    deopt = true;
    try {
      counter++;
453
      local += 4 + invertFunctionCall(increaseAndThrow42);
454 455 456 457 458 459 460 461 462 463 464
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

465
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
466 467
  //   doCatch, catchWithLocal, endReturnLocal]

468 469
  f = function f___3___r_lc_l____l_ () {
    var local = 888;
470 471 472
    deopt = false;
    try {
      counter++;
473
      local += 4 + invertFunctionCall(increaseAndThrow42);
474 475 476 477 478 479 480 481 482
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
483
  resetOptAndAssertResultEquals(912, f);
484 485
  assertEquals(4, counter);

486
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
487 488
  //   doCatch, catchWithLocal, endReturnLocal, deopt]

489 490
  f = function f___3___r_lc_l____ld () {
    var local = 888;
491 492 493
    deopt = true;
    try {
      counter++;
494
      local += 4 + invertFunctionCall(increaseAndThrow42);
495 496 497 498 499 500 501 502 503
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
504
  resetOptAndAssertResultEquals(912, f);
505 506
  assertEquals(4, counter);

507
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
508 509
  //   doCatch, catchWithLocal, catchThrows]

510 511
  f = function f___3___r_lc_lt_____ () {
    var local = 888;
512 513 514
    deopt = false;
    try {
      counter++;
515
      local += 4 + invertFunctionCall(increaseAndThrow42);
516 517 518 519 520 521 522 523 524 525 526
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

527
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
528 529
  //   doCatch, catchWithLocal, catchThrows, deopt]

530 531
  f = function f___3___r_lc_lt____d () {
    var local = 888;
532 533 534
    deopt = true;
    try {
      counter++;
535
      local += 4 + invertFunctionCall(increaseAndThrow42);
536 537 538 539 540 541 542 543 544 545 546
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

547
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
548 549
  //   doCatch, catchWithLocal, catchThrows, endReturnLocal]

550 551
  f = function f___3___r_lc_lt___l_ () {
    var local = 888;
552 553 554
    deopt = false;
    try {
      counter++;
555
      local += 4 + invertFunctionCall(increaseAndThrow42);
556 557 558 559 560 561 562 563 564
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
565
  resetOptAndAssertResultEquals(912, f);
566 567
  assertEquals(4, counter);

568
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
569 570
  //   doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt]

571 572
  f = function f___3___r_lc_lt___ld () {
    var local = 888;
573 574 575
    deopt = true;
    try {
      counter++;
576
      local += 4 + invertFunctionCall(increaseAndThrow42);
577 578 579 580 581 582 583 584 585
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
586
  resetOptAndAssertResultEquals(912, f);
587 588
  assertEquals(4, counter);

589
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
590 591
  //   doCatch, catchReturns]

592 593
  f = function f___3___r_lcr_______ () {
    var local = 888;
594 595 596
    deopt = false;
    try {
      counter++;
597
      local += 4 + invertFunctionCall(increaseAndThrow42);
598 599 600 601 602 603 604 605 606 607 608
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

609
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
610 611
  //   doCatch, catchReturns, deopt]

612 613
  f = function f___3___r_lcr______d () {
    var local = 888;
614 615 616
    deopt = true;
    try {
      counter++;
617
      local += 4 + invertFunctionCall(increaseAndThrow42);
618 619 620 621 622 623 624 625 626 627 628
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

629
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
630 631
  //   doCatch, catchReturns, endReturnLocal]

632 633
  f = function f___3___r_lcr_____l_ () {
    var local = 888;
634 635 636
    deopt = false;
    try {
      counter++;
637
      local += 4 + invertFunctionCall(increaseAndThrow42);
638 639 640 641 642 643 644 645 646
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
647
  resetOptAndAssertResultEquals(912, f);
648 649
  assertEquals(4, counter);

650
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
651 652
  //   doCatch, catchReturns, endReturnLocal, deopt]

653 654
  f = function f___3___r_lcr_____ld () {
    var local = 888;
655 656 657
    deopt = true;
    try {
      counter++;
658
      local += 4 + invertFunctionCall(increaseAndThrow42);
659 660 661 662 663 664 665 666 667
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
668
  resetOptAndAssertResultEquals(912, f);
669 670
  assertEquals(4, counter);

671
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
672 673
  //   doCatch, catchReturns, catchWithLocal]

674 675
  f = function f___3___r_lcrl______ () {
    var local = 888;
676 677 678
    deopt = false;
    try {
      counter++;
679
      local += 4 + invertFunctionCall(increaseAndThrow42);
680 681 682 683 684 685 686 687 688 689 690
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

691
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
692 693
  //   doCatch, catchReturns, catchWithLocal, deopt]

694 695
  f = function f___3___r_lcrl_____d () {
    var local = 888;
696 697 698
    deopt = true;
    try {
      counter++;
699
      local += 4 + invertFunctionCall(increaseAndThrow42);
700 701 702 703 704 705 706 707 708 709 710
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(4, counter);

711
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
712 713
  //   doCatch, catchReturns, catchWithLocal, endReturnLocal]

714 715
  f = function f___3___r_lcrl____l_ () {
    var local = 888;
716 717 718
    deopt = false;
    try {
      counter++;
719
      local += 4 + invertFunctionCall(increaseAndThrow42);
720 721 722 723 724 725 726 727 728
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
729
  resetOptAndAssertResultEquals(912, f);
730 731
  assertEquals(4, counter);

732
  // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
733 734
  //   doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt]

735 736
  f = function f___3___r_lcrl____ld () {
    var local = 888;
737 738 739
    deopt = true;
    try {
      counter++;
740
      local += 4 + invertFunctionCall(increaseAndThrow42);
741 742 743 744 745 746 747 748 749
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
750
  resetOptAndAssertResultEquals(912, f);
751 752
  assertEquals(4, counter);

753
  // Variant flags: [alternativeFn3, tryThrows, doCatch]
754

755 756
  f = function f___3__t___c________ () {
    var local = 888;
757 758 759
    deopt = false;
    try {
      counter++;
760
      return 4 + invertFunctionCall(increaseAndReturn15);
761 762 763 764 765 766 767 768 769 770
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

771
  // Variant flags: [alternativeFn3, tryThrows, doCatch, deopt]
772

773 774
  f = function f___3__t___c_______d () {
    var local = 888;
775 776 777
    deopt = true;
    try {
      counter++;
778
      return 4 + invertFunctionCall(increaseAndReturn15);
779 780 781 782 783 784 785 786 787 788
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

789
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows]
790

791 792
  f = function f___3__t___c__t_____ () {
    var local = 888;
793 794 795
    deopt = false;
    try {
      counter++;
796
      return 4 + invertFunctionCall(increaseAndReturn15);
797 798 799 800 801 802 803 804 805 806 807
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

808
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows,
809 810
  //   deopt]

811 812
  f = function f___3__t___c__t____d () {
    var local = 888;
813 814 815
    deopt = true;
    try {
      counter++;
816
      return 4 + invertFunctionCall(increaseAndReturn15);
817 818 819 820 821 822 823 824 825 826 827
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

828
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
829 830
  //   catchWithLocal]

831 832
  f = function f___3__t___c_l______ () {
    var local = 888;
833 834 835
    deopt = false;
    try {
      counter++;
836
      return 4 + invertFunctionCall(increaseAndReturn15);
837 838 839 840 841 842 843 844 845 846 847
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

848
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
849 850
  //   catchWithLocal, deopt]

851 852
  f = function f___3__t___c_l_____d () {
    var local = 888;
853 854 855
    deopt = true;
    try {
      counter++;
856
      return 4 + invertFunctionCall(increaseAndReturn15);
857 858 859 860 861 862 863 864 865 866 867
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

868
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
869 870
  //   catchWithLocal, endReturnLocal]

871 872
  f = function f___3__t___c_l____l_ () {
    var local = 888;
873 874 875
    deopt = false;
    try {
      counter++;
876
      return 4 + invertFunctionCall(increaseAndReturn15);
877 878 879 880 881 882 883 884 885
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
886
  resetOptAndAssertResultEquals(935, f);
887 888
  assertEquals(5, counter);

889
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
890 891
  //   catchWithLocal, endReturnLocal, deopt]

892 893
  f = function f___3__t___c_l____ld () {
    var local = 888;
894 895 896
    deopt = true;
    try {
      counter++;
897
      return 4 + invertFunctionCall(increaseAndReturn15);
898 899 900 901 902 903 904 905 906
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
907
  resetOptAndAssertResultEquals(935, f);
908 909
  assertEquals(5, counter);

910
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
911 912
  //   catchWithLocal, catchThrows]

913 914
  f = function f___3__t___c_lt_____ () {
    var local = 888;
915 916 917
    deopt = false;
    try {
      counter++;
918
      return 4 + invertFunctionCall(increaseAndReturn15);
919 920 921 922 923 924 925 926 927 928 929
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

930
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
931 932
  //   catchWithLocal, catchThrows, deopt]

933 934
  f = function f___3__t___c_lt____d () {
    var local = 888;
935 936 937
    deopt = true;
    try {
      counter++;
938
      return 4 + invertFunctionCall(increaseAndReturn15);
939 940 941 942 943 944 945 946 947 948 949
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

950
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
951 952
  //   catchWithLocal, catchThrows, endReturnLocal]

953 954
  f = function f___3__t___c_lt___l_ () {
    var local = 888;
955 956 957
    deopt = false;
    try {
      counter++;
958
      return 4 + invertFunctionCall(increaseAndReturn15);
959 960 961 962 963 964 965 966 967 968 969 970
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

971
  // Variant flags: [alternativeFn3, tryThrows, doCatch,
972 973
  //   catchWithLocal, catchThrows, endReturnLocal, deopt]

974 975
  f = function f___3__t___c_lt___ld () {
    var local = 888;
976 977 978
    deopt = true;
    try {
      counter++;
979
      return 4 + invertFunctionCall(increaseAndReturn15);
980 981 982 983 984 985 986 987 988 989 990 991
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

992
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns]
993

994 995
  f = function f___3__t___cr_______ () {
    var local = 888;
996 997 998
    deopt = false;
    try {
      counter++;
999
      return 4 + invertFunctionCall(increaseAndReturn15);
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1011
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
1012 1013
  //   deopt]

1014 1015
  f = function f___3__t___cr______d () {
    var local = 888;
1016 1017 1018
    deopt = true;
    try {
      counter++;
1019
      return 4 + invertFunctionCall(increaseAndReturn15);
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1031
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
1032 1033
  //   catchWithLocal]

1034 1035
  f = function f___3__t___crl______ () {
    var local = 888;
1036 1037 1038
    deopt = false;
    try {
      counter++;
1039
      return 4 + invertFunctionCall(increaseAndReturn15);
1040 1041 1042 1043 1044 1045 1046 1047
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
1048
  resetOptAndAssertResultEquals(890, f);
1049 1050
  assertEquals(3, counter);

1051
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
1052 1053
  //   catchWithLocal, deopt]

1054 1055
  f = function f___3__t___crl_____d () {
    var local = 888;
1056 1057 1058
    deopt = true;
    try {
      counter++;
1059
      return 4 + invertFunctionCall(increaseAndReturn15);
1060 1061 1062 1063 1064 1065 1066 1067
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
1068
  resetOptAndAssertResultEquals(890, f);
1069 1070
  assertEquals(3, counter);

1071
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
1072 1073
  //   catchWithLocal, endReturnLocal]

1074 1075
  f = function f___3__t___crl____l_ () {
    var local = 888;
1076 1077 1078
    deopt = false;
    try {
      counter++;
1079
      return 4 + invertFunctionCall(increaseAndReturn15);
1080 1081 1082 1083 1084 1085 1086 1087 1088
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1089
  resetOptAndAssertResultEquals(890, f);
1090 1091
  assertEquals(3, counter);

1092
  // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
1093 1094
  //   catchWithLocal, endReturnLocal, deopt]

1095 1096
  f = function f___3__t___crl____ld () {
    var local = 888;
1097 1098 1099
    deopt = true;
    try {
      counter++;
1100
      return 4 + invertFunctionCall(increaseAndReturn15);
1101 1102 1103 1104 1105 1106 1107 1108 1109
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1110
  resetOptAndAssertResultEquals(890, f);
1111 1112
  assertEquals(3, counter);

1113
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1114 1115
  //   doCatch]

1116 1117
  f = function f___3__t__lc________ () {
    var local = 888;
1118 1119 1120
    deopt = false;
    try {
      counter++;
1121
      local += 4 + invertFunctionCall(increaseAndReturn15);
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1132
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1133 1134
  //   doCatch, deopt]

1135 1136
  f = function f___3__t__lc_______d () {
    var local = 888;
1137 1138 1139
    deopt = true;
    try {
      counter++;
1140
      local += 4 + invertFunctionCall(increaseAndReturn15);
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1151
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1152 1153
  //   doCatch, endReturnLocal]

1154 1155
  f = function f___3__t__lc______l_ () {
    var local = 888;
1156 1157 1158
    deopt = false;
    try {
      counter++;
1159
      local += 4 + invertFunctionCall(increaseAndReturn15);
1160 1161 1162 1163 1164 1165 1166 1167
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1168
  resetOptAndAssertResultEquals(893, f);
1169 1170
  assertEquals(5, counter);

1171
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1172 1173
  //   doCatch, endReturnLocal, deopt]

1174 1175
  f = function f___3__t__lc______ld () {
    var local = 888;
1176 1177 1178
    deopt = true;
    try {
      counter++;
1179
      local += 4 + invertFunctionCall(increaseAndReturn15);
1180 1181 1182 1183 1184 1185 1186 1187
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1188
  resetOptAndAssertResultEquals(893, f);
1189 1190
  assertEquals(5, counter);

1191
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1192 1193
  //   doCatch, catchThrows]

1194 1195
  f = function f___3__t__lc__t_____ () {
    var local = 888;
1196 1197 1198
    deopt = false;
    try {
      counter++;
1199
      local += 4 + invertFunctionCall(increaseAndReturn15);
1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1211
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1212 1213
  //   doCatch, catchThrows, deopt]

1214 1215
  f = function f___3__t__lc__t____d () {
    var local = 888;
1216 1217 1218
    deopt = true;
    try {
      counter++;
1219
      local += 4 + invertFunctionCall(increaseAndReturn15);
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1231
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1232 1233
  //   doCatch, catchThrows, endReturnLocal]

1234 1235
  f = function f___3__t__lc__t___l_ () {
    var local = 888;
1236 1237 1238
    deopt = false;
    try {
      counter++;
1239
      local += 4 + invertFunctionCall(increaseAndReturn15);
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1252
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1253 1254
  //   doCatch, catchThrows, endReturnLocal, deopt]

1255 1256
  f = function f___3__t__lc__t___ld () {
    var local = 888;
1257 1258 1259
    deopt = true;
    try {
      counter++;
1260
      local += 4 + invertFunctionCall(increaseAndReturn15);
1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1273
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1274 1275
  //   doCatch, catchWithLocal]

1276 1277
  f = function f___3__t__lc_l______ () {
    var local = 888;
1278 1279 1280
    deopt = false;
    try {
      counter++;
1281
      local += 4 + invertFunctionCall(increaseAndReturn15);
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1293
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1294 1295
  //   doCatch, catchWithLocal, deopt]

1296 1297
  f = function f___3__t__lc_l_____d () {
    var local = 888;
1298 1299 1300
    deopt = true;
    try {
      counter++;
1301
      local += 4 + invertFunctionCall(increaseAndReturn15);
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1313
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1314 1315
  //   doCatch, catchWithLocal, endReturnLocal]

1316 1317
  f = function f___3__t__lc_l____l_ () {
    var local = 888;
1318 1319 1320
    deopt = false;
    try {
      counter++;
1321
      local += 4 + invertFunctionCall(increaseAndReturn15);
1322 1323 1324 1325 1326 1327 1328 1329 1330
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1331
  resetOptAndAssertResultEquals(935, f);
1332 1333
  assertEquals(5, counter);

1334
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1335 1336
  //   doCatch, catchWithLocal, endReturnLocal, deopt]

1337 1338
  f = function f___3__t__lc_l____ld () {
    var local = 888;
1339 1340 1341
    deopt = true;
    try {
      counter++;
1342
      local += 4 + invertFunctionCall(increaseAndReturn15);
1343 1344 1345 1346 1347 1348 1349 1350 1351
      counter++;
    } catch (ex) {
      counter++;
      local += ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1352
  resetOptAndAssertResultEquals(935, f);
1353 1354
  assertEquals(5, counter);

1355
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1356 1357
  //   doCatch, catchWithLocal, catchThrows]

1358 1359
  f = function f___3__t__lc_lt_____ () {
    var local = 888;
1360 1361 1362
    deopt = false;
    try {
      counter++;
1363
      local += 4 + invertFunctionCall(increaseAndReturn15);
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1375
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1376 1377
  //   doCatch, catchWithLocal, catchThrows, deopt]

1378 1379
  f = function f___3__t__lc_lt____d () {
    var local = 888;
1380 1381 1382
    deopt = true;
    try {
      counter++;
1383
      local += 4 + invertFunctionCall(increaseAndReturn15);
1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1395
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1396 1397
  //   doCatch, catchWithLocal, catchThrows, endReturnLocal]

1398 1399
  f = function f___3__t__lc_lt___l_ () {
    var local = 888;
1400 1401 1402
    deopt = false;
    try {
      counter++;
1403
      local += 4 + invertFunctionCall(increaseAndReturn15);
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1416
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1417 1418
  //   doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt]

1419 1420
  f = function f___3__t__lc_lt___ld () {
    var local = 888;
1421 1422 1423
    deopt = true;
    try {
      counter++;
1424
      local += 4 + invertFunctionCall(increaseAndReturn15);
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1437
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1438 1439
  //   doCatch, catchReturns]

1440 1441
  f = function f___3__t__lcr_______ () {
    var local = 888;
1442 1443 1444
    deopt = false;
    try {
      counter++;
1445
      local += 4 + invertFunctionCall(increaseAndReturn15);
1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1457
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1458 1459
  //   doCatch, catchReturns, deopt]

1460 1461
  f = function f___3__t__lcr______d () {
    var local = 888;
1462 1463 1464
    deopt = true;
    try {
      counter++;
1465
      local += 4 + invertFunctionCall(increaseAndReturn15);
1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1477
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1478 1479
  //   doCatch, catchReturns, endReturnLocal]

1480 1481
  f = function f___3__t__lcr_____l_ () {
    var local = 888;
1482 1483 1484
    deopt = false;
    try {
      counter++;
1485
      local += 4 + invertFunctionCall(increaseAndReturn15);
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1498
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1499 1500
  //   doCatch, catchReturns, endReturnLocal, deopt]

1501 1502
  f = function f___3__t__lcr_____ld () {
    var local = 888;
1503 1504 1505
    deopt = true;
    try {
      counter++;
1506
      local += 4 + invertFunctionCall(increaseAndReturn15);
1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
    return 5 + local;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1519
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1520 1521
  //   doCatch, catchReturns, catchWithLocal]

1522 1523
  f = function f___3__t__lcrl______ () {
    var local = 888;
1524 1525 1526
    deopt = false;
    try {
      counter++;
1527
      local += 4 + invertFunctionCall(increaseAndReturn15);
1528 1529 1530 1531 1532 1533 1534 1535
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
1536
  resetOptAndAssertResultEquals(890, f);
1537 1538
  assertEquals(3, counter);

1539
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1540 1541
  //   doCatch, catchReturns, catchWithLocal, deopt]

1542 1543
  f = function f___3__t__lcrl_____d () {
    var local = 888;
1544 1545 1546
    deopt = true;
    try {
      counter++;
1547
      local += 4 + invertFunctionCall(increaseAndReturn15);
1548 1549 1550 1551 1552 1553 1554 1555
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
  }
1556
  resetOptAndAssertResultEquals(890, f);
1557 1558
  assertEquals(3, counter);

1559
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1560 1561
  //   doCatch, catchReturns, catchWithLocal, endReturnLocal]

1562 1563
  f = function f___3__t__lcrl____l_ () {
    var local = 888;
1564 1565 1566
    deopt = false;
    try {
      counter++;
1567
      local += 4 + invertFunctionCall(increaseAndReturn15);
1568 1569 1570 1571 1572 1573 1574 1575 1576
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1577
  resetOptAndAssertResultEquals(890, f);
1578 1579
  assertEquals(3, counter);

1580
  // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
1581 1582
  //   doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt]

1583 1584
  f = function f___3__t__lcrl____ld () {
    var local = 888;
1585 1586 1587
    deopt = true;
    try {
      counter++;
1588
      local += 4 + invertFunctionCall(increaseAndReturn15);
1589 1590 1591 1592 1593 1594 1595 1596 1597
      counter++;
    } catch (ex) {
      counter++;
      return 2 + local;
      counter++;
    }
    counter++;
    return 5 + local;
  }
1598
  resetOptAndAssertResultEquals(890, f);
1599 1600
  assertEquals(3, counter);

1601
  // Variant flags: [alternativeFn4, tryReturns, doCatch]
1602

1603 1604
  f = function f__4____r__c________ () {
    var local = 888;
1605 1606 1607
    deopt = false;
    try {
      counter++;
1608
      return 4 + (new increaseAndStore15Constructor()).x;
1609 1610 1611 1612 1613 1614 1615
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
1616
  resetOptAndAssertResultEquals(19, f);
1617 1618
  assertEquals(2, counter);

1619
  // Variant flags: [alternativeFn4, tryReturns, doCatch, deopt]
1620

1621 1622
  f = function f__4____r__c_______d () {
    var local = 888;
1623 1624 1625
    deopt = true;
    try {
      counter++;
1626
      return 4 + (new increaseAndStore15Constructor()).x;
1627 1628 1629 1630 1631 1632 1633
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
1634
  resetOptAndAssertResultEquals(19, f);
1635 1636
  assertEquals(2, counter);

1637
  // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows]
1638

1639 1640
  f = function f__4____r__c__t_____ () {
    var local = 888;
1641 1642 1643
    deopt = false;
    try {
      counter++;
1644
      return 4 + (new increaseAndStore15Constructor()).x;
1645 1646 1647 1648 1649 1650 1651 1652
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
1653
  resetOptAndAssertResultEquals(19, f);
1654 1655
  assertEquals(2, counter);

1656
  // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows,
1657 1658
  //   deopt]

1659 1660
  f = function f__4____r__c__t____d () {
    var local = 888;
1661 1662 1663
    deopt = true;
    try {
      counter++;
1664
      return 4 + (new increaseAndStore15Constructor()).x;
1665 1666 1667 1668 1669 1670 1671 1672
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
1673
  resetOptAndAssertResultEquals(19, f);
1674 1675
  assertEquals(2, counter);

1676
  // Variant flags: [alternativeFn4, tryReturns, doCatch,
1677 1678
  //   catchReturns]

1679 1680
  f = function f__4____r__cr_______ () {
    var local = 888;
1681 1682 1683
    deopt = false;
    try {
      counter++;
1684
      return 4 + (new increaseAndStore15Constructor()).x;
1685 1686 1687 1688 1689 1690 1691 1692
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
1693
  resetOptAndAssertResultEquals(19, f);
1694 1695
  assertEquals(2, counter);

1696
  // Variant flags: [alternativeFn4, tryReturns, doCatch,
1697 1698
  //   catchReturns, deopt]

1699 1700
  f = function f__4____r__cr______d () {
    var local = 888;
1701 1702 1703
    deopt = true;
    try {
      counter++;
1704
      return 4 + (new increaseAndStore15Constructor()).x;
1705 1706 1707 1708 1709 1710 1711 1712
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
1713
  resetOptAndAssertResultEquals(19, f);
1714 1715
  assertEquals(2, counter);

1716
  // Variant flags: [alternativeFn4, tryThrows, doCatch]
1717

1718 1719
  f = function f__4___t___c________ () {
    var local = 888;
1720 1721 1722
    deopt = false;
    try {
      counter++;
1723
      return 4 + (new increaseAndThrow42Constructor()).x;
1724 1725 1726 1727 1728 1729 1730 1731 1732 1733
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1734
  // Variant flags: [alternativeFn4, tryThrows, doCatch, deopt]
1735

1736 1737
  f = function f__4___t___c_______d () {
    var local = 888;
1738 1739 1740
    deopt = true;
    try {
      counter++;
1741
      return 4 + (new increaseAndThrow42Constructor()).x;
1742 1743 1744 1745 1746 1747 1748 1749 1750 1751
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1752
  // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows]
1753

1754 1755
  f = function f__4___t___c__t_____ () {
    var local = 888;
1756 1757 1758
    deopt = false;
    try {
      counter++;
1759
      return 4 + (new increaseAndThrow42Constructor()).x;
1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1771
  // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows,
1772 1773
  //   deopt]

1774 1775
  f = function f__4___t___c__t____d () {
    var local = 888;
1776 1777 1778
    deopt = true;
    try {
      counter++;
1779
      return 4 + (new increaseAndThrow42Constructor()).x;
1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

1791
  // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns]
1792

1793 1794
  f = function f__4___t___cr_______ () {
    var local = 888;
1795 1796 1797
    deopt = false;
    try {
      counter++;
1798
      return 4 + (new increaseAndThrow42Constructor()).x;
1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1810
  // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns,
1811 1812
  //   deopt]

1813 1814
  f = function f__4___t___cr______d () {
    var local = 888;
1815 1816 1817
    deopt = true;
    try {
      counter++;
1818
      return 4 + (new increaseAndThrow42Constructor()).x;
1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

1830
  // Variant flags: [alternativeFn5, tryReturns, doCatch]
1831

1832 1833
  f = function f_5_____r__c________ () {
    var local = 888;
1834 1835 1836
    deopt = false;
    try {
      counter++;
1837
      return 4 + magic.prop /* returns 15 */;
1838 1839 1840 1841 1842 1843 1844
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
1845
  resetOptAndAssertResultEquals(19, f);
1846 1847
  assertEquals(2, counter);

1848
  // Variant flags: [alternativeFn5, tryReturns, doCatch, deopt]
1849

1850 1851
  f = function f_5_____r__c_______d () {
    var local = 888;
1852 1853 1854
    deopt = true;
    try {
      counter++;
1855
      return 4 + magic.prop /* returns 15 */;
1856 1857 1858 1859 1860 1861 1862
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
1863
  resetOptAndAssertResultEquals(19, f);
1864 1865
  assertEquals(2, counter);

1866
  // Variant flags: [alternativeFn5, tryReturns, doCatch, catchThrows]
1867

1868 1869
  f = function f_5_____r__c__t_____ () {
    var local = 888;
1870 1871 1872
    deopt = false;
    try {
      counter++;
1873
      return 4 + magic.prop /* returns 15 */;
1874 1875 1876 1877 1878 1879 1880 1881
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
1882
  resetOptAndAssertResultEquals(19, f);
1883 1884
  assertEquals(2, counter);

1885
  // Variant flags: [alternativeFn5, tryReturns, doCatch, catchThrows,
1886 1887
  //   deopt]

1888 1889
  f = function f_5_____r__c__t____d () {
    var local = 888;
1890 1891 1892
    deopt = true;
    try {
      counter++;
1893
      return 4 + magic.prop /* returns 15 */;
1894 1895 1896 1897 1898 1899 1900 1901
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
1902
  resetOptAndAssertResultEquals(19, f);
1903 1904
  assertEquals(2, counter);

1905
  // Variant flags: [alternativeFn5, tryReturns, doCatch,
1906 1907
  //   catchReturns]

1908 1909
  f = function f_5_____r__cr_______ () {
    var local = 888;
1910 1911 1912
    deopt = false;
    try {
      counter++;
1913
      return 4 + magic.prop /* returns 15 */;
1914 1915 1916 1917 1918 1919 1920 1921
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
1922
  resetOptAndAssertResultEquals(19, f);
1923 1924
  assertEquals(2, counter);

1925
  // Variant flags: [alternativeFn5, tryReturns, doCatch,
1926 1927
  //   catchReturns, deopt]

1928 1929
  f = function f_5_____r__cr______d () {
    var local = 888;
1930 1931 1932
    deopt = true;
    try {
      counter++;
1933
      return 4 + magic.prop /* returns 15 */;
1934 1935 1936 1937 1938 1939 1940 1941
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
1942
  resetOptAndAssertResultEquals(19, f);
1943 1944
  assertEquals(2, counter);

1945
  // Variant flags: [alternativeFn5, tryThrows, doCatch]
1946

1947 1948
  f = function f_5____t___c________ () {
    var local = 888;
1949 1950 1951
    deopt = false;
    try {
      counter++;
1952
      return 4 + (magic.prop = 37 /* throws 42 */);
1953 1954 1955 1956 1957 1958 1959 1960 1961 1962
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1963
  // Variant flags: [alternativeFn5, tryThrows, doCatch, deopt]
1964

1965 1966
  f = function f_5____t___c_______d () {
    var local = 888;
1967 1968 1969
    deopt = true;
    try {
      counter++;
1970
      return 4 + (magic.prop = 37 /* throws 42 */);
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980
      counter++;
    } catch (ex) {
      counter++;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(undefined, f);
  assertEquals(5, counter);

1981
  // Variant flags: [alternativeFn5, tryThrows, doCatch, catchThrows]
1982

1983 1984
  f = function f_5____t___c__t_____ () {
    var local = 888;
1985 1986 1987
    deopt = false;
    try {
      counter++;
1988
      return 4 + (magic.prop = 37 /* throws 42 */);
1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

2000
  // Variant flags: [alternativeFn5, tryThrows, doCatch, catchThrows,
2001 2002
  //   deopt]

2003 2004
  f = function f_5____t___c__t____d () {
    var local = 888;
2005 2006 2007
    deopt = true;
    try {
      counter++;
2008
      return 4 + (magic.prop = 37 /* throws 42 */);
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
      counter++;
    } catch (ex) {
      counter++;
      throw 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertThrowsWith(44, f);
  assertEquals(3, counter);

2020
  // Variant flags: [alternativeFn5, tryThrows, doCatch, catchReturns]
2021

2022 2023
  f = function f_5____t___cr_______ () {
    var local = 888;
2024 2025 2026
    deopt = false;
    try {
      counter++;
2027
      return 4 + (magic.prop = 37 /* throws 42 */);
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

2039
  // Variant flags: [alternativeFn5, tryThrows, doCatch, catchReturns,
2040 2041
  //   deopt]

2042 2043
  f = function f_5____t___cr______d () {
    var local = 888;
2044 2045 2046
    deopt = true;
    try {
      counter++;
2047
      return 4 + (magic.prop = 37 /* throws 42 */);
2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061
      counter++;
    } catch (ex) {
      counter++;
      return 2 + ex;
      counter++;
    }
    counter++;
  }
  resetOptAndAssertResultEquals(44, f);
  assertEquals(3, counter);

}
%NeverOptimizeFunction(runThisShard);

2062 2063
// 95 tests in this shard.
// 192 tests up to here.
2064 2065

runThisShard();