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

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

Issue 2652923002: Devirtualize Visitor and remove inline visitor specialization. (Closed)
Patch Set: rebased Created 3 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapPage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Heap.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index 22e5ef818fadfd6d85f53922ff8256e08e2fa5b5..7dd5529466edbef3408790ab41b17e360efa0f3e 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -36,7 +36,6 @@
#include "platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/CallbackStack.h"
#include "platform/heap/HeapCompact.h"
-#include "platform/heap/MarkingVisitor.h"
#include "platform/heap/PageMemory.h"
#include "platform/heap/PagePool.h"
#include "platform/heap/SafePoint.h"
@@ -316,6 +315,30 @@ Address ThreadHeap::checkAndMarkPointer(Visitor* visitor, Address address) {
return nullptr;
}
+#if DCHECK_IS_ON()
+// To support unit testing of the marking of off-heap root references
+// into the heap, provide a checkAndMarkPointer() version with an
+// extra notification argument.
+Address ThreadHeap::checkAndMarkPointer(
+ Visitor* visitor,
+ Address address,
+ MarkedPointerCallbackForTesting callback) {
+ DCHECK(ThreadState::current()->isInGC());
+
+ if (BasePage* page = lookupPageForAddress(address)) {
+ DCHECK(page->contains(address));
+ DCHECK(!page->orphaned());
+ DCHECK(!m_heapDoesNotContainCache->lookup(address));
+ DCHECK(&visitor->heap() == &page->arena()->getThreadState()->heap());
+ page->checkAndMarkPointer(visitor, address, callback);
+ return address;
+ }
+ if (!m_heapDoesNotContainCache->lookup(address))
+ m_heapDoesNotContainCache->addEntry(address);
+ return nullptr;
+}
+#endif
+
void ThreadHeap::pushTraceCallback(void* object, TraceCallback callback) {
ASSERT(ThreadState::current()->isInGC());
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapPage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698