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

Unified Diff: src/compiler.cc

Issue 1957393004: Allow Turbofan optimization of Ignition generators (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 7 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 | « src/bailout-reason.h ('k') | src/compiler/bytecode-graph-builder.cc » ('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 1fe623bbc9aefbd2765ba8b3657bef92d78ede1f..abbc675bd53be4809679d1b5fc319234bc7e6fd8 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -735,13 +735,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
return MaybeHandle<Code>();
}
- // Do not use Crankshaft/TurboFan on a generator function.
- // TODO(neis): Eventually enable for Turbofan.
- if (IsGeneratorFunction(info->shared_info()->kind())) {
- info->AbortOptimization(kGenerator);
- return MaybeHandle<Code>();
- }
-
// Limit the number of times we try to optimize functions.
const int kMaxOptCount =
FLAG_deopt_every_n_times == 0 ? FLAG_max_opt_count : 1000;
@@ -1251,6 +1244,12 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
Zone zone(info->isolate()->allocator());
CompilationInfo unoptimized(info->parse_info(), info->closure());
unoptimized.EnableDeoptimizationSupport();
+
+ // TODO(4280): For now we do not switch generators to baseline code because
+ // there might be suspended activations stored in generator objects on the
+ // heap. We could eventually go directly to TurboFan in this case.
+ if (shared->is_generator()) return false;
+
// TODO(4280): For now we disable switching to baseline code in the presence
// of interpreter activations of the given function. The reasons are:
// 1) The debugger assumes each function is either full-code or bytecode.
@@ -1261,6 +1260,7 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
HasInterpreterActivations(info->isolate(), *shared)) {
return false;
}
+
// If the current code has reloc info for serialization, also include
// reloc info for serialization for the new code, so that deopt support
// can be added without losing IC state.
« no previous file with comments | « src/bailout-reason.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698