Index: src/ast/ast-numbering.cc |
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc |
index 6de950161867257d0006407550fab84c35e6849a..e1b11f655a844f2f92f9557db9c85bd7215a8e4d 100644 |
--- a/src/ast/ast-numbering.cc |
+++ b/src/ast/ast-numbering.cc |
@@ -592,10 +592,12 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
} |
if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { |
- // TODO(neis): We may want to allow Turbofan optimization here if |
- // --turbo-from-bytecode is set and we know that Ignition is used. |
- // Unfortunately we can't express that here. |
- DisableOptimization(kGenerator); |
+ // Generators can be optimized if --turbo-from-bytecode is set. |
+ if (FLAG_turbo_from_bytecode) { |
+ DisableCrankshaft(kGenerator); |
+ } else { |
+ DisableOptimization(kGenerator); |
+ } |
} |
VisitDeclarations(scope->declarations()); |