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

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

Issue 1749103005: Revert of Use a bitmap to record PageMemoryRegion usage. (Closed) 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/PageMemory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/PageMemory.h
diff --git a/third_party/WebKit/Source/platform/heap/PageMemory.h b/third_party/WebKit/Source/platform/heap/PageMemory.h
index 3bf0e5db6d67844f0462b5a1cf48e7bf04607885..61b7038743f502188ed2a2fea67a378c927a6e85 100644
--- a/third_party/WebKit/Source/platform/heap/PageMemory.h
+++ b/third_party/WebKit/Source/platform/heap/PageMemory.h
@@ -68,13 +68,13 @@
void markPageUsed(Address page)
{
- ASSERT(!(m_inUseBitmap & index(page)));
- m_inUseBitmap |= index(page);
+ ASSERT(!m_inUse[index(page)]);
+ m_inUse[index(page)] = true;
}
void markPageUnused(Address page)
{
- m_inUseBitmap &= ~index(page);
+ m_inUse[index(page)] = false;
}
static PageMemoryRegion* allocateLargePage(size_t size)
@@ -90,7 +90,7 @@
BasePage* pageFromAddress(Address address)
{
ASSERT(contains(address));
- if (!(m_inUseBitmap & index(address)))
+ if (!m_inUse[index(address)])
return nullptr;
if (m_isLargePage)
return pageFromObject(base());
@@ -100,22 +100,20 @@
private:
PageMemoryRegion(Address base, size_t, unsigned numPages);
- // Returns word with the bit set which corresponds to the |address|'
- // page within a region.
- unsigned index(Address address) const
+ unsigned index(Address address)
{
ASSERT(contains(address));
if (m_isLargePage)
- return 0x1;
+ return 0;
size_t offset = blinkPageAddress(address) - base();
ASSERT(offset % blinkPageSize == 0);
- return 0x1 << (offset / blinkPageSize);
+ return offset / blinkPageSize;
}
static PageMemoryRegion* allocate(size_t, unsigned numPages);
bool m_isLargePage;
- unsigned m_inUseBitmap;
+ bool m_inUse[blinkPagesPerRegion];
unsigned m_numPages;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/PageMemory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698