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

Unified Diff: src/objects.h

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 8 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/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 14b1c57c37e0e68a62fd8c7edcc5974887769955..1bd2846185f017bd6837f42323d38cad3866e7c0 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -952,6 +952,7 @@ class ObjectHashTable;
class ObjectVisitor;
class PropertyCell;
class PropertyDescriptor;
+class RootVisitor;
class SafepointEntry;
class SharedFunctionInfo;
class StringStream;
@@ -8756,16 +8757,16 @@ class Relocatable BASE_EMBEDDED {
public:
explicit inline Relocatable(Isolate* isolate);
inline virtual ~Relocatable();
- virtual void IterateInstance(ObjectVisitor* v) { }
+ virtual void IterateInstance(RootVisitor* v) {}
virtual void PostGarbageCollection() { }
static void PostGarbageCollectionProcessing(Isolate* isolate);
static int ArchiveSpacePerThread();
static char* ArchiveState(Isolate* isolate, char* to);
static char* RestoreState(Isolate* isolate, char* from);
- static void Iterate(Isolate* isolate, ObjectVisitor* v);
- static void Iterate(ObjectVisitor* v, Relocatable* top);
- static char* Iterate(ObjectVisitor* v, char* t);
+ static void Iterate(Isolate* isolate, RootVisitor* v);
+ static void Iterate(RootVisitor* v, Relocatable* top);
+ static char* Iterate(RootVisitor* v, char* t);
private:
Isolate* isolate_;
@@ -10195,40 +10196,9 @@ class SourcePositionTableWithFrameCache : public Tuple2 {
DISALLOW_IMPLICIT_CONSTRUCTORS(SourcePositionTableWithFrameCache);
};
-#define VISITOR_SYNCHRONIZATION_TAGS_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)")
-
-class VisitorSynchronization : public AllStatic {
- public:
-#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
- enum SyncTag {
- VISITOR_SYNCHRONIZATION_TAGS_LIST(DECLARE_ENUM)
- kNumberOfSyncTags
- };
-#undef DECLARE_ENUM
-
- static const char* const kTags[kNumberOfSyncTags];
- static const char* const kTagNames[kNumberOfSyncTags];
-};
-
// Abstract base class for visiting, and optionally modifying, the
// pointers contained in Objects. Used in GC and serialization/deserialization.
+// TODO(ulan): move to src/visitors.h
class ObjectVisitor BASE_EMBEDDED {
public:
virtual ~ObjectVisitor() {}
@@ -10276,11 +10246,6 @@ class ObjectVisitor BASE_EMBEDDED {
// Visits an (encoded) internal reference.
virtual void VisitInternalReference(RelocInfo* rinfo) {}
-
- // Intended for serialization/deserialization checking: insert, or
- // check for the presence of, a tag at this position in the stream.
- // Also used for marking up GC roots in heap snapshots.
- virtual void Synchronize(VisitorSynchronization::SyncTag tag) {}
};
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698