v8/test/mjsunit/regress/regress-crbug-624747.js
mstarzinger a757a62bf5 [turbofan] Broaden checkpoint elimination on returns.
This makes the elimination of checkpoints flowing effect-wise into nodes
having the {Return} operator more permissive. We can cut out checkpoints
even when they are not wholly owned by the return. This also alleviates
a problem where TCO no longer applies.

R=jarin@chromium.org
TEST=mjsunit/regress/regress-crbug-624747
BUG=chromium:624747

Review-Url: https://codereview.chromium.org/2118793002
Cr-Commit-Position: refs/heads/master@{#37480}
2016-07-01 13:53:45 +00:00

23 lines
468 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 --es-staging
"use strict";
function bar() {
try {
unref;
} catch (e) {
return (1 instanceof TypeError) && unref(); // Call in tail position!
}
}
function foo() {
return bar(); // Call in tail position!
}
%OptimizeFunctionOnNextCall(foo);
foo();