Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 1beb00fe66c97acf5189c83172625365d216a99b..7d2dad06243c92581f59ee662f5bd56f687eaa36 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1228,6 +1228,7 @@ Handle<JSFunction> Factory::NewFunction(Handle<Map> map, |
map.is_identical_to( |
isolate()->sloppy_function_with_readonly_prototype_map()) || |
map.is_identical_to(isolate()->strict_function_map()) || |
+ map.is_identical_to(isolate()->strict_function_without_prototype_map()) || |
// TODO(titzer): wasm_function_map() could be undefined here. ugly. |
(*map == context->get(Context::WASM_FUNCTION_MAP_INDEX)) || |
map.is_identical_to(isolate()->proxy_function_map())); |
@@ -1661,7 +1662,7 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array, |
Handle<JSGeneratorObject> Factory::NewJSGeneratorObject( |
Handle<JSFunction> function) { |
- DCHECK(function->shared()->is_generator()); |
+ DCHECK(function->shared()->is_resumable()); |
JSFunction::EnsureHasInitialMap(function); |
Handle<Map> map(function->initial_map()); |
DCHECK_EQ(JS_GENERATOR_OBJECT_TYPE, map->instance_type()); |
@@ -2067,6 +2068,11 @@ Handle<SharedFunctionInfo> Factory::NewSharedFunctionInfo( |
shared->set_instance_class_name(isolate()->heap()->Generator_string()); |
shared->DisableOptimization(kGenerator); |
} |
+ if (IsAsyncFunction(kind)) { |
+ // TODO(caitp): Enable optimization of async functions when they are enabled |
+ // for generators functions. |
+ shared->DisableOptimization(kGenerator); |
+ } |
return shared; |
} |