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

Unified Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 2015173003: Address ThreadHeap::willObjectBeLazilySwept() corner case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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: third_party/WebKit/Source/platform/heap/Heap.h
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h
index e3b7bf09c8f218d57ef52c633fa6a3bf5c0ded0e..06bc3314acfeb238a5d045026c8034f304bda00f 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.h
+++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -277,11 +277,22 @@ public:
{
static_assert(IsGarbageCollectedType<T>::value, "only objects deriving from GarbageCollected can be used.");
BasePage* page = pageFromObject(objectPointer);
+ // Page has been swept and it is still alive.
if (page->hasBeenSwept())
return false;
ASSERT(page->arena()->getThreadState()->isSweepingInProgress());
- return !ThreadHeap::isHeapObjectAlive(const_cast<T*>(objectPointer));
+ // If marked and alive, the object hasn't yet been swept..and won't
+ // be once its page is processed.
+ if (ThreadHeap::isHeapObjectAlive(const_cast<T*>(objectPointer)))
+ return false;
+
+ if (page->isLargeObjectPage())
+ return true;
+
+ // If the object is unmarked, it may be on the page currently being
+ // lazily swept.
+ return page->arena()->willObjectBeLazilySwept(page, const_cast<T*>(objectPointer));
}
// Push a trace callback on the marking stack.

Powered by Google App Engine
This is Rietveld 408576698