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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: synchronize on compaction finish 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 bc83a90b9886d3b9b3a41c77f2e50dee28f1a5de..aa0f8d765ec99f2b45b19feca258d735b07663aa 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,28 @@ 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) {
+ compaction()->registerMovingObjectReference(slot);
haraken 2016/12/02 12:43:19 DCHECK(*slot) ?
sof 2016/12/04 14:55:37 Extended to (slot && *slot).
+}
+
+void ThreadHeap::registerMovingObjectCallback(MovableReference reference,
+ MovingObjectCallback callback,
+ void* callbackData) {
+ DCHECK(reference);
+ compaction()->registerMovingObjectCallback(reference, callback, callbackData);
+}
+
+void ThreadHeap::registerRelocation(MovableReference* slot) {
+ DCHECK(slot);
haraken 2016/12/02 12:43:19 Do you want to mean DCHECK(*slot) ?
sof 2016/12/04 14:55:37 Done.
+ compaction()->registerRelocation(slot);
+}
+
void ThreadHeap::decommitCallbackStacks() {
m_markingStack->decommit();
m_postMarkingCallbackStack->decommit();

Powered by Google App Engine
This is Rietveld 408576698