Index: Source/platform/heap/ThreadState.cpp |
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp |
index 63a9c5058b2d1e13bb9808a221bf7e0e76bf0f2c..581aee1e7d67f5ce58f9d21cf8f695c6468224eb 100644 |
--- a/Source/platform/heap/ThreadState.cpp |
+++ b/Source/platform/heap/ThreadState.cpp |
@@ -446,7 +446,7 @@ void ThreadState::detach() |
shutdownHeapIfNecessary(); |
} |
-void ThreadState::visitRoots(Visitor* visitor) |
+void ThreadState::visitPersistentRoots(Visitor* visitor) |
{ |
{ |
// All threads are at safepoints so this is not strictly necessary. |
@@ -458,17 +458,14 @@ void ThreadState::visitRoots(Visitor* visitor) |
AttachedThreadStateSet& threads = attachedThreads(); |
for (AttachedThreadStateSet::iterator it = threads.begin(), end = threads.end(); it != end; ++it) |
- (*it)->trace(visitor); |
+ (*it)->visitPersistents(visitor); |
} |
-void ThreadState::visitLocalRoots(Visitor* visitor) |
+void ThreadState::visitStackRoots(Visitor* visitor) |
{ |
- // We assume that orphaned pages have no objects reachable from persistent |
- // handles on other threads or CrossThreadPersistents. The only cases where |
Erik Corry
2014/07/22 12:39:27
This comment was just deleted, but it looks helpfu
wibling-chromium
2014/07/22 12:46:33
I too found it useful:) I did move it to CollectGa
|
- // this could happen is if a global conservative GC finds a "pointer" on |
- // the stack or due to a programming error where an object has a dangling |
- // cross-thread pointer to an object on this heap. |
- m_persistents->trace(visitor); |
+ AttachedThreadStateSet& threads = attachedThreads(); |
+ for (AttachedThreadStateSet::iterator it = threads.begin(), end = threads.end(); it != end; ++it) |
+ (*it)->visitStack(visitor); |
} |
NO_SANITIZE_ADDRESS |
@@ -502,6 +499,9 @@ void ThreadState::visitAsanFakeStackForPointer(Visitor* visitor, Address ptr) |
NO_SANITIZE_ADDRESS |
void ThreadState::visitStack(Visitor* visitor) |
{ |
+ if (m_stackState == NoHeapPointersOnStack) |
+ return; |
+ |
Address* start = reinterpret_cast<Address*>(m_startOfStack); |
// If there is a safepoint scope marker we should stop the stack |
// scanning there to not touch active parts of the stack. Anything |
@@ -546,13 +546,6 @@ void ThreadState::visitPersistents(Visitor* visitor) |
m_persistents->trace(visitor); |
} |
-void ThreadState::trace(Visitor* visitor) |
-{ |
- if (m_stackState == HeapPointersOnStack) |
- visitStack(visitor); |
- visitPersistents(visitor); |
-} |
- |
bool ThreadState::checkAndMarkPointer(Visitor* visitor, Address address) |
{ |
// If thread is terminating ignore conservative pointers. |