Index: test/mjsunit/compiler/inline-exception-1.js |
diff --git a/test/mjsunit/compiler/inline-exception-1.js b/test/mjsunit/compiler/inline-exception-1.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b67107b6cb5c8c48465eee91e94c8bc425549bc9 |
--- /dev/null |
+++ b/test/mjsunit/compiler/inline-exception-1.js |
@@ -0,0 +1,2121 @@ |
+// Shard 1. |
+ |
+// 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. |
+ |
+// Flags: --allow-natives-syntax --turbo --no-always-opt |
+ |
+// 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) { |
+ 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) { |
+ 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; |
+} |
+ |
+function returnOrThrow(doReturn) { |
+ if (doReturn) { |
+ return increaseAndReturn15(); |
+ } else { |
+ return increaseAndThrow42(); |
+ } |
+} |
+ |
+// 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; |
+} |
+ |
+function increaseAndStore15Constructor() { |
+ if (deopt) %DeoptimizeFunction(f); |
+ ++counter; |
+ this.x = 15; |
+} |
+ |
+function increaseAndThrow42Constructor() { |
+ if (deopt) %DeoptimizeFunction(f); |
+ ++counter; |
+ this.x = 42; |
+ throw this.x; |
+} |
+ |
+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. |
+ |
+assertEquals(15, (new increaseAndStore15Constructor()).x); |
+assertThrowsEquals(function() { |
+ return (new increaseAndThrow42Constructor()).x; |
+ }, |
+ 42); |
+ |
+function runThisShard() { |
+ |
+ // Variant flags: [tryReturns, doFinally] |
+ |
+ f = function f______r______f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryReturns, doFinally, finallyThrows] |
+ |
+ f = function f______r______f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doFinally, finallyReturns] |
+ |
+ f = function f______r______fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch] |
+ |
+ f = function f______r__c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, deopt] |
+ |
+ f = function f______r__c_______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, doFinally] |
+ |
+ f = function f______r__c___f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, doFinally, finallyThrows] |
+ |
+ f = function f______r__c___f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, doFinally, finallyReturns] |
+ |
+ f = function f______r__c___fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchThrows] |
+ |
+ f = function f______r__c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchThrows, deopt] |
+ |
+ f = function f______r__c__t____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchThrows, doFinally] |
+ |
+ f = function f______r__c__tf____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchThrows, doFinally, |
+ // finallyThrows] |
+ |
+ f = function f______r__c__tf_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchThrows, doFinally, |
+ // finallyReturns] |
+ |
+ f = function f______r__c__tfr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchReturns] |
+ |
+ f = function f______r__cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchReturns, deopt] |
+ |
+ f = function f______r__cr______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchReturns, doFinally] |
+ |
+ f = function f______r__cr__f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchReturns, doFinally, |
+ // finallyThrows] |
+ |
+ f = function f______r__cr__f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryReturns, doCatch, catchReturns, doFinally, |
+ // finallyReturns] |
+ |
+ f = function f______r__cr__fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doFinally] |
+ |
+ f = function f_____t_______f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(42, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, doFinally, finallyThrows] |
+ |
+ f = function f_____t_______f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doFinally, finallyReturns] |
+ |
+ f = function f_____t_______fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch] |
+ |
+ f = function f_____t___c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, deopt] |
+ |
+ f = function f_____t___c_______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, doFinally] |
+ |
+ f = function f_____t___c___f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(7, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, doFinally, finallyThrows] |
+ |
+ f = function f_____t___c___f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, doFinally, finallyReturns] |
+ |
+ f = function f_____t___c___fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchThrows] |
+ |
+ f = function f_____t___c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchThrows, deopt] |
+ |
+ f = function f_____t___c__t____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchThrows, doFinally] |
+ |
+ f = function f_____t___c__tf____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchThrows, doFinally, |
+ // finallyThrows] |
+ |
+ f = function f_____t___c__tf_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchThrows, doFinally, |
+ // finallyReturns] |
+ |
+ f = function f_____t___c__tfr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchReturns] |
+ |
+ f = function f_____t___cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchReturns, deopt] |
+ |
+ f = function f_____t___cr______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchReturns, doFinally] |
+ |
+ f = function f_____t___cr__f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchReturns, doFinally, |
+ // finallyThrows] |
+ |
+ f = function f_____t___cr__f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, doCatch, catchReturns, doFinally, |
+ // finallyReturns] |
+ |
+ f = function f_____t___cr__fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doFinally] |
+ |
+ f = function f_____tr______f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(42, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doFinally, finallyThrows] |
+ |
+ f = function f_____tr______f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doFinally, finallyReturns] |
+ |
+ f = function f_____tr______fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch] |
+ |
+ f = function f_____tr__c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, doFinally] |
+ |
+ f = function f_____tr__c___f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(7, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, doFinally, |
+ // finallyThrows] |
+ |
+ f = function f_____tr__c___f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, doFinally, |
+ // finallyReturns] |
+ |
+ f = function f_____tr__c___fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows] |
+ |
+ f = function f_____tr__c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, |
+ // doFinally] |
+ |
+ f = function f_____tr__c__tf____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, |
+ // doFinally, finallyThrows] |
+ |
+ f = function f_____tr__c__tf_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, |
+ // doFinally, finallyReturns] |
+ |
+ f = function f_____tr__c__tfr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns] |
+ |
+ f = function f_____tr__cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, |
+ // doFinally] |
+ |
+ f = function f_____tr__cr__f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, |
+ // doFinally, finallyThrows] |
+ |
+ f = function f_____tr__cr__f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, |
+ // doFinally, finallyReturns] |
+ |
+ f = function f_____tr__cr__fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndThrow42(); |
+ return increaseAndReturn15(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, |
+ // doFinally] |
+ |
+ f = function f_____trf_____f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, |
+ // doFinally, finallyThrows] |
+ |
+ f = function f_____trf_____f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, |
+ // doFinally, finallyReturns] |
+ |
+ f = function f_____trf_____fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch] |
+ |
+ f = function f_____trf_c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // doFinally] |
+ |
+ f = function f_____trf_c___f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // doFinally, finallyThrows] |
+ |
+ f = function f_____trf_c___f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // doFinally, finallyReturns] |
+ |
+ f = function f_____trf_c___fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchThrows] |
+ |
+ f = function f_____trf_c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchThrows, doFinally] |
+ |
+ f = function f_____trf_c__tf____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchThrows, doFinally, finallyThrows] |
+ |
+ f = function f_____trf_c__tf_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchThrows, doFinally, finallyReturns] |
+ |
+ f = function f_____trf_c__tfr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchReturns] |
+ |
+ f = function f_____trf_cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchReturns, doFinally] |
+ |
+ f = function f_____trf_cr__f____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ local += 2; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(4, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchReturns, doFinally, finallyThrows] |
+ |
+ f = function f_____trf_cr__f_t__ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ throw 25; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(25, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, |
+ // catchReturns, doFinally, finallyReturns] |
+ |
+ f = function f_____trf_cr__fr___ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return increaseAndReturn15(); |
+ return increaseAndThrow42(); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } finally { |
+ counter++; |
+ return 3 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(6, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch] |
+ |
+ f = function f____1_r__c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch, deopt] |
+ |
+ f = function f____1_r__c_______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows] |
+ |
+ f = function f____1_r__c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows, |
+ // deopt] |
+ |
+ f = function f____1_r__c__t____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch, |
+ // catchReturns] |
+ |
+ f = function f____1_r__cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryReturns, doCatch, |
+ // catchReturns, deopt] |
+ |
+ f = function f____1_r__cr______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(true); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch] |
+ |
+ f = function f____1t___c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch, deopt] |
+ |
+ f = function f____1t___c_______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(undefined, f); |
+ assertEquals(5, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows] |
+ |
+ f = function f____1t___c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows, |
+ // deopt] |
+ |
+ f = function f____1t___c__t____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertThrowsWith(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns] |
+ |
+ f = function f____1t___cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns, |
+ // deopt] |
+ |
+ f = function f____1t___cr______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return returnOrThrow(false); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(44, f); |
+ assertEquals(3, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch] |
+ |
+ f = function f___2__r__c________ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, deopt] |
+ |
+ f = function f___2__r__c_______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, catchThrows] |
+ |
+ f = function f___2__r__c__t_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, catchThrows, |
+ // deopt] |
+ |
+ f = function f___2__r__c__t____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal] |
+ |
+ f = function f___2__r__c_l______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ local += ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, deopt] |
+ |
+ f = function f___2__r__c_l_____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ local += ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, endReturnLocal] |
+ |
+ f = function f___2__r__c_l____l_ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ local += ex; |
+ counter++; |
+ } |
+ counter++; |
+ return 5 + local; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, endReturnLocal, deopt] |
+ |
+ f = function f___2__r__c_l____ld () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ local += ex; |
+ counter++; |
+ } |
+ counter++; |
+ return 5 + local; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, catchThrows] |
+ |
+ f = function f___2__r__c_lt_____ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, catchThrows, deopt] |
+ |
+ f = function f___2__r__c_lt____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, catchThrows, endReturnLocal] |
+ |
+ f = function f___2__r__c_lt___l_ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ return 5 + local; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchWithLocal, catchThrows, endReturnLocal, deopt] |
+ |
+ f = function f___2__r__c_lt___ld () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ throw 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ return 5 + local; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchReturns] |
+ |
+ f = function f___2__r__cr_______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchReturns, deopt] |
+ |
+ f = function f___2__r__cr______d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + ex; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchReturns, catchWithLocal] |
+ |
+ f = function f___2__r__crl______ () { |
+ var local = 3; |
+ deopt = false; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+ // Variant flags: [alternativeFn2, tryReturns, doCatch, |
+ // catchReturns, catchWithLocal, deopt] |
+ |
+ f = function f___2__r__crl_____d () { |
+ var local = 3; |
+ deopt = true; |
+ try { |
+ counter++; |
+ return invertFunctionCall(increaseAndThrow42); |
+ counter++; |
+ } catch (ex) { |
+ counter++; |
+ return 2 + local; |
+ counter++; |
+ } |
+ counter++; |
+ } |
+ resetOptAndAssertResultEquals(15, f); |
+ assertEquals(2, counter); |
+ |
+} |
+%NeverOptimizeFunction(runThisShard); |
+ |
+// 94 tests in this shard. |
+// 94 tests up to here. |
+ |
+runThisShard(); |