v8/test/mjsunit/compiler/regress-628403.js
jarin 514951f651 [turbofan] In effect control linearizer, only delay effect phi update for loops.
Delaying for merges caused branch cloning using dummy effect phi inputs,
potentially splitting the effect chain at start.

We still have to delay the creation for loops because we need to break
cycles.

BUG=chromium:628403

Review-Url: https://codereview.chromium.org/2159603002
Cr-Commit-Position: refs/heads/master@{#37808}
2016-07-16 12:39:14 +00:00

28 lines
501 B
JavaScript

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var dothrow = false;
function g() {
if (dothrow) throw 1;
}
function f(a) {
try {
g();
} catch(e) {
if (typeof e !== 'number' && e !== 1) throw e;
return a[0];
}
}
%NeverOptimizeFunction(g);
f();
f();
%OptimizeFunctionOnNextCall(f);
dothrow = true;
assertEquals(42, f([42]));