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

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
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 8fd4b844972ef90d2e8d44ad34f390451d0a5944..c9c921fa99e948ee0227a2852c805adc20403b76 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -300,6 +300,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) \
@@ -810,6 +819,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_; }
@@ -1107,6 +1121,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)
« src/harmony-tostring.js ('K') | « 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