| Index: src/factory.cc
|
| diff --git a/src/factory.cc b/src/factory.cc
|
| index 087aad36936c0c2f4eb8ce9e2a1f3eb37dd5bd61..163e86484dfb7f4d9f1ebd9c9ea02a8bf0ad51c2 100644
|
| --- a/src/factory.cc
|
| +++ b/src/factory.cc
|
| @@ -1358,7 +1358,7 @@ Handle<JSFunction> Factory::NewFunction(Handle<String> name, Handle<Code> code,
|
| // TODO(littledan): Why do we have this is_generator test when
|
| // NewFunctionPrototype already handles finding an appropriately
|
| // shared prototype?
|
| - if (!function->shared()->is_resumable()) {
|
| + if (!IsResumableFunction(function->shared()->kind())) {
|
| if (prototype->IsTheHole(isolate())) {
|
| prototype = NewFunctionPrototype(function);
|
| }
|
| @@ -1384,12 +1384,11 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
|
| // can be from a different context.
|
| Handle<Context> native_context(function->context()->native_context());
|
| Handle<Map> new_map;
|
| - if (function->shared()->is_resumable()) {
|
| + if (IsResumableFunction(function->shared()->kind())) {
|
| // Generator and async function prototypes can share maps since they
|
| // don't have "constructor" properties.
|
| new_map = handle(native_context->generator_object_prototype_map());
|
| } else {
|
| - CHECK(!function->shared()->is_async());
|
| // Each function prototype gets a fresh map to avoid unwanted sharing of
|
| // maps between prototypes of different constructors.
|
| Handle<JSFunction> object_function(native_context->object_function());
|
| @@ -1400,7 +1399,7 @@ Handle<JSObject> Factory::NewFunctionPrototype(Handle<JSFunction> function) {
|
| DCHECK(!new_map->is_prototype_map());
|
| Handle<JSObject> prototype = NewJSObjectFromMap(new_map);
|
|
|
| - if (!function->shared()->is_resumable()) {
|
| + if (!IsResumableFunction(function->shared()->kind())) {
|
| JSObject::AddProperty(prototype, constructor_string(), function, DONT_ENUM);
|
| }
|
|
|
| @@ -1739,7 +1738,7 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
|
|
|
| Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
|
| Handle<JSFunction> function) {
|
| - DCHECK(function->shared()->is_resumable());
|
| + DCHECK(IsResumableFunction(function->shared()->kind()));
|
| JSFunction::EnsureHasInitialMap(function);
|
| Handle<Map> map(function->initial_map());
|
| DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type());
|
|
|