diff options
Diffstat (limited to 'deps/v8/src/visitors.h')
-rw-r--r-- | deps/v8/src/visitors.h | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/deps/v8/src/visitors.h b/deps/v8/src/visitors.h index 7696df8faf..31ee0795d4 100644 --- a/deps/v8/src/visitors.h +++ b/deps/v8/src/visitors.h @@ -13,45 +13,42 @@ namespace internal { class CodeDataContainer; class Object; -#define ROOT_ID_LIST(V) \ - V(kStringTable, "string_table", "(Internalized strings)") \ - V(kExternalStringsTable, "external_strings_table", "(External strings)") \ - V(kStrongRootList, "strong_root_list", "(Strong roots)") \ - V(kSmiRootList, "smi_root_list", "(Smi roots)") \ - V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \ - V(kTop, "top", "(Isolate)") \ - V(kRelocatable, "relocatable", "(Relocatable)") \ - V(kDebug, "debug", "(Debugger)") \ - V(kCompilationCache, "compilationcache", "(Compilation cache)") \ - V(kHandleScope, "handlescope", "(Handle scope)") \ - V(kDispatchTable, "dispatchtable", "(Dispatch table)") \ - V(kBuiltins, "builtins", "(Builtins)") \ - V(kGlobalHandles, "globalhandles", "(Global handles)") \ - V(kEternalHandles, "eternalhandles", "(Eternal handles)") \ - V(kThreadManager, "threadmanager", "(Thread manager)") \ - V(kStrongRoots, "strong roots", "(Strong roots)") \ - V(kExtensions, "Extensions", "(Extensions)") +#define ROOT_ID_LIST(V) \ + V(kStringTable, "(Internalized strings)") \ + V(kExternalStringsTable, "(External strings)") \ + V(kStrongRootList, "(Strong roots)") \ + V(kSmiRootList, "(Smi roots)") \ + V(kBootstrapper, "(Bootstrapper)") \ + V(kTop, "(Isolate)") \ + V(kRelocatable, "(Relocatable)") \ + V(kDebug, "(Debugger)") \ + V(kCompilationCache, "(Compilation cache)") \ + V(kHandleScope, "(Handle scope)") \ + V(kDispatchTable, "(Dispatch table)") \ + V(kBuiltins, "(Builtins)") \ + V(kGlobalHandles, "(Global handles)") \ + V(kEternalHandles, "(Eternal handles)") \ + V(kThreadManager, "(Thread manager)") \ + V(kStrongRoots, "(Strong roots)") \ + V(kExtensions, "(Extensions)") \ + V(kCodeFlusher, "(Code flusher)") \ + V(kPartialSnapshotCache, "(Partial snapshot cache)") \ + V(kWeakCollections, "(Weak collections)") \ + V(kWrapperTracing, "(Wrapper tracing)") \ + V(kUnknown, "(Unknown)") class VisitorSynchronization : public AllStatic { public: -#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item, +#define DECLARE_ENUM(enum_item, ignore) enum_item, enum SyncTag { ROOT_ID_LIST(DECLARE_ENUM) kNumberOfSyncTags }; #undef DECLARE_ENUM - - static const char* const kTags[kNumberOfSyncTags]; - static const char* const kTagNames[kNumberOfSyncTags]; }; enum class Root { -#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item, +#define DECLARE_ENUM(enum_item, ignore) enum_item, ROOT_ID_LIST(DECLARE_ENUM) #undef DECLARE_ENUM - // TODO(ulan): Merge with the ROOT_ID_LIST. - kCodeFlusher, - kPartialSnapshotCache, - kWeakCollections, - kWrapperTracing, - kUnknown + kNumberOfRoots }; // Abstract base class for visiting, and optionally modifying, the @@ -62,11 +59,13 @@ class RootVisitor BASE_EMBEDDED { // Visits a contiguous arrays of pointers in the half-open range // [start, end). Any or all of the values may be modified on return. - virtual void VisitRootPointers(Root root, Object** start, Object** end) = 0; + virtual void VisitRootPointers(Root root, const char* description, + Object** start, Object** end) = 0; // Handy shorthand for visiting a single pointer. - virtual void VisitRootPointer(Root root, Object** p) { - VisitRootPointers(root, p, p + 1); + virtual void VisitRootPointer(Root root, const char* description, + Object** p) { + VisitRootPointers(root, description, p, p + 1); } // Intended for serialization/deserialization checking: insert, or @@ -74,6 +73,8 @@ class RootVisitor BASE_EMBEDDED { // Also used for marking up GC roots in heap snapshots. // TODO(ulan): Remove this. virtual void Synchronize(VisitorSynchronization::SyncTag tag) {} + + static const char* RootName(Root root); }; // Abstract base class for visiting, and optionally modifying, the |