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

Unified Diff: src/heap/heap.h

Issue 722723002: Move public symbols to the root set. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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-snapshot-generator.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698