Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index ad3bfef559452199064da7813739e217e8b2f568..847269e829865fb54c6dfe7a0753663708cc8509 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -2736,12 +2736,12 @@ void Heap::CreateInitialObjects() { |
{ |
HandleScope scope(isolate()); |
-#define SYMBOL_INIT(name) \ |
- { \ |
- Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
- Handle<Symbol> symbol(isolate()->factory()->NewPrivateSymbol()); \ |
- symbol->set_name(*name##d); \ |
- roots_[k##name##RootIndex] = *symbol; \ |
+#define SYMBOL_INIT(name) \ |
+ { \ |
+ Handle<String> name##d = factory->NewStringFromStaticChars(#name); \ |
+ Handle<Symbol> name = \ |
+ isolate()->factory()->NewPrivateSymbol(name##d).ToHandleChecked(); \ |
+ roots_[k##name##RootIndex] = *name; \ |
} |
PRIVATE_SYMBOL_LIST(SYMBOL_INIT) |
#undef SYMBOL_INIT |
@@ -2750,18 +2750,16 @@ void Heap::CreateInitialObjects() { |
{ |
HandleScope scope(isolate()); |
#define SYMBOL_INIT(name, description) \ |
- Handle<Symbol> name = factory->NewSymbol(); \ |
Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ |
- name->set_name(*name##d); \ |
+ Handle<Symbol> name = factory->NewSymbol(name##d).ToHandleChecked(); \ |
roots_[k##name##RootIndex] = *name; |
PUBLIC_SYMBOL_LIST(SYMBOL_INIT) |
#undef SYMBOL_INIT |
#define SYMBOL_INIT(name, description) \ |
- Handle<Symbol> name = factory->NewSymbol(); \ |
Handle<String> name##d = factory->NewStringFromStaticChars(#description); \ |
+ Handle<Symbol> name = factory->NewSymbol(name##d).ToHandleChecked(); \ |
name->set_is_well_known_symbol(true); \ |
- name->set_name(*name##d); \ |
roots_[k##name##RootIndex] = *name; |
WELL_KNOWN_SYMBOL_LIST(SYMBOL_INIT) |
#undef SYMBOL_INIT |
@@ -4076,6 +4074,7 @@ AllocationResult Heap::AllocateSymbol() { |
Symbol::cast(result) |
->set_hash_field(Name::kIsNotArrayIndexMask | (hash << Name::kHashShift)); |
Symbol::cast(result)->set_name(undefined_value()); |
+ Symbol::cast(result)->set_descriptive_string(Symbol_parens_string()); |
Symbol::cast(result)->set_flags(0); |
DCHECK(!Symbol::cast(result)->is_private()); |