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

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

Issue 371623002: [oilpan]: Make thread shutdown more robust. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review feedback Created 6 years, 5 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 ffadc80fe99aa42561c757d29f9432d498d39a52..3568e14a07b7f272df4598db4eabe7b031a0eab4 100644
--- a/Source/platform/heap/Visitor.h
+++ b/Source/platform/heap/Visitor.h
@@ -594,8 +594,18 @@ class DefaultTraceTrait<T, true> {
public:
static void mark(Visitor* visitor, const T* self)
{
- if (self)
- self->adjustAndMark(visitor);
+ if (!self)
+ return;
+
+ // Before doing adjustAndMark we need to check if the page is orphaned
+ // since we cannot call adjustAndMark if so, as there will be no vtable.
+ // If orphaned just mark the page as traced.
+ BaseHeapPage* heapPage = pageHeaderFromObject(self);
+ if (heapPage->orphaned()) {
haraken 2014/07/09 05:17:49 Just to confirm: Is this the only place where we h
wibling-chromium 2014/07/09 10:32:31 AFAICT we can get away with just checking here for
haraken 2014/07/13 17:30:38 Just to help me understand, imagine the following
wibling-chromium 2014/07/14 08:06:11 We don't want to continue tracing from X to Y. If
+ heapPage->setTraced();
+ return;
+ }
+ self->adjustAndMark(visitor);
}
#ifndef NDEBUG

Powered by Google App Engine
This is Rietveld 408576698