Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: src/compiler.cc

Issue 1552233002: [turbofan] Fix turbofan-enabling conditions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adjust test expectations. Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 4e3ccad798c1d54ccd9239f3be0023c25b3f1869..307b3b0e428493887dbdadf28cd67c6d1d7444c4 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -411,12 +411,29 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
DCHECK(info()->shared_info()->has_deoptimization_support());
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();
- if (((FLAG_turbo_asm && info()->shared_info()->asm_function()) ||
- (dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0) ||
- info()->closure()->PassesFilter(FLAG_turbo_filter)) &&
- (FLAG_turbo_osr || !info()->is_osr())) {
+
+ // Check the enabling conditions for Turbofan.
+ // 1. "use asm" code.
+ 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.
if (FLAG_trace_opt) {
OFStream os(stdout);
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698