| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index 4bfbc780bbb4b0995d8d5171bc516a12cc7e2806..613919531ce043d348dbcd7dfe3be1a96b633462 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -1660,7 +1660,7 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
|
|
|
| Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
|
| Handle<JSFunction> function) {
|
| - DCHECK(function->shared()->is_generator());
|
| + DCHECK(function->shared()->is_generator() || function->shared()->is_async());
|
| JSFunction::EnsureHasInitialMap(function);
|
| Handle<Map> map(function->initial_map());
|
| DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type());
|
| @@ -2066,6 +2066,9 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo(
|
| shared->set_instance_class_name(isolate()->heap()->Generator_string());
|
| shared->DisableOptimization(kGenerator);
|
| }
|
| + if (IsAsyncFunction(kind)) {
|
| + shared->DisableOptimization(kAsyncFunctionBailout);
|
| + }
|
| return shared;
|
| }
|
|
|
|
|