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