Chromium Code Reviews| Index: Source/platform/heap/Visitor.h |
| diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h |
| index f0b9ed70b31598dee872e40a39293c0055631ad8..c4fe24d4d405ab1584cace4edd7d812abcb4c107 100644 |
| --- a/Source/platform/heap/Visitor.h |
| +++ b/Source/platform/heap/Visitor.h |
| @@ -264,6 +264,11 @@ struct ObjectAliveTrait { |
| // contained pointers and push them on the marking stack. |
| class PLATFORM_EXPORT Visitor { |
| public: |
| + enum VisitorType { |
| + GlobalMarkingVisitorType, |
| + GenericVisitorType, |
| + }; |
| + |
| virtual ~Visitor() { } |
| // One-argument templated mark method. This uses the static type of |
| @@ -531,9 +536,12 @@ public: |
| inline void incrementTraceDepth() { m_traceDepth++; } |
| inline void decrementTraceDepth() { ASSERT(m_traceDepth > 0); m_traceDepth--; } |
| + inline bool isGlobalMarkingVisitor() const { return m_isGlobalMarkingVisitor; } |
| + |
| protected: |
| - Visitor() |
| + Visitor(VisitorType type) |
|
haraken
2014/12/16 06:53:30
Add explicit
kouhei (in TOK)
2014/12/16 06:58:27
Done.
|
| : m_traceDepth(0) |
| + , m_isGlobalMarkingVisitor(type == GlobalMarkingVisitorType) |
| { |
| } |
| @@ -557,6 +565,7 @@ private: |
| const int kMaxEagerTraceDepth = 100; |
| int m_traceDepth; |
| + bool m_isGlobalMarkingVisitor; |
|
haraken
2014/12/16 06:53:29
Can we store m_visitorType, instead of m_isGlobalM
kouhei (in TOK)
2014/12/16 06:58:27
"type == GlobalMarkingVisitorType" is slower than
|
| }; |
| // We trace vectors by using the trace trait on each element, which means you |