// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
// Test deoptimization inside short-circuited expressions.
function f1(x) {
var c = "fail";
function g1() { try { return 1; } finally {} }
-for (var i=0; i<10000000; i++) f1(42);
+for (var i = 0; i < 5; i++) f1(42);
+%OptimizeFunctionOnNextCall(f1);
assertEquals(-1, f1(0));
assertEquals(-43, f1(42));
function g2() { try { return 0; } finally {} }
-for (var i=0; i<10000000; i++) f2(42);
+for (var i = 0; i < 5; i++) f2(42);
+%OptimizeFunctionOnNextCall(f2);
assertEquals(-1, f2(""));
compiler/regress-rep-change: SKIP
compiler/regress-arguments: SKIP
compiler/regress-funarguments: SKIP
-compiler/regress-or: SKIP
compiler/regress-3249650: SKIP
compiler/simple-deopt: SKIP
regress/regress-490: SKIP
compiler/regress-rep-change: SKIP
compiler/regress-arguments: SKIP
compiler/regress-funarguments: SKIP
-compiler/regress-or: SKIP
compiler/regress-3249650: SKIP
compiler/simple-deopt: SKIP
regress/regress-490: SKIP