Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 86bdc7cbb268078db55c5e019a891e5a1f1cc659..69fcbb60e09fb18364e1eace8c44d19f7f7fa819 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -12525,7 +12525,8 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) { |
void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
- DCHECK(function->IsConstructor() || function->shared()->is_generator()); |
+ DCHECK(function->IsConstructor() || function->shared()->is_generator() || |
+ function->shared()->is_async()); |
if (function->has_initial_map()) return; |
Isolate* isolate = function->GetIsolate(); |
@@ -12536,7 +12537,7 @@ void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
// First create a new map with the size and number of in-object properties |
// suggested by the function. |
InstanceType instance_type; |
- if (function->shared()->is_generator()) { |
+ if (function->shared()->is_generator() || function->shared()->is_async()) { |
instance_type = JS_GENERATOR_OBJECT_TYPE; |
} else { |
instance_type = JS_OBJECT_TYPE; |