Commit 96496454 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Fix turbofan-enabling conditions.

This restricts turbofan to turbofan-supported subset for the shipping
configuration ("use asm" and features unsupported by Crankshaft).

Without this, we compile with Turbofan even when there is
try-catch-finally as long as the function is "use asm" or
it contains a feature unsupported by crankshaft but supported
by turbofan (e.g., 'with' statement).

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33085}
parent 82ca2a41
...@@ -411,12 +411,29 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { ...@@ -411,12 +411,29 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
DCHECK(info()->shared_info()->has_deoptimization_support()); DCHECK(info()->shared_info()->has_deoptimization_support());
DCHECK(!info()->is_first_compile()); DCHECK(!info()->is_first_compile());
// Check the enabling conditions for TurboFan. bool optimization_disabled = info()->shared_info()->optimization_disabled();
bool dont_crankshaft = info()->shared_info()->dont_crankshaft(); bool dont_crankshaft = info()->shared_info()->dont_crankshaft();
if (((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
(dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0) || // Check the enabling conditions for Turbofan.
info()->closure()->PassesFilter(FLAG_turbo_filter)) && // 1. "use asm" code.
(FLAG_turbo_osr || !info()->is_osr())) { bool is_turbofanable_asm = FLAG_turbo_asm &&
info()->shared_info()->asm_function() &&
!optimization_disabled;
// 2. Fallback for features unsupported by Crankshaft.
bool is_unsupported_by_crankshaft_but_turbofanable =
dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0 &&
!optimization_disabled;
// 3. Explicitly enabled by the command-line filter.
bool passes_turbo_filter = info()->closure()->PassesFilter(FLAG_turbo_filter);
// If this is OSR request, OSR must be enabled by Turbofan.
bool passes_osr_test = FLAG_turbo_osr || !info()->is_osr();
if ((is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable ||
passes_turbo_filter) &&
passes_osr_test) {
// Use TurboFan for the compilation. // Use TurboFan for the compilation.
if (FLAG_trace_opt) { if (FLAG_trace_opt) {
OFStream os(stdout); OFStream os(stdout);
......
...@@ -118,6 +118,9 @@ ...@@ -118,6 +118,9 @@
'debug-listbreakpoints': [PASS, NO_VARIANTS], # arm64 nosnap with turbofan 'debug-listbreakpoints': [PASS, NO_VARIANTS], # arm64 nosnap with turbofan
'debug-enable-disable-breakpoints': [PASS, NO_VARIANTS], #arm64 nosnap with turbofan. 'debug-enable-disable-breakpoints': [PASS, NO_VARIANTS], #arm64 nosnap with turbofan.
# TODO(rossberg)
'strong/literals': [SKIP], # Rest arguments do not respect strongness in Turbofan.
# Issue 4035: unexpected frame->context() in debugger # Issue 4035: unexpected frame->context() in debugger
'regress/regress-crbug-107996': [PASS, NO_VARIANTS], 'regress/regress-crbug-107996': [PASS, NO_VARIANTS],
'regress/regress-crbug-171715': [PASS, NO_VARIANTS], 'regress/regress-crbug-171715': [PASS, NO_VARIANTS],
...@@ -170,10 +173,6 @@ ...@@ -170,10 +173,6 @@
'regress-sync-optimized-lists': [PASS, NO_VARIANTS], 'regress-sync-optimized-lists': [PASS, NO_VARIANTS],
'regress/regress-store-uncacheable': [PASS, NO_VARIANTS], 'regress/regress-store-uncacheable': [PASS, NO_VARIANTS],
# TODO(jarin): compiler.cc seems to ignore DisableOptimization for
# TurboFan in various cases.
'regress/regress-417709a': [SKIP],
# issue 4078: # issue 4078:
'allocation-site-info': [PASS, NO_VARIANTS], 'allocation-site-info': [PASS, NO_VARIANTS],
......
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