Commit d90d76bd authored by bgeron's avatar bgeron Committed by Commit bot

[turbofan] Improve inline-exception tests.

- Make constants more interesting.
- Add an addition to be done after the inlined call in the try-block.
- On command line, have a bit more output.
- New alternative that deopts from unoptimized code.

BUG=
R=jarin

Review-Url: https://codereview.chromium.org/2285743002
Cr-Commit-Position: refs/heads/master@{#38974}
parent 529f4c87
...@@ -66,6 +66,24 @@ function increaseAndThrow42() { ...@@ -66,6 +66,24 @@ function increaseAndThrow42() {
throw 42; throw 42;
} }
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
function returnOrThrow(doReturn) { function returnOrThrow(doReturn) {
if (doReturn) { if (doReturn) {
return increaseAndReturn15(); return increaseAndReturn15();
...@@ -74,6 +92,17 @@ function returnOrThrow(doReturn) { ...@@ -74,6 +92,17 @@ function returnOrThrow(doReturn) {
} }
} }
// Alternative 2
function increaseAndReturn15_calls_noopt() {
return increaseAndReturn15_noopt_inner();
}
function increaseAndThrow42_calls_noopt() {
return increaseAndThrow42_noopt_inner();
}
// Alternative 3.
// When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts // When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts
// as the other one. // as the other one.
function invertFunctionCall(f) { function invertFunctionCall(f) {
...@@ -86,6 +115,7 @@ function invertFunctionCall(f) { ...@@ -86,6 +115,7 @@ function invertFunctionCall(f) {
throw result + 27; throw result + 27;
} }
// Alternative 4: constructor
function increaseAndStore15Constructor() { function increaseAndStore15Constructor() {
if (deopt) %DeoptimizeFunction(f); if (deopt) %DeoptimizeFunction(f);
++counter; ++counter;
...@@ -99,6 +129,7 @@ function increaseAndThrow42Constructor() { ...@@ -99,6 +129,7 @@ function increaseAndThrow42Constructor() {
throw this.x; throw this.x;
} }
// Alternative 5: property
var magic = {}; var magic = {};
Object.defineProperty(magic, 'prop', { Object.defineProperty(magic, 'prop', {
get: function () { get: function () {
...@@ -116,6 +147,9 @@ Object.defineProperty(magic, 'prop', { ...@@ -116,6 +147,9 @@ Object.defineProperty(magic, 'prop', {
// Generate type feedback. // Generate type feedback.
assertEquals(15, increaseAndReturn15_calls_noopt());
assertThrowsEquals(function() { return increaseAndThrow42_noopt_inner() }, 42);
assertEquals(15, (new increaseAndStore15Constructor()).x); assertEquals(15, (new increaseAndStore15Constructor()).x);
assertThrowsEquals(function() { assertThrowsEquals(function() {
return (new increaseAndThrow42Constructor()).x; return (new increaseAndThrow42Constructor()).x;
...@@ -126,12 +160,12 @@ function runThisShard() { ...@@ -126,12 +160,12 @@ function runThisShard() {
// Variant flags: [tryReturns, doFinally] // Variant flags: [tryReturns, doFinally]
f = function f______r______f____ () { f = function f_______r______f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -140,17 +174,17 @@ function runThisShard() { ...@@ -140,17 +174,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryReturns, doFinally, finallyThrows] // Variant flags: [tryReturns, doFinally, finallyThrows]
f = function f______r______f_t__ () { f = function f_______r______f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -164,12 +198,12 @@ function runThisShard() { ...@@ -164,12 +198,12 @@ function runThisShard() {
// Variant flags: [tryReturns, doFinally, finallyReturns] // Variant flags: [tryReturns, doFinally, finallyReturns]
f = function f______r______fr___ () { f = function f_______r______fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -178,17 +212,17 @@ function runThisShard() { ...@@ -178,17 +212,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryReturns, doCatch] // Variant flags: [tryReturns, doCatch]
f = function f______r__c________ () { f = function f_______r__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -196,17 +230,17 @@ function runThisShard() { ...@@ -196,17 +230,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, deopt] // Variant flags: [tryReturns, doCatch, deopt]
f = function f______r__c_______d () { f = function f_______r__c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -214,17 +248,17 @@ function runThisShard() { ...@@ -214,17 +248,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, doFinally] // Variant flags: [tryReturns, doCatch, doFinally]
f = function f______r__c___f____ () { f = function f_______r__c___f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -236,17 +270,17 @@ function runThisShard() { ...@@ -236,17 +270,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryReturns, doCatch, doFinally, finallyThrows] // Variant flags: [tryReturns, doCatch, doFinally, finallyThrows]
f = function f______r__c___f_t__ () { f = function f_______r__c___f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -263,12 +297,12 @@ function runThisShard() { ...@@ -263,12 +297,12 @@ function runThisShard() {
// Variant flags: [tryReturns, doCatch, doFinally, finallyReturns] // Variant flags: [tryReturns, doCatch, doFinally, finallyReturns]
f = function f______r__c___fr___ () { f = function f_______r__c___fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -280,17 +314,17 @@ function runThisShard() { ...@@ -280,17 +314,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryReturns, doCatch, catchThrows] // Variant flags: [tryReturns, doCatch, catchThrows]
f = function f______r__c__t_____ () { f = function f_______r__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -299,17 +333,17 @@ function runThisShard() { ...@@ -299,17 +333,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, catchThrows, deopt] // Variant flags: [tryReturns, doCatch, catchThrows, deopt]
f = function f______r__c__t____d () { f = function f_______r__c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -318,17 +352,17 @@ function runThisShard() { ...@@ -318,17 +352,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally] // Variant flags: [tryReturns, doCatch, catchThrows, doFinally]
f = function f______r__c__tf____ () { f = function f_______r__c__tf____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -341,18 +375,18 @@ function runThisShard() { ...@@ -341,18 +375,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally, // Variant flags: [tryReturns, doCatch, catchThrows, doFinally,
// finallyThrows] // finallyThrows]
f = function f______r__c__tf_t__ () { f = function f_______r__c__tf_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -371,12 +405,12 @@ function runThisShard() { ...@@ -371,12 +405,12 @@ function runThisShard() {
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally, // Variant flags: [tryReturns, doCatch, catchThrows, doFinally,
// finallyReturns] // finallyReturns]
f = function f______r__c__tfr___ () { f = function f_______r__c__tfr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -389,17 +423,17 @@ function runThisShard() { ...@@ -389,17 +423,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryReturns, doCatch, catchReturns] // Variant flags: [tryReturns, doCatch, catchReturns]
f = function f______r__cr_______ () { f = function f_______r__cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -408,17 +442,17 @@ function runThisShard() { ...@@ -408,17 +442,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, catchReturns, deopt] // Variant flags: [tryReturns, doCatch, catchReturns, deopt]
f = function f______r__cr______d () { f = function f_______r__cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -427,17 +461,17 @@ function runThisShard() { ...@@ -427,17 +461,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally] // Variant flags: [tryReturns, doCatch, catchReturns, doFinally]
f = function f______r__cr__f____ () { f = function f_______r__cr__f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -450,18 +484,18 @@ function runThisShard() { ...@@ -450,18 +484,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally, // Variant flags: [tryReturns, doCatch, catchReturns, doFinally,
// finallyThrows] // finallyThrows]
f = function f______r__cr__f_t__ () { f = function f_______r__cr__f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -480,12 +514,12 @@ function runThisShard() { ...@@ -480,12 +514,12 @@ function runThisShard() {
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally, // Variant flags: [tryReturns, doCatch, catchReturns, doFinally,
// finallyReturns] // finallyReturns]
f = function f______r__cr__fr___ () { f = function f_______r__cr__fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -498,17 +532,17 @@ function runThisShard() { ...@@ -498,17 +532,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, doFinally] // Variant flags: [tryThrows, doFinally]
f = function f_____t_______f____ () { f = function f______t_______f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -522,12 +556,12 @@ function runThisShard() { ...@@ -522,12 +556,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doFinally, finallyThrows] // Variant flags: [tryThrows, doFinally, finallyThrows]
f = function f_____t_______f_t__ () { f = function f______t_______f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -541,12 +575,12 @@ function runThisShard() { ...@@ -541,12 +575,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doFinally, finallyReturns] // Variant flags: [tryThrows, doFinally, finallyReturns]
f = function f_____t_______fr___ () { f = function f______t_______fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -555,17 +589,17 @@ function runThisShard() { ...@@ -555,17 +589,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, doCatch] // Variant flags: [tryThrows, doCatch]
f = function f_____t___c________ () { f = function f______t___c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -578,12 +612,12 @@ function runThisShard() { ...@@ -578,12 +612,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, deopt] // Variant flags: [tryThrows, doCatch, deopt]
f = function f_____t___c_______d () { f = function f______t___c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -596,12 +630,12 @@ function runThisShard() { ...@@ -596,12 +630,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, doFinally] // Variant flags: [tryThrows, doCatch, doFinally]
f = function f_____t___c___f____ () { f = function f______t___c___f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -618,12 +652,12 @@ function runThisShard() { ...@@ -618,12 +652,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, doFinally, finallyThrows] // Variant flags: [tryThrows, doCatch, doFinally, finallyThrows]
f = function f_____t___c___f_t__ () { f = function f______t___c___f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -640,12 +674,12 @@ function runThisShard() { ...@@ -640,12 +674,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, doFinally, finallyReturns] // Variant flags: [tryThrows, doCatch, doFinally, finallyReturns]
f = function f_____t___c___fr___ () { f = function f______t___c___fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -657,17 +691,17 @@ function runThisShard() { ...@@ -657,17 +691,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [tryThrows, doCatch, catchThrows] // Variant flags: [tryThrows, doCatch, catchThrows]
f = function f_____t___c__t_____ () { f = function f______t___c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -681,12 +715,12 @@ function runThisShard() { ...@@ -681,12 +715,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchThrows, deopt] // Variant flags: [tryThrows, doCatch, catchThrows, deopt]
f = function f_____t___c__t____d () { f = function f______t___c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -700,12 +734,12 @@ function runThisShard() { ...@@ -700,12 +734,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally] // Variant flags: [tryThrows, doCatch, catchThrows, doFinally]
f = function f_____t___c__tf____ () { f = function f______t___c__tf____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -724,12 +758,12 @@ function runThisShard() { ...@@ -724,12 +758,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally, // Variant flags: [tryThrows, doCatch, catchThrows, doFinally,
// finallyThrows] // finallyThrows]
f = function f_____t___c__tf_t__ () { f = function f______t___c__tf_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -748,12 +782,12 @@ function runThisShard() { ...@@ -748,12 +782,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally, // Variant flags: [tryThrows, doCatch, catchThrows, doFinally,
// finallyReturns] // finallyReturns]
f = function f_____t___c__tfr___ () { f = function f______t___c__tfr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -766,17 +800,17 @@ function runThisShard() { ...@@ -766,17 +800,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, doCatch, catchReturns] // Variant flags: [tryThrows, doCatch, catchReturns]
f = function f_____t___cr_______ () { f = function f______t___cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -790,12 +824,12 @@ function runThisShard() { ...@@ -790,12 +824,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchReturns, deopt] // Variant flags: [tryThrows, doCatch, catchReturns, deopt]
f = function f_____t___cr______d () { f = function f______t___cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -809,12 +843,12 @@ function runThisShard() { ...@@ -809,12 +843,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally] // Variant flags: [tryThrows, doCatch, catchReturns, doFinally]
f = function f_____t___cr__f____ () { f = function f______t___cr__f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -833,12 +867,12 @@ function runThisShard() { ...@@ -833,12 +867,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally, // Variant flags: [tryThrows, doCatch, catchReturns, doFinally,
// finallyThrows] // finallyThrows]
f = function f_____t___cr__f_t__ () { f = function f______t___cr__f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -857,12 +891,12 @@ function runThisShard() { ...@@ -857,12 +891,12 @@ function runThisShard() {
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally, // Variant flags: [tryThrows, doCatch, catchReturns, doFinally,
// finallyReturns] // finallyReturns]
f = function f_____t___cr__fr___ () { f = function f______t___cr__fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -875,18 +909,18 @@ function runThisShard() { ...@@ -875,18 +909,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, doFinally] // Variant flags: [tryThrows, tryReturns, doFinally]
f = function f_____tr______f____ () { f = function f______tr______f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -900,13 +934,13 @@ function runThisShard() { ...@@ -900,13 +934,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doFinally, finallyThrows] // Variant flags: [tryThrows, tryReturns, doFinally, finallyThrows]
f = function f_____tr______f_t__ () { f = function f______tr______f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -920,13 +954,13 @@ function runThisShard() { ...@@ -920,13 +954,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doFinally, finallyReturns] // Variant flags: [tryThrows, tryReturns, doFinally, finallyReturns]
f = function f_____tr______fr___ () { f = function f______tr______fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -935,18 +969,18 @@ function runThisShard() { ...@@ -935,18 +969,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, tryReturns, doCatch] // Variant flags: [tryThrows, tryReturns, doCatch]
f = function f_____tr__c________ () { f = function f______tr__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -959,13 +993,13 @@ function runThisShard() { ...@@ -959,13 +993,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally] // Variant flags: [tryThrows, tryReturns, doCatch, doFinally]
f = function f_____tr__c___f____ () { f = function f______tr__c___f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -983,13 +1017,13 @@ function runThisShard() { ...@@ -983,13 +1017,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally, // Variant flags: [tryThrows, tryReturns, doCatch, doFinally,
// finallyThrows] // finallyThrows]
f = function f_____tr__c___f_t__ () { f = function f______tr__c___f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1007,13 +1041,13 @@ function runThisShard() { ...@@ -1007,13 +1041,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally, // Variant flags: [tryThrows, tryReturns, doCatch, doFinally,
// finallyReturns] // finallyReturns]
f = function f_____tr__c___fr___ () { f = function f______tr__c___fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1025,18 +1059,18 @@ function runThisShard() { ...@@ -1025,18 +1059,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows] // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows]
f = function f_____tr__c__t_____ () { f = function f______tr__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1051,13 +1085,13 @@ function runThisShard() { ...@@ -1051,13 +1085,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
// doFinally] // doFinally]
f = function f_____tr__c__tf____ () { f = function f______tr__c__tf____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1076,13 +1110,13 @@ function runThisShard() { ...@@ -1076,13 +1110,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
// doFinally, finallyThrows] // doFinally, finallyThrows]
f = function f_____tr__c__tf_t__ () { f = function f______tr__c__tf_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1101,13 +1135,13 @@ function runThisShard() { ...@@ -1101,13 +1135,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows, // Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
// doFinally, finallyReturns] // doFinally, finallyReturns]
f = function f_____tr__c__tfr___ () { f = function f______tr__c__tfr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1120,18 +1154,18 @@ function runThisShard() { ...@@ -1120,18 +1154,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns] // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns]
f = function f_____tr__cr_______ () { f = function f______tr__cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1146,13 +1180,13 @@ function runThisShard() { ...@@ -1146,13 +1180,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
// doFinally] // doFinally]
f = function f_____tr__cr__f____ () { f = function f______tr__cr__f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1171,13 +1205,13 @@ function runThisShard() { ...@@ -1171,13 +1205,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
// doFinally, finallyThrows] // doFinally, finallyThrows]
f = function f_____tr__cr__f_t__ () { f = function f______tr__cr__f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1196,13 +1230,13 @@ function runThisShard() { ...@@ -1196,13 +1230,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns, // Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
// doFinally, finallyReturns] // doFinally, finallyReturns]
f = function f_____tr__cr__fr___ () { f = function f______tr__cr__fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndThrow42(); return 4 + increaseAndThrow42();
return increaseAndReturn15(); return 4 + increaseAndReturn15();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1215,19 +1249,19 @@ function runThisShard() { ...@@ -1215,19 +1249,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, // Variant flags: [tryThrows, tryReturns, tryFirstReturns,
// doFinally] // doFinally]
f = function f_____trf_____f____ () { f = function f______trf_____f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -1236,19 +1270,19 @@ function runThisShard() { ...@@ -1236,19 +1270,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, // Variant flags: [tryThrows, tryReturns, tryFirstReturns,
// doFinally, finallyThrows] // doFinally, finallyThrows]
f = function f_____trf_____f_t__ () { f = function f______trf_____f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -1263,13 +1297,13 @@ function runThisShard() { ...@@ -1263,13 +1297,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, // Variant flags: [tryThrows, tryReturns, tryFirstReturns,
// doFinally, finallyReturns] // doFinally, finallyReturns]
f = function f_____trf_____fr___ () { f = function f______trf_____fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} finally { } finally {
counter++; counter++;
...@@ -1278,18 +1312,18 @@ function runThisShard() { ...@@ -1278,18 +1312,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch] // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch]
f = function f_____trf_c________ () { f = function f______trf_c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1297,19 +1331,19 @@ function runThisShard() { ...@@ -1297,19 +1331,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// doFinally] // doFinally]
f = function f_____trf_c___f____ () { f = function f______trf_c___f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1321,19 +1355,19 @@ function runThisShard() { ...@@ -1321,19 +1355,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// doFinally, finallyThrows] // doFinally, finallyThrows]
f = function f_____trf_c___f_t__ () { f = function f______trf_c___f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1351,13 +1385,13 @@ function runThisShard() { ...@@ -1351,13 +1385,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// doFinally, finallyReturns] // doFinally, finallyReturns]
f = function f_____trf_c___fr___ () { f = function f______trf_c___fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1369,19 +1403,19 @@ function runThisShard() { ...@@ -1369,19 +1403,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchThrows] // catchThrows]
f = function f_____trf_c__t_____ () { f = function f______trf_c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1390,19 +1424,19 @@ function runThisShard() { ...@@ -1390,19 +1424,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchThrows, doFinally] // catchThrows, doFinally]
f = function f_____trf_c__tf____ () { f = function f______trf_c__tf____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1415,19 +1449,19 @@ function runThisShard() { ...@@ -1415,19 +1449,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchThrows, doFinally, finallyThrows] // catchThrows, doFinally, finallyThrows]
f = function f_____trf_c__tf_t__ () { f = function f______trf_c__tf_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1446,13 +1480,13 @@ function runThisShard() { ...@@ -1446,13 +1480,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchThrows, doFinally, finallyReturns] // catchThrows, doFinally, finallyReturns]
f = function f_____trf_c__tfr___ () { f = function f______trf_c__tfr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1465,19 +1499,19 @@ function runThisShard() { ...@@ -1465,19 +1499,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchReturns] // catchReturns]
f = function f_____trf_cr_______ () { f = function f______trf_cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1486,19 +1520,19 @@ function runThisShard() { ...@@ -1486,19 +1520,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchReturns, doFinally] // catchReturns, doFinally]
f = function f_____trf_cr__f____ () { f = function f______trf_cr__f____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1511,19 +1545,19 @@ function runThisShard() { ...@@ -1511,19 +1545,19 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchReturns, doFinally, finallyThrows] // catchReturns, doFinally, finallyThrows]
f = function f_____trf_cr__f_t__ () { f = function f______trf_cr__f_t__ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1542,13 +1576,13 @@ function runThisShard() { ...@@ -1542,13 +1576,13 @@ function runThisShard() {
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch, // Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
// catchReturns, doFinally, finallyReturns] // catchReturns, doFinally, finallyReturns]
f = function f_____trf_cr__fr___ () { f = function f______trf_cr__fr___ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return increaseAndReturn15(); return 4 + increaseAndReturn15();
return increaseAndThrow42(); return 4 + increaseAndThrow42();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1561,17 +1595,17 @@ function runThisShard() { ...@@ -1561,17 +1595,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(6, f); resetOptAndAssertResultEquals(891, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch] // Variant flags: [alternativeFn1, tryReturns, doCatch]
f = function f____1_r__c________ () { f = function f_____1_r__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1579,17 +1613,17 @@ function runThisShard() { ...@@ -1579,17 +1613,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch, deopt] // Variant flags: [alternativeFn1, tryReturns, doCatch, deopt]
f = function f____1_r__c_______d () { f = function f_____1_r__c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1597,17 +1631,17 @@ function runThisShard() { ...@@ -1597,17 +1631,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows] // Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows]
f = function f____1_r__c__t_____ () { f = function f_____1_r__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1616,18 +1650,18 @@ function runThisShard() { ...@@ -1616,18 +1650,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows, // Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows,
// deopt] // deopt]
f = function f____1_r__c__t____d () { f = function f_____1_r__c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1636,18 +1670,18 @@ function runThisShard() { ...@@ -1636,18 +1670,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch, // Variant flags: [alternativeFn1, tryReturns, doCatch,
// catchReturns] // catchReturns]
f = function f____1_r__cr_______ () { f = function f_____1_r__cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1656,18 +1690,18 @@ function runThisShard() { ...@@ -1656,18 +1690,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryReturns, doCatch, // Variant flags: [alternativeFn1, tryReturns, doCatch,
// catchReturns, deopt] // catchReturns, deopt]
f = function f____1_r__cr______d () { f = function f_____1_r__cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(true); return 4 + returnOrThrow(true);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1676,17 +1710,17 @@ function runThisShard() { ...@@ -1676,17 +1710,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn1, tryThrows, doCatch] // Variant flags: [alternativeFn1, tryThrows, doCatch]
f = function f____1t___c________ () { f = function f_____1t___c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1699,12 +1733,12 @@ function runThisShard() { ...@@ -1699,12 +1733,12 @@ function runThisShard() {
// Variant flags: [alternativeFn1, tryThrows, doCatch, deopt] // Variant flags: [alternativeFn1, tryThrows, doCatch, deopt]
f = function f____1t___c_______d () { f = function f_____1t___c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1717,12 +1751,12 @@ function runThisShard() { ...@@ -1717,12 +1751,12 @@ function runThisShard() {
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows] // Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows]
f = function f____1t___c__t_____ () { f = function f_____1t___c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1737,12 +1771,12 @@ function runThisShard() { ...@@ -1737,12 +1771,12 @@ function runThisShard() {
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows, // Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows,
// deopt] // deopt]
f = function f____1t___c__t____d () { f = function f_____1t___c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1756,12 +1790,12 @@ function runThisShard() { ...@@ -1756,12 +1790,12 @@ function runThisShard() {
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns] // Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns]
f = function f____1t___cr_______ () { f = function f_____1t___cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1776,12 +1810,12 @@ function runThisShard() { ...@@ -1776,12 +1810,12 @@ function runThisShard() {
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns,
// deopt] // deopt]
f = function f____1t___cr______d () { f = function f_____1t___cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return returnOrThrow(false); return 4 + returnOrThrow(false);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1793,110 +1827,118 @@ function runThisShard() { ...@@ -1793,110 +1827,118 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch] // Variant flags: [alternativeFn2, tryReturns, doCatch,
// catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c________ () { f = function f____2__r__c_l____ld () {
var local = 3; var local = 888;
deopt = false; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + increaseAndReturn15_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, deopt] // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal,
// doCatch, endReturnLocal, deopt]
f = function f___2__r__c_______d () { f = function f____2__r_lc______ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); local += 4 + increaseAndReturn15_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(912, f);
assertEquals(2, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, catchThrows] // Variant flags: [alternativeFn2, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c__t_____ () { f = function f____2__r_lc_l____ld () {
var local = 3; var local = 888;
deopt = false; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); local += 4 + increaseAndReturn15_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
throw 2 + ex; local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(912, f);
assertEquals(2, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, catchThrows, // Variant flags: [alternativeFn2, tryThrows, doCatch,
// deopt] // catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c__t____d () { f = function f____2_t___c_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + increaseAndThrow42_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
throw 2 + ex; local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(935, f);
assertEquals(2, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal,
// catchWithLocal] // doCatch, endReturnLocal, deopt]
f = function f___2__r__c_l______ () { f = function f____2_t__lc______ld () {
var local = 3; var local = 888;
deopt = false; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); local += 4 + increaseAndThrow42_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(893, f);
assertEquals(2, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn2, tryThrows, tryResultToLocal,
// catchWithLocal, deopt] // doCatch, catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c_l_____d () { f = function f____2_t__lc_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); local += 4 + increaseAndThrow42_calls_noopt();
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1904,61 +1946,55 @@ function runThisShard() { ...@@ -1904,61 +1946,55 @@ function runThisShard() {
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(935, f);
assertEquals(2, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch]
// catchWithLocal, endReturnLocal]
f = function f___2__r__c_l____l_ () { f = function f___3___r__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch, deopt]
// catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c_l____ld () { f = function f___3___r__c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows]
// catchWithLocal, catchThrows]
f = function f___2__r__c_lt_____ () { f = function f___3___r__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1967,18 +2003,18 @@ function runThisShard() { ...@@ -1967,18 +2003,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows,
// catchWithLocal, catchThrows, deopt] // deopt]
f = function f___2__r__c_lt____d () { f = function f___3___r__c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1987,135 +2023,197 @@ function runThisShard() { ...@@ -1987,135 +2023,197 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchWithLocal, catchThrows, endReturnLocal] // catchWithLocal]
f = function f___2__r__c_lt___l_ () { f = function f___3___r__c_l______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
throw 2 + ex; local += ex;
counter++;
}
counter++;
}
resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchWithLocal, deopt]
f = function f___3___r__c_l_____d () {
var local = 888;
deopt = true;
try {
counter++;
return 4 + invertFunctionCall(increaseAndThrow42);
counter++;
} catch (ex) {
counter++;
local += ex;
counter++;
}
counter++;
}
resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchWithLocal, endReturnLocal]
f = function f___3___r__c_l____l_ () {
var local = 888;
deopt = false;
try {
counter++;
return 4 + invertFunctionCall(increaseAndThrow42);
counter++;
} catch (ex) {
counter++;
local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchWithLocal, catchThrows, endReturnLocal, deopt] // catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__c_lt___ld () { f = function f___3___r__c_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
throw 2 + ex; local += ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns] // catchWithLocal, catchThrows]
f = function f___2__r__cr_______ () { f = function f___3___r__c_lt_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
return 2 + ex; throw 2 + ex;
counter++; counter++;
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns, deopt] // catchWithLocal, catchThrows, deopt]
f = function f___2__r__cr______d () { f = function f___3___r__c_lt____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
return 2 + ex; throw 2 + ex;
counter++; counter++;
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns, catchWithLocal] // catchWithLocal, catchThrows, endReturnLocal]
f = function f___2__r__crl______ () { f = function f___3___r__c_lt___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
return 2 + local; throw 2 + ex;
counter++; counter++;
} }
counter++; counter++;
return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns, catchWithLocal, deopt] // catchWithLocal, catchThrows, endReturnLocal, deopt]
f = function f___2__r__crl_____d () { f = function f___3___r__c_lt___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
return 2 + local; throw 2 + ex;
counter++;
}
counter++;
return 5 + local;
}
resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns]
f = function f___3___r__cr_______ () {
var local = 888;
deopt = false;
try {
counter++;
return 4 + invertFunctionCall(increaseAndThrow42);
counter++;
} catch (ex) {
counter++;
return 2 + ex;
counter++; counter++;
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
} }
%NeverOptimizeFunction(runThisShard); %NeverOptimizeFunction(runThisShard);
// 94 tests in this shard. // 97 tests in this shard.
// 94 tests up to here. // 97 tests up to here.
runThisShard(); runThisShard();
...@@ -66,6 +66,24 @@ function increaseAndThrow42() { ...@@ -66,6 +66,24 @@ function increaseAndThrow42() {
throw 42; throw 42;
} }
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
function returnOrThrow(doReturn) { function returnOrThrow(doReturn) {
if (doReturn) { if (doReturn) {
return increaseAndReturn15(); return increaseAndReturn15();
...@@ -74,6 +92,17 @@ function returnOrThrow(doReturn) { ...@@ -74,6 +92,17 @@ function returnOrThrow(doReturn) {
} }
} }
// Alternative 2
function increaseAndReturn15_calls_noopt() {
return increaseAndReturn15_noopt_inner();
}
function increaseAndThrow42_calls_noopt() {
return increaseAndThrow42_noopt_inner();
}
// Alternative 3.
// When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts // When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts
// as the other one. // as the other one.
function invertFunctionCall(f) { function invertFunctionCall(f) {
...@@ -86,6 +115,7 @@ function invertFunctionCall(f) { ...@@ -86,6 +115,7 @@ function invertFunctionCall(f) {
throw result + 27; throw result + 27;
} }
// Alternative 4: constructor
function increaseAndStore15Constructor() { function increaseAndStore15Constructor() {
if (deopt) %DeoptimizeFunction(f); if (deopt) %DeoptimizeFunction(f);
++counter; ++counter;
...@@ -99,6 +129,7 @@ function increaseAndThrow42Constructor() { ...@@ -99,6 +129,7 @@ function increaseAndThrow42Constructor() {
throw this.x; throw this.x;
} }
// Alternative 5: property
var magic = {}; var magic = {};
Object.defineProperty(magic, 'prop', { Object.defineProperty(magic, 'prop', {
get: function () { get: function () {
...@@ -116,6 +147,9 @@ Object.defineProperty(magic, 'prop', { ...@@ -116,6 +147,9 @@ Object.defineProperty(magic, 'prop', {
// Generate type feedback. // Generate type feedback.
assertEquals(15, increaseAndReturn15_calls_noopt());
assertThrowsEquals(function() { return increaseAndThrow42_noopt_inner() }, 42);
assertEquals(15, (new increaseAndStore15Constructor()).x); assertEquals(15, (new increaseAndStore15Constructor()).x);
assertThrowsEquals(function() { assertThrowsEquals(function() {
return (new increaseAndThrow42Constructor()).x; return (new increaseAndThrow42Constructor()).x;
...@@ -124,15 +158,75 @@ assertThrowsEquals(function() { ...@@ -124,15 +158,75 @@ assertThrowsEquals(function() {
function runThisShard() { function runThisShard() {
// Variant flags: [alternativeFn2, tryReturns, doCatch, // 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,
// catchReturns, catchWithLocal, endReturnLocal] // catchReturns, catchWithLocal, endReturnLocal]
f = function f___2__r__crl____l_ () { f = function f___3___r__crl____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -142,18 +236,18 @@ function runThisShard() { ...@@ -142,18 +236,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, doCatch, // Variant flags: [alternativeFn3, tryReturns, doCatch,
// catchReturns, catchWithLocal, endReturnLocal, deopt] // catchReturns, catchWithLocal, endReturnLocal, deopt]
f = function f___2__r__crl____ld () { f = function f___3___r__crl____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndThrow42); return 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -163,18 +257,18 @@ function runThisShard() { ...@@ -163,18 +257,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch] // doCatch]
f = function f___2__r_lc________ () { f = function f___3___r_lc________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -185,15 +279,15 @@ function runThisShard() { ...@@ -185,15 +279,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, deopt] // doCatch, deopt]
f = function f___2__r_lc_______d () { f = function f___3___r_lc_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -204,15 +298,15 @@ function runThisShard() { ...@@ -204,15 +298,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, endReturnLocal] // doCatch, endReturnLocal]
f = function f___2__r_lc______l_ () { f = function f___3___r_lc______l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -221,18 +315,18 @@ function runThisShard() { ...@@ -221,18 +315,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, endReturnLocal, deopt] // doCatch, endReturnLocal, deopt]
f = function f___2__r_lc______ld () { f = function f___3___r_lc______ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -241,18 +335,18 @@ function runThisShard() { ...@@ -241,18 +335,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchThrows] // doCatch, catchThrows]
f = function f___2__r_lc__t_____ () { f = function f___3___r_lc__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -264,15 +358,15 @@ function runThisShard() { ...@@ -264,15 +358,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchThrows, deopt] // doCatch, catchThrows, deopt]
f = function f___2__r_lc__t____d () { f = function f___3___r_lc__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -284,15 +378,15 @@ function runThisShard() { ...@@ -284,15 +378,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchThrows, endReturnLocal] // doCatch, catchThrows, endReturnLocal]
f = function f___2__r_lc__t___l_ () { f = function f___3___r_lc__t___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -302,18 +396,18 @@ function runThisShard() { ...@@ -302,18 +396,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchThrows, endReturnLocal, deopt] // doCatch, catchThrows, endReturnLocal, deopt]
f = function f___2__r_lc__t___ld () { f = function f___3___r_lc__t___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -323,18 +417,18 @@ function runThisShard() { ...@@ -323,18 +417,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal] // doCatch, catchWithLocal]
f = function f___2__r_lc_l______ () { f = function f___3___r_lc_l______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -346,15 +440,15 @@ function runThisShard() { ...@@ -346,15 +440,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, deopt] // doCatch, catchWithLocal, deopt]
f = function f___2__r_lc_l_____d () { f = function f___3___r_lc_l_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -366,15 +460,15 @@ function runThisShard() { ...@@ -366,15 +460,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, endReturnLocal] // doCatch, catchWithLocal, endReturnLocal]
f = function f___2__r_lc_l____l_ () { f = function f___3___r_lc_l____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -384,18 +478,18 @@ function runThisShard() { ...@@ -384,18 +478,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, endReturnLocal, deopt] // doCatch, catchWithLocal, endReturnLocal, deopt]
f = function f___2__r_lc_l____ld () { f = function f___3___r_lc_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -405,18 +499,18 @@ function runThisShard() { ...@@ -405,18 +499,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows] // doCatch, catchWithLocal, catchThrows]
f = function f___2__r_lc_lt_____ () { f = function f___3___r_lc_lt_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -428,15 +522,15 @@ function runThisShard() { ...@@ -428,15 +522,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, deopt] // doCatch, catchWithLocal, catchThrows, deopt]
f = function f___2__r_lc_lt____d () { f = function f___3___r_lc_lt____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -448,15 +542,15 @@ function runThisShard() { ...@@ -448,15 +542,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, endReturnLocal] // doCatch, catchWithLocal, catchThrows, endReturnLocal]
f = function f___2__r_lc_lt___l_ () { f = function f___3___r_lc_lt___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -466,18 +560,18 @@ function runThisShard() { ...@@ -466,18 +560,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt] // doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt]
f = function f___2__r_lc_lt___ld () { f = function f___3___r_lc_lt___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -487,18 +581,18 @@ function runThisShard() { ...@@ -487,18 +581,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns] // doCatch, catchReturns]
f = function f___2__r_lcr_______ () { f = function f___3___r_lcr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -510,15 +604,15 @@ function runThisShard() { ...@@ -510,15 +604,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, deopt] // doCatch, catchReturns, deopt]
f = function f___2__r_lcr______d () { f = function f___3___r_lcr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -530,15 +624,15 @@ function runThisShard() { ...@@ -530,15 +624,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, endReturnLocal] // doCatch, catchReturns, endReturnLocal]
f = function f___2__r_lcr_____l_ () { f = function f___3___r_lcr_____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -548,18 +642,18 @@ function runThisShard() { ...@@ -548,18 +642,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, endReturnLocal, deopt] // doCatch, catchReturns, endReturnLocal, deopt]
f = function f___2__r_lcr_____ld () { f = function f___3___r_lcr_____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -569,18 +663,18 @@ function runThisShard() { ...@@ -569,18 +663,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal] // doCatch, catchReturns, catchWithLocal]
f = function f___2__r_lcrl______ () { f = function f___3___r_lcrl______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -592,15 +686,15 @@ function runThisShard() { ...@@ -592,15 +686,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, deopt] // doCatch, catchReturns, catchWithLocal, deopt]
f = function f___2__r_lcrl_____d () { f = function f___3___r_lcrl_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -612,15 +706,15 @@ function runThisShard() { ...@@ -612,15 +706,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, endReturnLocal] // doCatch, catchReturns, catchWithLocal, endReturnLocal]
f = function f___2__r_lcrl____l_ () { f = function f___3___r_lcrl____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -630,18 +724,18 @@ function runThisShard() { ...@@ -630,18 +724,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal, // Variant flags: [alternativeFn3, tryReturns, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt] // doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt]
f = function f___2__r_lcrl____ld () { f = function f___3___r_lcrl____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndThrow42); local += 4 + invertFunctionCall(increaseAndThrow42);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -651,17 +745,17 @@ function runThisShard() { ...@@ -651,17 +745,17 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(23, f); resetOptAndAssertResultEquals(912, f);
assertEquals(4, counter); assertEquals(4, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch] // Variant flags: [alternativeFn3, tryThrows, doCatch]
f = function f___2_t___c________ () { f = function f___3__t___c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -672,14 +766,14 @@ function runThisShard() { ...@@ -672,14 +766,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, deopt] // Variant flags: [alternativeFn3, tryThrows, doCatch, deopt]
f = function f___2_t___c_______d () { f = function f___3__t___c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -690,14 +784,14 @@ function runThisShard() { ...@@ -690,14 +784,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchThrows] // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows]
f = function f___2_t___c__t_____ () { f = function f___3__t___c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -709,15 +803,15 @@ function runThisShard() { ...@@ -709,15 +803,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchThrows, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows,
// deopt] // deopt]
f = function f___2_t___c__t____d () { f = function f___3__t___c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -729,15 +823,15 @@ function runThisShard() { ...@@ -729,15 +823,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal] // catchWithLocal]
f = function f___2_t___c_l______ () { f = function f___3__t___c_l______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -749,15 +843,15 @@ function runThisShard() { ...@@ -749,15 +843,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, deopt] // catchWithLocal, deopt]
f = function f___2_t___c_l_____d () { f = function f___3__t___c_l_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -769,15 +863,15 @@ function runThisShard() { ...@@ -769,15 +863,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, endReturnLocal] // catchWithLocal, endReturnLocal]
f = function f___2_t___c_l____l_ () { f = function f___3__t___c_l____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -787,18 +881,18 @@ function runThisShard() { ...@@ -787,18 +881,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(50, f); resetOptAndAssertResultEquals(935, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, endReturnLocal, deopt] // catchWithLocal, endReturnLocal, deopt]
f = function f___2_t___c_l____ld () { f = function f___3__t___c_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -808,18 +902,18 @@ function runThisShard() { ...@@ -808,18 +902,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(50, f); resetOptAndAssertResultEquals(935, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, catchThrows] // catchWithLocal, catchThrows]
f = function f___2_t___c_lt_____ () { f = function f___3__t___c_lt_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -831,15 +925,15 @@ function runThisShard() { ...@@ -831,15 +925,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, catchThrows, deopt] // catchWithLocal, catchThrows, deopt]
f = function f___2_t___c_lt____d () { f = function f___3__t___c_lt____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -851,15 +945,15 @@ function runThisShard() { ...@@ -851,15 +945,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, catchThrows, endReturnLocal] // catchWithLocal, catchThrows, endReturnLocal]
f = function f___2_t___c_lt___l_ () { f = function f___3__t___c_lt___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -872,15 +966,15 @@ function runThisShard() { ...@@ -872,15 +966,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, // Variant flags: [alternativeFn3, tryThrows, doCatch,
// catchWithLocal, catchThrows, endReturnLocal, deopt] // catchWithLocal, catchThrows, endReturnLocal, deopt]
f = function f___2_t___c_lt___ld () { f = function f___3__t___c_lt___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -893,14 +987,14 @@ function runThisShard() { ...@@ -893,14 +987,14 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns] // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns]
f = function f___2_t___cr_______ () { f = function f___3__t___cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -912,15 +1006,15 @@ function runThisShard() { ...@@ -912,15 +1006,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
// deopt] // deopt]
f = function f___2_t___cr______d () { f = function f___3__t___cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -932,15 +1026,15 @@ function runThisShard() { ...@@ -932,15 +1026,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
// catchWithLocal] // catchWithLocal]
f = function f___2_t___crl______ () { f = function f___3__t___crl______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -949,18 +1043,18 @@ function runThisShard() { ...@@ -949,18 +1043,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
// catchWithLocal, deopt] // catchWithLocal, deopt]
f = function f___2_t___crl_____d () { f = function f___3__t___crl_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -969,18 +1063,18 @@ function runThisShard() { ...@@ -969,18 +1063,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
// catchWithLocal, endReturnLocal] // catchWithLocal, endReturnLocal]
f = function f___2_t___crl____l_ () { f = function f___3__t___crl____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -990,18 +1084,18 @@ function runThisShard() { ...@@ -990,18 +1084,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns,
// catchWithLocal, endReturnLocal, deopt] // catchWithLocal, endReturnLocal, deopt]
f = function f___2_t___crl____ld () { f = function f___3__t___crl____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return invertFunctionCall(increaseAndReturn15); return 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1011,18 +1105,18 @@ function runThisShard() { ...@@ -1011,18 +1105,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch] // doCatch]
f = function f___2_t__lc________ () { f = function f___3__t__lc________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1033,15 +1127,15 @@ function runThisShard() { ...@@ -1033,15 +1127,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, deopt] // doCatch, deopt]
f = function f___2_t__lc_______d () { f = function f___3__t__lc_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1052,15 +1146,15 @@ function runThisShard() { ...@@ -1052,15 +1146,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, endReturnLocal] // doCatch, endReturnLocal]
f = function f___2_t__lc______l_ () { f = function f___3__t__lc______l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1069,18 +1163,18 @@ function runThisShard() { ...@@ -1069,18 +1163,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(8, f); resetOptAndAssertResultEquals(893, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, endReturnLocal, deopt] // doCatch, endReturnLocal, deopt]
f = function f___2_t__lc______ld () { f = function f___3__t__lc______ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1089,18 +1183,18 @@ function runThisShard() { ...@@ -1089,18 +1183,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(8, f); resetOptAndAssertResultEquals(893, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchThrows] // doCatch, catchThrows]
f = function f___2_t__lc__t_____ () { f = function f___3__t__lc__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1112,15 +1206,15 @@ function runThisShard() { ...@@ -1112,15 +1206,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchThrows, deopt] // doCatch, catchThrows, deopt]
f = function f___2_t__lc__t____d () { f = function f___3__t__lc__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1132,15 +1226,15 @@ function runThisShard() { ...@@ -1132,15 +1226,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchThrows, endReturnLocal] // doCatch, catchThrows, endReturnLocal]
f = function f___2_t__lc__t___l_ () { f = function f___3__t__lc__t___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1153,15 +1247,15 @@ function runThisShard() { ...@@ -1153,15 +1247,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchThrows, endReturnLocal, deopt] // doCatch, catchThrows, endReturnLocal, deopt]
f = function f___2_t__lc__t___ld () { f = function f___3__t__lc__t___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1174,15 +1268,15 @@ function runThisShard() { ...@@ -1174,15 +1268,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal] // doCatch, catchWithLocal]
f = function f___2_t__lc_l______ () { f = function f___3__t__lc_l______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1194,15 +1288,15 @@ function runThisShard() { ...@@ -1194,15 +1288,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, deopt] // doCatch, catchWithLocal, deopt]
f = function f___2_t__lc_l_____d () { f = function f___3__t__lc_l_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1214,15 +1308,15 @@ function runThisShard() { ...@@ -1214,15 +1308,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, endReturnLocal] // doCatch, catchWithLocal, endReturnLocal]
f = function f___2_t__lc_l____l_ () { f = function f___3__t__lc_l____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1232,18 +1326,18 @@ function runThisShard() { ...@@ -1232,18 +1326,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(50, f); resetOptAndAssertResultEquals(935, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, endReturnLocal, deopt] // doCatch, catchWithLocal, endReturnLocal, deopt]
f = function f___2_t__lc_l____ld () { f = function f___3__t__lc_l____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1253,18 +1347,18 @@ function runThisShard() { ...@@ -1253,18 +1347,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(50, f); resetOptAndAssertResultEquals(935, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows] // doCatch, catchWithLocal, catchThrows]
f = function f___2_t__lc_lt_____ () { f = function f___3__t__lc_lt_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1276,15 +1370,15 @@ function runThisShard() { ...@@ -1276,15 +1370,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, deopt] // doCatch, catchWithLocal, catchThrows, deopt]
f = function f___2_t__lc_lt____d () { f = function f___3__t__lc_lt____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1296,15 +1390,15 @@ function runThisShard() { ...@@ -1296,15 +1390,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, endReturnLocal] // doCatch, catchWithLocal, catchThrows, endReturnLocal]
f = function f___2_t__lc_lt___l_ () { f = function f___3__t__lc_lt___l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1317,15 +1411,15 @@ function runThisShard() { ...@@ -1317,15 +1411,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt] // doCatch, catchWithLocal, catchThrows, endReturnLocal, deopt]
f = function f___2_t__lc_lt___ld () { f = function f___3__t__lc_lt___ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1338,15 +1432,15 @@ function runThisShard() { ...@@ -1338,15 +1432,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns] // doCatch, catchReturns]
f = function f___2_t__lcr_______ () { f = function f___3__t__lcr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1358,15 +1452,15 @@ function runThisShard() { ...@@ -1358,15 +1452,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, deopt] // doCatch, catchReturns, deopt]
f = function f___2_t__lcr______d () { f = function f___3__t__lcr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1378,15 +1472,15 @@ function runThisShard() { ...@@ -1378,15 +1472,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, endReturnLocal] // doCatch, catchReturns, endReturnLocal]
f = function f___2_t__lcr_____l_ () { f = function f___3__t__lcr_____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1399,15 +1493,15 @@ function runThisShard() { ...@@ -1399,15 +1493,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, endReturnLocal, deopt] // doCatch, catchReturns, endReturnLocal, deopt]
f = function f___2_t__lcr_____ld () { f = function f___3__t__lcr_____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1420,15 +1514,15 @@ function runThisShard() { ...@@ -1420,15 +1514,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal] // doCatch, catchReturns, catchWithLocal]
f = function f___2_t__lcrl______ () { f = function f___3__t__lcrl______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1437,18 +1531,18 @@ function runThisShard() { ...@@ -1437,18 +1531,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, deopt] // doCatch, catchReturns, catchWithLocal, deopt]
f = function f___2_t__lcrl_____d () { f = function f___3__t__lcrl_____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1457,18 +1551,18 @@ function runThisShard() { ...@@ -1457,18 +1551,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, endReturnLocal] // doCatch, catchReturns, catchWithLocal, endReturnLocal]
f = function f___2_t__lcrl____l_ () { f = function f___3__t__lcrl____l_ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1478,18 +1572,18 @@ function runThisShard() { ...@@ -1478,18 +1572,18 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal, // Variant flags: [alternativeFn3, tryThrows, tryResultToLocal,
// doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt] // doCatch, catchReturns, catchWithLocal, endReturnLocal, deopt]
f = function f___2_t__lcrl____ld () { f = function f___3__t__lcrl____ld () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
local += invertFunctionCall(increaseAndReturn15); local += 4 + invertFunctionCall(increaseAndReturn15);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1499,17 +1593,17 @@ function runThisShard() { ...@@ -1499,17 +1593,17 @@ function runThisShard() {
counter++; counter++;
return 5 + local; return 5 + local;
} }
resetOptAndAssertResultEquals(5, f); resetOptAndAssertResultEquals(890, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch] // Variant flags: [alternativeFn4, tryReturns, doCatch]
f = function f__3___r__c________ () { f = function f__4____r__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1517,17 +1611,17 @@ function runThisShard() { ...@@ -1517,17 +1611,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch, deopt] // Variant flags: [alternativeFn4, tryReturns, doCatch, deopt]
f = function f__3___r__c_______d () { f = function f__4____r__c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1535,17 +1629,17 @@ function runThisShard() { ...@@ -1535,17 +1629,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows] // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows]
f = function f__3___r__c__t_____ () { f = function f__4____r__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1554,18 +1648,18 @@ function runThisShard() { ...@@ -1554,18 +1648,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows, // Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows,
// deopt] // deopt]
f = function f__3___r__c__t____d () { f = function f__4____r__c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1574,18 +1668,18 @@ function runThisShard() { ...@@ -1574,18 +1668,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch, // Variant flags: [alternativeFn4, tryReturns, doCatch,
// catchReturns] // catchReturns]
f = function f__3___r__cr_______ () { f = function f__4____r__cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1594,18 +1688,18 @@ function runThisShard() { ...@@ -1594,18 +1688,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryReturns, doCatch, // Variant flags: [alternativeFn4, tryReturns, doCatch,
// catchReturns, deopt] // catchReturns, deopt]
f = function f__3___r__cr______d () { f = function f__4____r__cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndStore15Constructor()).x; return 4 + (new increaseAndStore15Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1614,17 +1708,17 @@ function runThisShard() { ...@@ -1614,17 +1708,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch] // Variant flags: [alternativeFn4, tryThrows, doCatch]
f = function f__3__t___c________ () { f = function f__4___t___c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1635,14 +1729,14 @@ function runThisShard() { ...@@ -1635,14 +1729,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch, deopt] // Variant flags: [alternativeFn4, tryThrows, doCatch, deopt]
f = function f__3__t___c_______d () { f = function f__4___t___c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1653,14 +1747,14 @@ function runThisShard() { ...@@ -1653,14 +1747,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows] // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows]
f = function f__3__t___c__t_____ () { f = function f__4___t___c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1672,15 +1766,15 @@ function runThisShard() { ...@@ -1672,15 +1766,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch, catchThrows, // Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows,
// deopt] // deopt]
f = function f__3__t___c__t____d () { f = function f__4___t___c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1692,14 +1786,14 @@ function runThisShard() { ...@@ -1692,14 +1786,14 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns] // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns]
f = function f__3__t___cr_______ () { f = function f__4___t___cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1711,15 +1805,15 @@ function runThisShard() { ...@@ -1711,15 +1805,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn3, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns,
// deopt] // deopt]
f = function f__3__t___cr______d () { f = function f__4___t___cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (new increaseAndThrow42Constructor()).x; return 4 + (new increaseAndThrow42Constructor()).x;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1731,14 +1825,14 @@ function runThisShard() { ...@@ -1731,14 +1825,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch] // Variant flags: [alternativeFn5, tryReturns, doCatch]
f = function f_4____r__c________ () { f = function f_5_____r__c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1746,17 +1840,17 @@ function runThisShard() { ...@@ -1746,17 +1840,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch, deopt] // Variant flags: [alternativeFn5, tryReturns, doCatch, deopt]
f = function f_4____r__c_______d () { f = function f_5_____r__c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1764,17 +1858,17 @@ function runThisShard() { ...@@ -1764,17 +1858,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows] // Variant flags: [alternativeFn5, tryReturns, doCatch, catchThrows]
f = function f_4____r__c__t_____ () { f = function f_5_____r__c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1783,18 +1877,18 @@ function runThisShard() { ...@@ -1783,18 +1877,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch, catchThrows, // Variant flags: [alternativeFn5, tryReturns, doCatch, catchThrows,
// deopt] // deopt]
f = function f_4____r__c__t____d () { f = function f_5_____r__c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1803,18 +1897,18 @@ function runThisShard() { ...@@ -1803,18 +1897,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch, // Variant flags: [alternativeFn5, tryReturns, doCatch,
// catchReturns] // catchReturns]
f = function f_4____r__cr_______ () { f = function f_5_____r__cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1823,18 +1917,18 @@ function runThisShard() { ...@@ -1823,18 +1917,18 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryReturns, doCatch, // Variant flags: [alternativeFn5, tryReturns, doCatch,
// catchReturns, deopt] // catchReturns, deopt]
f = function f_4____r__cr______d () { f = function f_5_____r__cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return magic.prop /* returns 15 */; return 4 + magic.prop /* returns 15 */;
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1843,17 +1937,17 @@ function runThisShard() { ...@@ -1843,17 +1937,17 @@ function runThisShard() {
} }
counter++; counter++;
} }
resetOptAndAssertResultEquals(15, f); resetOptAndAssertResultEquals(19, f);
assertEquals(2, counter); assertEquals(2, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch] // Variant flags: [alternativeFn5, tryThrows, doCatch]
f = function f_4___t___c________ () { f = function f_5____t___c________ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1864,14 +1958,14 @@ function runThisShard() { ...@@ -1864,14 +1958,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch, deopt] // Variant flags: [alternativeFn5, tryThrows, doCatch, deopt]
f = function f_4___t___c_______d () { f = function f_5____t___c_______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1882,14 +1976,14 @@ function runThisShard() { ...@@ -1882,14 +1976,14 @@ function runThisShard() {
resetOptAndAssertResultEquals(undefined, f); resetOptAndAssertResultEquals(undefined, f);
assertEquals(5, counter); assertEquals(5, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows] // Variant flags: [alternativeFn5, tryThrows, doCatch, catchThrows]
f = function f_4___t___c__t_____ () { f = function f_5____t___c__t_____ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1901,15 +1995,15 @@ function runThisShard() { ...@@ -1901,15 +1995,15 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch, catchThrows, // Variant flags: [alternativeFn5, tryThrows, doCatch, catchThrows,
// deopt] // deopt]
f = function f_4___t___c__t____d () { f = function f_5____t___c__t____d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1921,14 +2015,14 @@ function runThisShard() { ...@@ -1921,14 +2015,14 @@ function runThisShard() {
resetOptAndAssertThrowsWith(44, f); resetOptAndAssertThrowsWith(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns] // Variant flags: [alternativeFn5, tryThrows, doCatch, catchReturns]
f = function f_4___t___cr_______ () { f = function f_5____t___cr_______ () {
var local = 3; var local = 888;
deopt = false; deopt = false;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1940,15 +2034,15 @@ function runThisShard() { ...@@ -1940,15 +2034,15 @@ function runThisShard() {
resetOptAndAssertResultEquals(44, f); resetOptAndAssertResultEquals(44, f);
assertEquals(3, counter); assertEquals(3, counter);
// Variant flags: [alternativeFn4, tryThrows, doCatch, catchReturns, // Variant flags: [alternativeFn5, tryThrows, doCatch, catchReturns,
// deopt] // deopt]
f = function f_4___t___cr______d () { f = function f_5____t___cr______d () {
var local = 3; var local = 888;
deopt = true; deopt = true;
try { try {
counter++; counter++;
return (magic.prop = 37 /* throws 42 */); return 4 + (magic.prop = 37 /* throws 42 */);
counter++; counter++;
} catch (ex) { } catch (ex) {
counter++; counter++;
...@@ -1963,7 +2057,7 @@ function runThisShard() { ...@@ -1963,7 +2057,7 @@ function runThisShard() {
} }
%NeverOptimizeFunction(runThisShard); %NeverOptimizeFunction(runThisShard);
// 92 tests in this shard. // 95 tests in this shard.
// 186 tests up to here. // 192 tests up to here.
runThisShard(); runThisShard();
...@@ -11,7 +11,7 @@ import sys ...@@ -11,7 +11,7 @@ import sys
SHARD_FILENAME_TEMPLATE = "test/mjsunit/compiler/inline-exception-{shard}.js" SHARD_FILENAME_TEMPLATE = "test/mjsunit/compiler/inline-exception-{shard}.js"
# Generates 2 files. Found by trial and error. # Generates 2 files. Found by trial and error.
SHARD_SIZE = 94 SHARD_SIZE = 97
PREAMBLE = """ PREAMBLE = """
...@@ -81,6 +81,24 @@ function increaseAndThrow42() { ...@@ -81,6 +81,24 @@ function increaseAndThrow42() {
throw 42; throw 42;
} }
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
function returnOrThrow(doReturn) { function returnOrThrow(doReturn) {
if (doReturn) { if (doReturn) {
return increaseAndReturn15(); return increaseAndReturn15();
...@@ -89,6 +107,17 @@ function returnOrThrow(doReturn) { ...@@ -89,6 +107,17 @@ function returnOrThrow(doReturn) {
} }
} }
// Alternative 2
function increaseAndReturn15_calls_noopt() {
return increaseAndReturn15_noopt_inner();
}
function increaseAndThrow42_calls_noopt() {
return increaseAndThrow42_noopt_inner();
}
// Alternative 3.
// When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts // When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts
// as the other one. // as the other one.
function invertFunctionCall(f) { function invertFunctionCall(f) {
...@@ -101,6 +130,7 @@ function invertFunctionCall(f) { ...@@ -101,6 +130,7 @@ function invertFunctionCall(f) {
throw result + 27; throw result + 27;
} }
// Alternative 4: constructor
function increaseAndStore15Constructor() { function increaseAndStore15Constructor() {
if (deopt) %DeoptimizeFunction(f); if (deopt) %DeoptimizeFunction(f);
++counter; ++counter;
...@@ -114,6 +144,7 @@ function increaseAndThrow42Constructor() { ...@@ -114,6 +144,7 @@ function increaseAndThrow42Constructor() {
throw this.x; throw this.x;
} }
// Alternative 5: property
var magic = {}; var magic = {};
Object.defineProperty(magic, 'prop', { Object.defineProperty(magic, 'prop', {
get: function () { get: function () {
...@@ -131,6 +162,9 @@ Object.defineProperty(magic, 'prop', { ...@@ -131,6 +162,9 @@ Object.defineProperty(magic, 'prop', {
// Generate type feedback. // Generate type feedback.
assertEquals(15, increaseAndReturn15_calls_noopt());
assertThrowsEquals(function() { return increaseAndThrow42_noopt_inner() }, 42);
assertEquals(15, (new increaseAndStore15Constructor()).x); assertEquals(15, (new increaseAndStore15Constructor()).x);
assertThrowsEquals(function() { assertThrowsEquals(function() {
return (new increaseAndThrow42Constructor()).x; return (new increaseAndThrow42Constructor()).x;
...@@ -153,8 +187,6 @@ def booltuples(n): ...@@ -153,8 +187,6 @@ def booltuples(n):
yield initial + (False,) yield initial + (False,)
yield initial + (True,) yield initial + (True,)
FLAGLETTERS="4321trflcrltfrtld"
def fnname(flags): def fnname(flags):
assert len(FLAGLETTERS) == len(flags) assert len(FLAGLETTERS) == len(flags)
...@@ -175,10 +207,17 @@ def printtest(flags): ...@@ -175,10 +207,17 @@ def printtest(flags):
# tuples, ordered lexicographically from false to true, we get first the # tuples, ordered lexicographically from false to true, we get first the
# default, then alternative 1, then 2, etc. # default, then alternative 1, then 2, etc.
( (
alternativeFn4, # use alternative #4 for returning/throwing. alternativeFn5, # use alternative #5 for returning/throwing:
alternativeFn3, # use alternative #3 for returning/throwing. # return/throw using property
alternativeFn2, # use alternative #2 for returning/throwing. alternativeFn4, # use alternative #4 for returning/throwing:
alternativeFn1, # use alternative #1 for returning/throwing. # return/throw using constructor
alternativeFn3, # use alternative #3 for returning/throwing:
# return/throw indirectly, based on function argument
alternativeFn2, # use alternative #2 for returning/throwing:
# return/throw indirectly in unoptimized code,
# no branching
alternativeFn1, # use alternative #1 for returning/throwing:
# return/throw indirectly, based on boolean arg
tryThrows, # in try block, call throwing function tryThrows, # in try block, call throwing function
tryReturns, # in try block, call returning function tryReturns, # in try block, call returning function
tryFirstReturns, # in try block, returning goes before throwing tryFirstReturns, # in try block, returning goes before throwing
...@@ -197,7 +236,8 @@ def printtest(flags): ...@@ -197,7 +236,8 @@ def printtest(flags):
# BASIC RULES # BASIC RULES
# Only one alternative can be applied at any time. # Only one alternative can be applied at any time.
if alternativeFn1 + alternativeFn2 + alternativeFn3 + alternativeFn4 > 1: if (alternativeFn1 + alternativeFn2 + alternativeFn3 + alternativeFn4
+ alternativeFn5 > 1):
return return
# In try, return or throw, or both. # In try, return or throw, or both.
...@@ -228,8 +268,9 @@ def printtest(flags): ...@@ -228,8 +268,9 @@ def printtest(flags):
# PRUNING # PRUNING
anyAlternative = any([alternativeFn1, alternativeFn2, alternativeFn3, anyAlternative = any([alternativeFn1, alternativeFn2, alternativeFn3,
alternativeFn4]) alternativeFn4, alternativeFn5])
rareAlternative = any([alternativeFn1, alternativeFn3, alternativeFn4]) specificAlternative = any([alternativeFn2, alternativeFn3])
rareAlternative = not specificAlternative
# If try returns and throws, then don't catchWithLocal, endReturnLocal, or # If try returns and throws, then don't catchWithLocal, endReturnLocal, or
# deopt, or do any alternative. # deopt, or do any alternative.
...@@ -238,13 +279,18 @@ def printtest(flags): ...@@ -238,13 +279,18 @@ def printtest(flags):
return return
# We don't do any alternative if we do a finally. # We don't do any alternative if we do a finally.
if doFinally and anyAlternative: return if doFinally and anyAlternative: return
# We only use the local variable if we do alternative #2. # We only use the local variable if we do alternative #2 or #3.
if ((tryResultToLocal or catchWithLocal or endReturnLocal) and if ((tryResultToLocal or catchWithLocal or endReturnLocal) and
not alternativeFn2): not specificAlternative):
return return
# We don't need to test deopting into a finally. # We don't need to test deopting into a finally.
if doFinally and deopt: return if doFinally and deopt: return
# We're only interested in alternative #2 if we have endReturnLocal, no
# catchReturns, and no catchThrows, and deopt.
if (alternativeFn2 and
(not endReturnLocal or catchReturns or catchThrows or not deopt)):
return
# Flag check succeeded. # Flag check succeeded.
...@@ -265,17 +311,22 @@ def printtest(flags): ...@@ -265,17 +311,22 @@ def printtest(flags):
'increaseAndThrow42': 'returnOrThrow(false)', 'increaseAndThrow42': 'returnOrThrow(false)',
} }
elif alternativeFn2: elif alternativeFn2:
fragments = {
'increaseAndReturn15': 'increaseAndReturn15_calls_noopt()',
'increaseAndThrow42': 'increaseAndThrow42_calls_noopt()',
}
elif alternativeFn3:
fragments = { fragments = {
'increaseAndReturn15': 'invertFunctionCall(increaseAndThrow42)', 'increaseAndReturn15': 'invertFunctionCall(increaseAndThrow42)',
'increaseAndThrow42': 'invertFunctionCall(increaseAndReturn15)', 'increaseAndThrow42': 'invertFunctionCall(increaseAndReturn15)',
} }
elif alternativeFn3: elif alternativeFn4:
fragments = { fragments = {
'increaseAndReturn15': '(new increaseAndStore15Constructor()).x', 'increaseAndReturn15': '(new increaseAndStore15Constructor()).x',
'increaseAndThrow42': '(new increaseAndThrow42Constructor()).x', 'increaseAndThrow42': '(new increaseAndThrow42Constructor()).x',
} }
else: else:
assert alternativeFn4 assert alternativeFn5
fragments = { fragments = {
'increaseAndReturn15': 'magic.prop /* returns 15 */', 'increaseAndReturn15': 'magic.prop /* returns 15 */',
'increaseAndThrow42': '(magic.prop = 37 /* throws 42 */)', 'increaseAndThrow42': '(magic.prop = 37 /* throws 42 */)',
...@@ -294,34 +345,34 @@ def printtest(flags): ...@@ -294,34 +345,34 @@ def printtest(flags):
counter = 0 counter = 0
write( " f = function {} () {{".format(fnname(flags))) write( " f = function {} () {{".format(fnname(flags)))
write( " var local = 3;") write( " var local = 888;")
write( " deopt = {};".format("true" if deopt else "false")) write( " deopt = {};".format("true" if deopt else "false"))
local = 3 local = 888
write( " try {") write( " try {")
write( " counter++;") write( " counter++;")
counter += 1 counter += 1
resultTo = "local +=" if tryResultToLocal else "return" resultTo = "local +=" if tryResultToLocal else "return"
if tryReturns and not (tryThrows and not tryFirstReturns): if tryReturns and not (tryThrows and not tryFirstReturns):
write( " {} {increaseAndReturn15};".format(resultTo, **fragments)) write( " {} 4 + {increaseAndReturn15};".format(resultTo, **fragments))
if result == None: if result == None:
counter += 1 counter += 1
if tryResultToLocal: if tryResultToLocal:
local += 15 local += 19
else: else:
result = ("return", 15) result = ("return", 19)
if tryThrows: if tryThrows:
write( " {} {increaseAndThrow42};".format(resultTo, **fragments)) write( " {} 4 + {increaseAndThrow42};".format(resultTo, **fragments))
if result == None: if result == None:
counter += 1 counter += 1
result = ("throw", 42) result = ("throw", 42)
if tryReturns and tryThrows and not tryFirstReturns: if tryReturns and tryThrows and not tryFirstReturns:
write( " {} {increaseAndReturn15};".format(resultTo, **fragments)) write( " {} 4 + {increaseAndReturn15};".format(resultTo, **fragments))
if result == None: if result == None:
counter += 1 counter += 1
if tryResultToLocal: if tryResultToLocal:
local += 15 local += 19
else: else:
result = ("return", 15) result = ("return", 19)
write( " counter++;") write( " counter++;")
if result == None: if result == None:
counter += 1 counter += 1
...@@ -447,8 +498,10 @@ def write_shard_footer(): ...@@ -447,8 +498,10 @@ def write_shard_footer():
write("") write("")
write("runThisShard();") write("runThisShard();")
FLAGLETTERS="54321trflcrltfrtld"
flagtuple = namedtuple('flagtuple', ( flagtuple = namedtuple('flagtuple', (
"alternativeFn5",
"alternativeFn4", "alternativeFn4",
"alternativeFn3", "alternativeFn3",
"alternativeFn2", "alternativeFn2",
...@@ -508,3 +561,6 @@ if __name__ == '__main__': ...@@ -508,3 +561,6 @@ if __name__ == '__main__':
rotateshard() rotateshard()
finishshard() finishshard()
if MODE == 'shard':
print("Total: {} tests.".format(NUM_TESTS_PRINTED))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment