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

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

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/HeapPage.h
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.h b/third_party/WebKit/Source/platform/heap/HeapPage.h
index 683c3dae182954ba7fbe09f3e69e5f5850027c02..16d5802f7be06bb7db0094c3ddbae002fb24980f 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.h
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.h
@@ -125,7 +125,7 @@ const uint8_t reuseForbiddenZapValue = 0x2c;
class CallbackStack;
class FreePagePool;
-class NormalPageHeap;
+class NormalPageArena;
class OrphanedPagePool;
class PageMemory;
class PageMemoryRegion;
@@ -352,7 +352,7 @@ inline bool isPageHeaderAddress(Address address)
class BasePage {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
- BasePage(PageMemory*, BaseHeap*);
+ BasePage(PageMemory*, BaseArena*);
virtual ~BasePage() { }
void link(BasePage** previousNext)
@@ -408,8 +408,8 @@ public:
Address address() { return reinterpret_cast<Address>(this); }
PageMemory* storage() const { return m_storage; }
- BaseHeap* heap() const { return m_heap; }
- bool orphaned() { return !m_heap; }
+ BaseArena* arena() const { return m_arena; }
+ bool orphaned() { return !m_arena; }
bool terminating() { return m_terminating; }
void setTerminating() { m_terminating = true; }
@@ -430,7 +430,7 @@ public:
private:
PageMemory* m_storage;
- BaseHeap* m_heap;
+ BaseArena* m_arena;
BasePage* m_next;
// Whether the page is part of a terminating thread or not.
bool m_terminating;
@@ -441,12 +441,12 @@ private:
// Set to false at the start of a sweep, true upon completion
// of lazy sweeping.
bool m_swept;
- friend class BaseHeap;
+ friend class BaseArena;
};
class NormalPage final : public BasePage {
public:
- NormalPage(PageMemory*, BaseHeap*);
+ NormalPage(PageMemory*, BaseArena*);
Address payload()
{
@@ -492,7 +492,7 @@ public:
}
- NormalPageHeap* heapForNormalPage();
+ NormalPageArena* heapForNormalPage();
private:
HeapObjectHeader* findHeaderFromAddress(Address);
@@ -509,7 +509,7 @@ private:
// object.
class LargeObjectPage final : public BasePage {
public:
- LargeObjectPage(PageMemory*, BaseHeap*, size_t);
+ LargeObjectPage(PageMemory*, BaseArena*, size_t);
Address payload() { return heapObjectHeader()->payload(); }
size_t payloadSize() { return m_payloadSize; }
@@ -646,21 +646,21 @@ private:
// All FreeListEntries in the nth list have size >= 2^n.
FreeListEntry* m_freeLists[blinkPageSizeLog2];
- friend class NormalPageHeap;
+ friend class NormalPageArena;
};
// Each thread has a number of thread heaps (e.g., Generic heaps,
// typed heaps for Node, heaps for collection backings etc)
-// and BaseHeap represents each thread heap.
+// and BaseArena represents each thread heap.
//
-// BaseHeap is a parent class of NormalPageHeap and LargeObjectHeap.
-// NormalPageHeap represents a heap that contains NormalPages
-// and LargeObjectHeap represents a heap that contains LargeObjectPages.
-class PLATFORM_EXPORT BaseHeap {
- USING_FAST_MALLOC(BaseHeap);
+// BaseArena is a parent class of NormalPageArena and LargeObjectArena.
+// NormalPageArena represents a heap that contains NormalPages
+// and LargeObjectArena represents a heap that contains LargeObjectPages.
+class PLATFORM_EXPORT BaseArena {
+ USING_FAST_MALLOC(BaseArena);
public:
- BaseHeap(ThreadState*, int);
- virtual ~BaseHeap();
+ BaseArena(ThreadState*, int);
+ virtual ~BaseArena();
void cleanupPages();
void takeSnapshot(const String& dumpBaseName, ThreadState::GCSnapshotInfo&);
@@ -688,7 +688,7 @@ public:
void completeSweep();
ThreadState* threadState() { return m_threadState; }
- int heapIndex() const { return m_index; }
+ int arenaIndex() const { return m_index; }
protected:
BasePage* m_firstPage;
@@ -704,9 +704,9 @@ private:
int m_index;
};
-class PLATFORM_EXPORT NormalPageHeap final : public BaseHeap {
+class PLATFORM_EXPORT NormalPageArena final : public BaseArena {
public:
- NormalPageHeap(ThreadState*, int);
+ NormalPageArena(ThreadState*, int);
void addToFreeList(Address address, size_t size)
{
ASSERT(findPageFromAddress(address));
@@ -759,9 +759,9 @@ private:
size_t m_promptlyFreedSize;
};
-class LargeObjectHeap final : public BaseHeap {
+class LargeObjectArena final : public BaseArena {
public:
- LargeObjectHeap(ThreadState*, int);
+ LargeObjectArena(ThreadState*, int);
Address allocateLargeObjectPage(size_t, size_t gcInfoIndex);
void freeLargeObjectPage(LargeObjectPage*);
#if ENABLE(ASSERT)
@@ -872,7 +872,7 @@ void HeapObjectHeader::markDead()
m_encoded |= headerDeadBitMask;
}
-inline Address NormalPageHeap::allocateObject(size_t allocationSize, size_t gcInfoIndex)
+inline Address NormalPageArena::allocateObject(size_t allocationSize, size_t gcInfoIndex)
{
if (LIKELY(allocationSize <= m_remainingAllocationSize)) {
Address headerAddress = m_currentAllocationPoint;

Powered by Google App Engine
This is Rietveld 408576698