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

Unified Diff: Source/platform/heap/ThreadState.cpp

Issue 468083002: Reapply: [oilpan]: Change marking to do precise roots first and conservative (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 4 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 | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index e216517b19c34c3a55e56ea1cb3e2653b4621247..1d63ae03a8e385f9488fde3945a09f569e285277 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -447,7 +447,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.
@@ -459,17 +459,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
- // 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
@@ -503,6 +500,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
@@ -547,13 +547,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.
« no previous file with comments | « Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698