2016-08-25 12:50:31 +00:00
|
|
|
// Shard 1.
|
|
|
|
|
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2022-04-28 14:22:23 +00:00
|
|
|
// Flags: --allow-natives-syntax --no-always-turbofan
|
2016-08-25 12:50:31 +00:00
|
|
|
|
|
|
|
// This test file was generated by tools/gen-inlining-tests.py .
|
|
|
|
|
|
|
|
// Global variables
|
|
|
|
var deopt = undefined; // either true or false
|
|
|
|
var counter = 0;
|
|
|
|
|
|
|
|
function resetState() {
|
|
|
|
counter = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function warmUp(f) {
|
|
|
|
try {
|
|
|
|
f();
|
|
|
|
} catch (ex) {
|
|
|
|
// ok
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
f();
|
|
|
|
} catch (ex) {
|
|
|
|
// ok
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function resetOptAndAssertResultEquals(expected, f) {
|
2019-03-01 10:19:54 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2016-08-25 12:50:31 +00:00
|
|
|
warmUp(f);
|
|
|
|
resetState();
|
|
|
|
// %DebugPrint(f);
|
|
|
|
eval("'dont optimize this function itself please, but do optimize f'");
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
assertEquals(expected, f());
|
|
|
|
}
|
|
|
|
|
|
|
|
function resetOptAndAssertThrowsWith(expected, f) {
|
2019-03-01 10:19:54 +00:00
|
|
|
%PrepareFunctionForOptimization(f);
|
2016-08-25 12:50:31 +00:00
|
|
|
warmUp(f);
|
|
|
|
resetState();
|
|
|
|
// %DebugPrint(f);
|
|
|
|
eval("'dont optimize this function itself please, but do optimize f'");
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
try {
|
|
|
|
var result = f();
|
|
|
|
fail("resetOptAndAssertThrowsWith",
|
|
|
|
"exception: " + expected,
|
|
|
|
"result: " + result);
|
|
|
|
} catch (ex) {
|
|
|
|
assertEquals(expected, ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function increaseAndReturn15() {
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
counter++;
|
|
|
|
return 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
function increaseAndThrow42() {
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
counter++;
|
|
|
|
throw 42;
|
|
|
|
}
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
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
|
|
|
|
|
2016-08-25 12:50:31 +00:00
|
|
|
function returnOrThrow(doReturn) {
|
|
|
|
if (doReturn) {
|
|
|
|
return increaseAndReturn15();
|
|
|
|
} else {
|
|
|
|
return increaseAndThrow42();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Alternative 2
|
|
|
|
|
|
|
|
function increaseAndReturn15_calls_noopt() {
|
|
|
|
return increaseAndReturn15_noopt_inner();
|
|
|
|
}
|
|
|
|
|
|
|
|
function increaseAndThrow42_calls_noopt() {
|
|
|
|
return increaseAndThrow42_noopt_inner();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Alternative 3.
|
2016-08-25 12:50:31 +00:00
|
|
|
// When passed either {increaseAndReturn15} or {increaseAndThrow42}, it acts
|
|
|
|
// as the other one.
|
|
|
|
function invertFunctionCall(f) {
|
|
|
|
var result;
|
|
|
|
try {
|
|
|
|
result = f();
|
|
|
|
} catch (ex) {
|
|
|
|
return ex - 27;
|
|
|
|
}
|
|
|
|
throw result + 27;
|
|
|
|
}
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Alternative 4: constructor
|
2016-08-25 12:50:31 +00:00
|
|
|
function increaseAndStore15Constructor() {
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
++counter;
|
|
|
|
this.x = 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
function increaseAndThrow42Constructor() {
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
++counter;
|
|
|
|
this.x = 42;
|
|
|
|
throw this.x;
|
|
|
|
}
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Alternative 5: property
|
2016-08-25 12:50:31 +00:00
|
|
|
var magic = {};
|
|
|
|
Object.defineProperty(magic, 'prop', {
|
|
|
|
get: function () {
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
return 15 + 0 * ++counter;
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function(x) {
|
|
|
|
// argument should be 37
|
|
|
|
if (deopt) %DeoptimizeFunction(f);
|
|
|
|
counter -= 36 - x; // increments counter
|
|
|
|
throw 42;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
// Generate type feedback.
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
assertEquals(15, increaseAndReturn15_calls_noopt());
|
|
|
|
assertThrowsEquals(function() { return increaseAndThrow42_noopt_inner() }, 42);
|
|
|
|
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(15, (new increaseAndStore15Constructor()).x);
|
|
|
|
assertThrowsEquals(function() {
|
|
|
|
return (new increaseAndThrow42Constructor()).x;
|
|
|
|
},
|
|
|
|
42);
|
|
|
|
|
|
|
|
function runThisShard() {
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r______f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r______f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r______fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c_______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c___f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c___f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c___fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchThrows, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c__t____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c__tf____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally,
|
|
|
|
// finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c__tf_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchThrows, doFinally,
|
|
|
|
// finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__c__tfr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchReturns, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__cr______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__cr__f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally,
|
|
|
|
// finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__cr__f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryReturns, doCatch, catchReturns, doFinally,
|
|
|
|
// finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_______r__cr__fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t_______f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(42, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t_______f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t_______fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c_______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c___f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(7, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c___f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c___fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchThrows, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c__t____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c__tf____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally,
|
|
|
|
// finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c__tf_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchThrows, doFinally,
|
|
|
|
// finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___c__tfr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchReturns, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___cr______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___cr__f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally,
|
|
|
|
// finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___cr__f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, doCatch, catchReturns, doFinally,
|
|
|
|
// finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______t___cr__fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr______f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(42, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr______f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr______fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c___f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(7, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally,
|
|
|
|
// finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c___f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, doFinally,
|
|
|
|
// finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c___fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
|
|
|
|
// doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c__tf____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
|
|
|
|
// doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c__tf_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchThrows,
|
|
|
|
// doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__c__tfr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
|
|
|
|
// doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__cr__f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
|
|
|
|
// doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__cr__f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, doCatch, catchReturns,
|
|
|
|
// doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______tr__cr__fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42();
|
|
|
|
return 4 + increaseAndReturn15();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns,
|
|
|
|
// doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_____f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns,
|
|
|
|
// doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_____f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns,
|
|
|
|
// doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_____fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c___f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c___f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c___fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchThrows, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c__tf____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchThrows, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c__tf_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchThrows, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_c__tfr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchReturns, doFinally]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_cr__f____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
local += 2;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(4, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchReturns, doFinally, finallyThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_cr__f_t__ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
throw 25;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(25, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [tryThrows, tryReturns, tryFirstReturns, doCatch,
|
|
|
|
// catchReturns, doFinally, finallyReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f______trf_cr__fr___ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15();
|
|
|
|
return 4 + increaseAndThrow42();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
} finally {
|
|
|
|
counter++;
|
|
|
|
return 3 + local;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(891, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__c_______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch, catchThrows,
|
|
|
|
// deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__c__t____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch,
|
|
|
|
// catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryReturns, doCatch,
|
|
|
|
// catchReturns, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1_r__cr______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(true);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch, deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___c_______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(undefined, f);
|
|
|
|
assertEquals(5, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchThrows,
|
|
|
|
// deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___c__t____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertThrowsWith(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___cr_______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
|
|
|
// Variant flags: [alternativeFn1, tryThrows, doCatch, catchReturns,
|
|
|
|
// deopt]
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f_____1t___cr______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + returnOrThrow(false);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
return 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
resetOptAndAssertResultEquals(44, f);
|
|
|
|
assertEquals(3, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2__r__c_l____ld () {
|
|
|
|
var local = 888;
|
|
|
|
deopt = true;
|
2016-08-25 12:50:31 +00:00
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndReturn15_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal,
|
|
|
|
// doCatch, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2__r_lc______ld () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += 4 + increaseAndReturn15_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(912, f);
|
|
|
|
assertEquals(4, counter);
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryReturns, tryResultToLocal,
|
|
|
|
// doCatch, catchWithLocal, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2__r_lc_l____ld () {
|
|
|
|
var local = 888;
|
|
|
|
deopt = true;
|
2016-08-25 12:50:31 +00:00
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += 4 + increaseAndReturn15_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(912, f);
|
|
|
|
assertEquals(4, counter);
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryThrows, doCatch,
|
|
|
|
// catchWithLocal, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2_t___c_l____ld () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + increaseAndThrow42_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(935, f);
|
|
|
|
assertEquals(5, counter);
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal,
|
|
|
|
// doCatch, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2_t__lc______ld () {
|
|
|
|
var local = 888;
|
|
|
|
deopt = true;
|
2016-08-25 12:50:31 +00:00
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += 4 + increaseAndThrow42_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(893, f);
|
|
|
|
assertEquals(5, counter);
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn2, tryThrows, tryResultToLocal,
|
|
|
|
// doCatch, catchWithLocal, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f____2_t__lc_l____ld () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += 4 + increaseAndThrow42_calls_noopt();
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
local += ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(935, f);
|
|
|
|
assertEquals(5, counter);
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c________ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_______d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c__t_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch, catchThrows,
|
|
|
|
// deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c__t____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
|
|
|
throw 2 + ex;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_l______ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
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;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
return 5 + local;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_l____ld () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
local += ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
return 5 + local;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, catchThrows]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_lt_____ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
throw 2 + ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, catchThrows, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_lt____d () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
throw 2 + ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, catchThrows, endReturnLocal]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_lt___l_ () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = false;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
throw 2 + ex;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 5 + local;
|
2016-08-25 12:50:31 +00:00
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// Variant flags: [alternativeFn3, tryReturns, doCatch,
|
|
|
|
// catchWithLocal, catchThrows, endReturnLocal, deopt]
|
2016-08-25 12:50:31 +00:00
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
f = function f___3___r__c_lt___ld () {
|
|
|
|
var local = 888;
|
2016-08-25 12:50:31 +00:00
|
|
|
deopt = true;
|
|
|
|
try {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
return 4 + invertFunctionCall(increaseAndThrow42);
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
} catch (ex) {
|
|
|
|
counter++;
|
2016-08-29 11:16:36 +00:00
|
|
|
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;
|
2016-08-25 12:50:31 +00:00
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
}
|
2016-08-29 11:16:36 +00:00
|
|
|
resetOptAndAssertResultEquals(19, f);
|
2016-08-25 12:50:31 +00:00
|
|
|
assertEquals(2, counter);
|
|
|
|
|
|
|
|
}
|
|
|
|
%NeverOptimizeFunction(runThisShard);
|
|
|
|
|
2016-08-29 11:16:36 +00:00
|
|
|
// 97 tests in this shard.
|
|
|
|
// 97 tests up to here.
|
2016-08-25 12:50:31 +00:00
|
|
|
|
|
|
|
runThisShard();
|