Commit 101260d3 authored by jarin's avatar jarin Committed by Commit bot

Ship try-finally optimization in Turbofan.

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

Cr-Commit-Position: refs/heads/master@{#35804}
parent f356efcf
...@@ -324,7 +324,7 @@ void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) { ...@@ -324,7 +324,7 @@ void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) {
void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) { void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableOptimization(kTryFinallyStatement); DisableCrankshaft(kTryFinallyStatement);
Visit(node->try_block()); Visit(node->try_block());
Visit(node->finally_block()); Visit(node->finally_block());
} }
......
...@@ -698,12 +698,7 @@ TEST(BailoutReason) { ...@@ -698,12 +698,7 @@ TEST(BailoutReason) {
" debugger;\n" " debugger;\n"
" startProfiling();\n" " startProfiling();\n"
"}\n" "}\n"
"function TryFinally() {\n" "Debugger();\n"
" try {\n"
" Debugger();\n"
" } finally { };\n"
"}\n"
"TryFinally();\n"
"stopProfiling();")); "stopProfiling();"));
script->Run(v8::Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked(); script->Run(v8::Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked();
CHECK_EQ(1, iprofiler->GetProfilesCount()); CHECK_EQ(1, iprofiler->GetProfilesCount());
...@@ -715,15 +710,10 @@ TEST(BailoutReason) { ...@@ -715,15 +710,10 @@ TEST(BailoutReason) {
// The tree should look like this: // The tree should look like this:
// (root) // (root)
// "" // ""
// kTryFinallyStatement // kDebuggerStatement
// kDebuggerStatement
current = PickChild(current, ""); current = PickChild(current, "");
CHECK(const_cast<v8::CpuProfileNode*>(current)); CHECK(const_cast<v8::CpuProfileNode*>(current));
current = PickChild(current, "TryFinally");
CHECK(const_cast<v8::CpuProfileNode*>(current));
CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason()));
current = PickChild(current, "Debugger"); current = PickChild(current, "Debugger");
CHECK(const_cast<v8::CpuProfileNode*>(current)); CHECK(const_cast<v8::CpuProfileNode*>(current));
CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason()));
......
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