Commit b715329a authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Split --turbo-exceptions into two flags.

This allows try-catch and try-finally constructs to be separately
enabled and disabled. We plan to stage try-catch support soon.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/1157863015

Cr-Commit-Position: refs/heads/master@{#28848}
parent 05d816cb
......@@ -1410,7 +1410,7 @@ void AstGraphBuilder::VisitTryCatchStatement(TryCatchStatement* stmt) {
try_control.EndCatch();
// TODO(mstarzinger): Remove bailout once everything works.
if (!FLAG_turbo_exceptions) SetStackOverflow();
if (!FLAG_turbo_try_catch) SetStackOverflow();
}
......@@ -1479,7 +1479,7 @@ void AstGraphBuilder::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
commands->ApplyDeferredCommands(token, result);
// TODO(mstarzinger): Remove bailout once everything works.
if (!FLAG_turbo_exceptions) SetStackOverflow();
if (!FLAG_turbo_try_finally) SetStackOverflow();
}
......
......@@ -422,7 +422,8 @@ DEFINE_BOOL(turbo_verify_allocation, DEBUG_BOOL,
DEFINE_BOOL(turbo_move_optimization, true, "optimize gap moves in TurboFan")
DEFINE_BOOL(turbo_jt, true, "enable jump threading in TurboFan")
DEFINE_BOOL(turbo_osr, true, "enable OSR in TurboFan")
DEFINE_BOOL(turbo_exceptions, false, "enable exception handling in TurboFan")
DEFINE_BOOL(turbo_try_catch, false, "enable try-catch support in TurboFan")
DEFINE_BOOL(turbo_try_finally, false, "enable try-finally support in TurboFan")
DEFINE_BOOL(turbo_stress_loop_peeling, false,
"stress loop peeling optimization")
DEFINE_BOOL(turbo_cf_optimization, true, "optimize control flow in TurboFan")
......
......@@ -10,7 +10,6 @@ using namespace v8::internal;
using namespace v8::internal::compiler;
TEST(Throw) {
i::FLAG_turbo_exceptions = true;
FunctionTester T("(function(a,b) { if (a) { throw b; } else { return b; }})");
T.CheckThrows(T.true_value(), T.NewObject("new Error"));
......@@ -19,7 +18,6 @@ TEST(Throw) {
TEST(ThrowMessagePosition) {
i::FLAG_turbo_exceptions = true;
static const char* src =
"(function(a, b) { \n"
" if (a == 1) throw 1; \n"
......@@ -45,7 +43,6 @@ TEST(ThrowMessagePosition) {
TEST(ThrowMessageDirectly) {
i::FLAG_turbo_exceptions = true;
static const char* src =
"(function(a, b) {"
" if (a) { throw b; } else { throw new Error(b); }"
......@@ -62,7 +59,8 @@ TEST(ThrowMessageDirectly) {
TEST(ThrowMessageIndirectly) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
i::FLAG_turbo_try_finally = true;
static const char* src =
"(function(a, b) {"
" try {"
......@@ -87,7 +85,7 @@ TEST(ThrowMessageIndirectly) {
TEST(Catch) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
......@@ -106,7 +104,7 @@ TEST(Catch) {
TEST(CatchNested) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
......@@ -130,7 +128,7 @@ TEST(CatchNested) {
TEST(CatchBreak) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
......@@ -155,7 +153,7 @@ TEST(CatchBreak) {
TEST(CatchCall) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function(fun) {"
" var r = '-';"
......@@ -177,7 +175,7 @@ TEST(CatchCall) {
TEST(Finally) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_finally = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
......@@ -195,7 +193,7 @@ TEST(Finally) {
TEST(FinallyBreak) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_finally = true;
const char* src =
"(function(a,b) {"
" var r = '-';"
......@@ -219,7 +217,7 @@ TEST(FinallyBreak) {
TEST(DeoptTry) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function f(a) {"
" try {"
......@@ -236,7 +234,7 @@ TEST(DeoptTry) {
TEST(DeoptCatch) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_catch = true;
const char* src =
"(function f(a) {"
" try {"
......@@ -253,7 +251,7 @@ TEST(DeoptCatch) {
TEST(DeoptFinallyReturn) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_finally = true;
const char* src =
"(function f(a) {"
" try {"
......@@ -270,7 +268,7 @@ TEST(DeoptFinallyReturn) {
TEST(DeoptFinallyReThrow) {
i::FLAG_turbo_exceptions = true;
i::FLAG_turbo_try_finally = true;
const char* src =
"(function f(a) {"
" try {"
......
......@@ -5912,7 +5912,8 @@ TEST(MessageObjectLeak) {
const char* flag = "--turbo-filter=*";
FlagList::SetFlagsFromString(flag, StrLength(flag));
FLAG_always_opt = true;
FLAG_turbo_exceptions = true;
FLAG_turbo_try_catch = true;
FLAG_turbo_try_finally = true;
CompileRun(test);
}
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(mstarzinger): Add FLAG_turbo_exceptions once we want ClusterFuzz.
// Flags: --allow-natives-syntax --turbo-deoptimization
function DeoptFromTry(x) {
......
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