Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 0a33839086f40c79806375f7125161fde28a7b2f..fa86440a08404678f52ada01a0fd71ada535d411 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1958,6 +1958,19 @@ 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, |
+ FAST_HOLEY_SMI_ELEMENTS); |
Toon Verwaest
2015/01/14 14:16:28
Omit the last argument to get the default elements
|
+ // 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()); |