Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 0a33839086f40c79806375f7125161fde28a7b2f..28526743341efef867af9977bc3f26b10e297897 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1958,6 +1958,18 @@ void Factory::ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type, |
} |
+Handle<JSGlobalProxy> Factory::NewUninitializedJSGlobalProxy() { |
+ // Create an empty shell of a JSGlobalProxy that needs to be reinitialized |
+ // via ReinitializeJSGlobalProxy later. |
+ Handle<Map> map = NewMap(JS_GLOBAL_PROXY_TYPE, JSGlobalProxy::kSize); |
+ // Maintain invariant expected from any JSGlobalProxy. |
+ map->set_is_access_check_needed(true); |
+ CALL_HEAP_FUNCTION(isolate(), isolate()->heap()->AllocateJSObjectFromMap( |
+ *map, NOT_TENURED, false), |
+ JSGlobalProxy); |
+} |
+ |
+ |
void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object, |
Handle<JSFunction> constructor) { |
DCHECK(constructor->has_initial_map()); |