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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: rebased upto r438110 Created 4 years 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.cpp
diff --git a/third_party/WebKit/Source/platform/heap/Heap.cpp b/third_party/WebKit/Source/platform/heap/Heap.cpp
index b1c035cc51b9069d6c31f29de13d8d4a0e59ecd9..c44068b3756f3ada687e55f6f33ac912a7406f87 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.cpp
+++ b/third_party/WebKit/Source/platform/heap/Heap.cpp
@@ -35,6 +35,7 @@
#include "platform/ScriptForbiddenScope.h"
#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"
@@ -412,6 +413,25 @@ void ThreadHeap::commitCallbackStacks() {
m_ephemeronStack->commit();
}
+HeapCompact* ThreadHeap::compaction() {
+ if (!m_compaction)
+ m_compaction = HeapCompact::create();
+ return m_compaction.get();
+}
+
+void ThreadHeap::registerMovingObjectReference(MovableReference* slot) {
+ DCHECK(slot);
+ DCHECK(*slot);
+ compaction()->registerMovingObjectReference(slot);
+}
+
+void ThreadHeap::registerMovingObjectCallback(MovableReference reference,
+ MovingObjectCallback callback,
+ void* callbackData) {
+ DCHECK(reference);
+ compaction()->registerMovingObjectCallback(reference, callback, callbackData);
+}
+
void ThreadHeap::decommitCallbackStacks() {
m_markingStack->decommit();
m_postMarkingCallbackStack->decommit();
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | third_party/WebKit/Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698