Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index e0f160ba2b312981affdd1a3d220baf3ae3e4069..527a6ebc9569f579188bc93091c51d60d7ebd04f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -9892,6 +9892,15 @@ void JSFunction::RemovePrototype() { |
} |
+void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { |
+ if (function->has_initial_map()) return; |
+ Isolate* isolate = function->GetIsolate(); |
+ Handle<Map> initial_map = isolate->factory()->NewInitialMap(function); |
+ function->set_initial_map(*initial_map); |
+ initial_map->set_constructor(*function); |
+} |
+ |
+ |
void JSFunction::SetInstanceClassName(String* name) { |
shared()->set_instance_class_name(name); |
} |