| Index: src/compiler.cc
 | 
| diff --git a/src/compiler.cc b/src/compiler.cc
 | 
| index 43759571fabe93f0ef1db338c1b8f0329024b773..78021d5681b1f8f19d0d7dbcad3a6ee3d54b93cc 100644
 | 
| --- a/src/compiler.cc
 | 
| +++ b/src/compiler.cc
 | 
| @@ -506,8 +506,7 @@ bool UseIgnition(CompilationInfo* info) {
 | 
|      return false;
 | 
|    }
 | 
|  
 | 
| -  // TODO(4681): Generator functions are not yet supported.
 | 
| -  if (info->shared_info()->is_generator()) {
 | 
| +  if (info->shared_info()->is_generator() && !FLAG_ignition_generators) {
 | 
|      return false;
 | 
|    }
 | 
|  
 | 
| @@ -840,6 +839,13 @@ 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;
 | 
| 
 |