Index: src/heap/heap.h |
diff --git a/src/heap/heap.h b/src/heap/heap.h |
index e292c322bac8a6e73fb61cc206f202d332a887fb..eeb83228610870b1aed5d041ebf2171b65615a5d 100644 |
--- a/src/heap/heap.h |
+++ b/src/heap/heap.h |
@@ -299,6 +299,15 @@ namespace internal { |
V(class_start_position_symbol) \ |
V(class_end_position_symbol) |
+#define PUBLIC_SYMBOL_LIST(V) \ |
+ V(has_instance_symbol, symbolHasInstance, Symbol.hasInstance) \ |
+ V(is_concat_spreadable_symbol, symbolIsConcatSpreadable, \ |
+ Symbol.isConcatSpreadable) \ |
+ V(is_regexp_symbol, symbolIsRegExp, Symbol.isRegExp) \ |
+ V(iterator_symbol, symbolIterator, Symbol.iterator) \ |
+ V(to_string_tag_symbol, symbolToStringTag, Symbol.toStringTag) \ |
+ V(unscopables_symbol, symbolUnscopables, Symbol.unscopables) |
+ |
// Heap roots that are known to be immortal immovable, for which we can safely |
// skip write barriers. This list is not complete and has omissions. |
#define IMMORTAL_IMMOVABLE_ROOT_LIST(V) \ |
@@ -809,6 +818,11 @@ class Heap { |
PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR) |
#undef SYMBOL_ACCESSOR |
+#define SYMBOL_ACCESSOR(name, varname, description) \ |
+ Symbol* name() { return Symbol::cast(roots_[k##name##RootIndex]); } |
+ PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR) |
+#undef SYMBOL_ACCESSOR |
+ |
// The hidden_string is special because it is the empty string, but does |
// not match the empty string. |
String* hidden_string() { return hidden_string_; } |
@@ -1106,6 +1120,10 @@ class Heap { |
PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
#undef SYMBOL_INDEX_DECLARATION |
+#define SYMBOL_INDEX_DECLARATION(name, varname, description) k##name##RootIndex, |
+ PUBLIC_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION) |
+#undef SYMBOL_INDEX_DECLARATION |
+ |
// Utility type maps |
#define DECLARE_STRUCT_MAP(NAME, Name, name) k##Name##MapRootIndex, |
STRUCT_LIST(DECLARE_STRUCT_MAP) |