Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 47b555c27706a8d9c65f53f856a9c4b3afaac916..0be4727e615bd263a3356901c5a6b6d6a47547a2 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -785,16 +785,23 @@ static bool CompileUnoptimizedCode(CompilationInfo* info) { |
| return true; |
| } |
| - |
| -static bool UseIgnition(CompilationInfo* info) { |
| - // Cannot use Ignition when the {function_data} is already used. |
| - if (info->has_shared_info() && info->shared_info()->HasBuiltinFunctionId()) { |
| - return false; |
| +static bool IsGeneratorFunctionOrBuiltin(CompilationInfo* info) { |
| + if (info->has_shared_info()) { |
| + Handle<SharedFunctionInfo> shared = info->shared_info(); |
| + if (shared->is_generator()) { |
| + return true; |
| + } else if (shared->HasBuiltinFunctionId()) { |
| + BuiltinFunctionId id = shared->builtin_function_id(); |
| + return id == kGeneratorObjectNext || id == kGeneratorObjectReturn || |
| + id == kGeneratorObjectThrow; |
| + } |
| } |
| + return info->has_literal() && IsGeneratorFunction(info->literal()->kind()); |
| +} |
| +static bool UseIgnition(CompilationInfo* info) { |
| // TODO(4681): Generators are not yet supported. |
| - if ((info->has_shared_info() && info->shared_info()->is_generator()) || |
| - (info->has_literal() && IsGeneratorFunction(info->literal()->kind()))) { |
| + if (IsGeneratorFunctionOrBuiltin(info)) { |
|
Michael Starzinger
2016/03/15 17:39:41
nit: I am not sure combining these two flags into
rmcilroy
2016/03/16 13:24:24
Sure thing - I was trying to reuse the SharedFunct
|
| return false; |
| } |