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

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

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/HeapPage.h
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index a006d41adf842693779de4f04436644eacf6caf0..4e9d5405fc8f663453249fac852ae7073da777e2 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -308,6 +308,9 @@ class FreeListEntry final : public HeapObjectHeader {
FreeListEntry* next() const { return m_next; }
NO_SANITIZE_ADDRESS
+ FreeListEntry** prevNext() { return &m_next; }
+
+ NO_SANITIZE_ADDRESS
void append(FreeListEntry* next) {
ASSERT(!m_next);
m_next = next;
@@ -512,6 +515,8 @@ class NormalPage final : public BasePage {
inline NormalPageArena* arenaForNormalPage() const;
+ size_t sweepCompact(NormalPage*&, BasePage**, size_t);
haraken 2016/12/02 12:43:20 sweepAndCompact ?
+
private:
HeapObjectHeader* findHeaderFromAddress(Address);
void populateObjectStartBitMap();
@@ -665,6 +670,8 @@ class FreeList {
// All FreeListEntries in the nth list have size >= 2^n.
FreeListEntry* m_freeLists[blinkPageSizeLog2];
+ size_t size() const;
haraken 2016/12/02 12:43:20 size => freeListSize ? (since size() is used in va
sof 2016/12/04 14:55:38 That's better, done.
+
friend class NormalPageArena;
};
@@ -761,8 +768,15 @@ class PLATFORM_EXPORT NormalPageArena final : public BaseArena {
bool isLazySweeping() const { return m_isLazySweeping; }
void setIsLazySweeping(bool flag) { m_isLazySweeping = flag; }
+ size_t arenaSize();
+ size_t freeListSize();
+
+ void sweepCompact();
haraken 2016/12/02 12:43:20 sweepAndCompact ?
sof 2016/12/04 14:55:38 Done.
+
private:
- void allocatePage();
+ NormalPage* allocatePage();
+ void allocateAndAddPage();
+
Address outOfLineAllocate(size_t allocationSize, size_t gcInfoIndex);
Address allocateFromFreeList(size_t, size_t gcInfoIndex);

Powered by Google App Engine
This is Rietveld 408576698