Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 5518f008e91a25470c452d660ea1054276210a49..9271d09d72059ddfa5d4b34038cea0f4013ad63e 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -2329,4 +2329,25 @@ ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
#undef ISOLATE_FIELD_OFFSET |
#endif |
+ |
+Handle<JSObject> Isolate::GetSymbolRegistry() { |
+ if (heap()->symbol_registry()->IsUndefined()) { |
+ Handle<Map> map = factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
+ Handle<JSObject> registry = factory()->NewJSObjectFromMap(map); |
+ heap()->set_symbol_registry(*registry); |
+ |
+ static const char* nested[] = { |
+ "for", "for_api", "for_intern", "keyFor", "private_api", "private_intern" |
+ }; |
+ for (unsigned i = 0; i < ARRAY_SIZE(nested); ++i) { |
+ Handle<String> name = factory()->InternalizeUtf8String(nested[i]); |
+ Handle<JSObject> obj = factory()->NewJSObjectFromMap(map); |
+ JSObject::NormalizeProperties(obj, KEEP_INOBJECT_PROPERTIES, 8); |
rossberg
2014/03/24 15:54:47
Now forcing into dictionary mode.
|
+ JSObject::SetProperty(registry, name, obj, NONE, STRICT); |
+ } |
+ } |
+ return Handle<JSObject>::cast(factory()->symbol_registry()); |
+} |
+ |
+ |
} } // namespace v8::internal |