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

Unified Diff: src/heap/heap.cc

Issue 2903533002: Revert of [es2015] Precompute the descriptive string for symbols. (Closed)
Patch Set: Created 3 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-symbols.h ('k') | src/isolate.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 847269e829865fb54c6dfe7a0753663708cc8509..ad3bfef559452199064da7813739e217e8b2f568 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -2736,12 +2736,12 @@
{
HandleScope scope(isolate());
-#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; \
+#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; \
}
PRIVATE_SYMBOL_LIST(SYMBOL_INIT)
#undef SYMBOL_INIT
@@ -2750,16 +2750,18 @@
{
HandleScope scope(isolate());
#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_name(*name##d); \
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
@@ -4074,7 +4076,6 @@
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());
« no previous file with comments | « src/heap-symbols.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698