Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Unified Diff: src/heap/heap.cc

Issue 1149863005: Move hash code from hidden string to a private symbol (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix merge Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 09f4cc71278e39c57be57099f4c08aedcef34cbd..fc15a504edd6ec20353aa50ca4b25f016700d563 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -3060,9 +3060,12 @@ void Heap::CreateInitialObjects() {
{
HandleScope scope(isolate());
-#define SYMBOL_INIT(name) \
- Handle<Symbol> name = factory->NewPrivateOwnSymbol(); \
- roots_[k##name##RootIndex] = *name;
+#define SYMBOL_INIT(name) \
+ { \
+ Handle<String> name##d = factory->NewStringFromStaticChars(#name); \
+ Handle<Object> symbol(isolate()->factory()->NewPrivateOwnSymbol(name##d)); \
+ roots_[k##name##RootIndex] = *symbol; \
+ }
PRIVATE_SYMBOL_LIST(SYMBOL_INIT)
#undef SYMBOL_INIT
}
@@ -3171,6 +3174,19 @@ void Heap::CreateInitialObjects() {
}
+void Heap::AddPrivateGlobalSymbols(Handle<Object> private_intern_table) {
+#define ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE(name_arg) \
+ { \
+ Handle<Symbol> symbol(Symbol::cast(roots_[k##name_arg##RootIndex])); \
+ Handle<String> name_arg##d(String::cast(symbol->name())); \
+ JSObject::AddProperty(Handle<JSObject>::cast(private_intern_table), \
+ name_arg##d, symbol, NONE); \
+ }
+ PRIVATE_SYMBOL_LIST(ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE)
+#undef ADD_SYMBOL_TO_PRIVATE_INTERN_TABLE
+}
+
+
bool Heap::RootCanBeWrittenAfterInitialization(Heap::RootListIndex root_index) {
switch (root_index) {
case kStoreBufferTopRootIndex:
« no previous file with comments | « src/heap/heap.h ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698