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

Unified Diff: Source/platform/heap/Visitor.h

Issue 818253005: Oilpan: Query stack frame register instead of manual bookkeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ENABLE(STACKFRAME_POINTER_ESTIMATION) Created 5 years, 11 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
Index: Source/platform/heap/Visitor.h
diff --git a/Source/platform/heap/Visitor.h b/Source/platform/heap/Visitor.h
index e0511aef6949441b6ed38e714feb8a0885cd4f4d..2d4abda845b3f2d7d30bba6409fec68aeae313d2 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -32,6 +32,7 @@
#define Visitor_h
#include "platform/PlatformExport.h"
+#include "platform/heap/StackFrameDepth.h"
#include "platform/heap/ThreadState.h"
#include "wtf/Assertions.h"
#include "wtf/Deque.h"
@@ -614,18 +615,25 @@ public:
}
#endif
- inline bool canTraceEagerly() const { return m_traceDepth < kMaxEagerTraceDepth; }
- inline void incrementTraceDepth() { m_traceDepth++; }
- inline void decrementTraceDepth() { ASSERT(m_traceDepth > 0); m_traceDepth--; }
+ inline bool canTraceEagerly() const
+ {
+ ASSERT(m_traceDepth);
+ return m_traceDepth->isSafeToRecurse();
+ }
+
+ inline void configureEagerTraceLimit()
+ {
+ if (!m_traceDepth)
+ m_traceDepth = new StackFrameDepth;
+ m_traceDepth->configureLimit();
+ }
inline bool isGlobalMarkingVisitor() const { return m_isGlobalMarkingVisitor; }
protected:
explicit Visitor(VisitorType type)
: m_isGlobalMarkingVisitor(type == GlobalMarkingVisitorType)
- {
- m_traceDepth = 0;
- }
+ { }
virtual void registerWeakCellWithCallback(void**, WeakPointerCallback) = 0;
#if ENABLE(GC_PROFILE_MARKING)
@@ -639,11 +647,7 @@ protected:
#endif
private:
- // The maximum depth of eager, unrolled trace() calls that is
- // considered safe and allowed.
- const int kMaxEagerTraceDepth = 100;
-
- static int m_traceDepth;
+ static StackFrameDepth* m_traceDepth;
haraken 2015/01/08 01:14:23 m_traceDepth => m_stackFrameDepth
kouhei (in TOK) 2015/01/08 03:29:55 Done.
bool m_isGlobalMarkingVisitor;
};
@@ -710,9 +714,7 @@ public:
ASSERT(visitor->canTraceEagerly());
if (LIKELY(visitor->canTraceEagerly())) {
if (visitor->ensureMarked(t)) {
- visitor->incrementTraceDepth();
TraceTrait<T>::trace(visitor, const_cast<T*>(t));
- visitor->decrementTraceDepth();
}
return;
}

Powered by Google App Engine
This is Rietveld 408576698