Chromium Code Reviews| Index: Source/platform/heap/Heap.h |
| diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h |
| index fd8da32387b87e85ca04f5ca93267a7104388095..3b6a3b026e4e37f91f676b56c18db22cd4ef40d3 100644 |
| --- a/Source/platform/heap/Heap.h |
| +++ b/Source/platform/heap/Heap.h |
| @@ -57,6 +57,17 @@ const size_t blinkPageBaseMask = ~blinkPageOffsetMask; |
| // away the page tables and lead to bad performance. |
| const size_t blinkPagesPerRegion = 10; |
| +// TODO(nya): Replace this with something like #if ENABLE_NACL. |
| +#if 0 |
|
sof
2015/08/16 16:41:56
will be adjusted/fixed before landing, presumably?
|
| +// NaCl's system page size is 64 KB. This causes a problem in Oilpan's heap |
| +// layout because Oilpan allocates two guard pages for each blink page |
| +// (whose size is 128 KB). After a couple of discussions, we decided not |
|
sof
2015/08/16 16:41:56
Just saying that the address space expenditure wou
|
| +// to use guard pages in NaCl. |
| +const size_t blinkGuardPageSize = 0; |
| +#else |
| +const size_t blinkGuardPageSize = WTF::kSystemPageSize; |
| +#endif |
| + |
| // Double precision floats are more efficient when 8 byte aligned, so we 8 byte |
| // align all allocations even on 32 bit. |
| const size_t allocationGranularity = 8; |
| @@ -298,7 +309,7 @@ private: |
| // Blink heap pages are set up with a guard page before and after the payload. |
| inline size_t blinkPagePayloadSize() |
| { |
| - return blinkPageSize - 2 * WTF::kSystemPageSize; |
| + return blinkPageSize - 2 * blinkGuardPageSize; |
| } |
| // Blink heap pages are aligned to the Blink heap page size. |
| @@ -331,7 +342,7 @@ inline bool vTableInitialized(void* objectPointer) |
| // aligned. |
| inline bool isPageHeaderAddress(Address address) |
| { |
| - return !((reinterpret_cast<uintptr_t>(address) & blinkPageOffsetMask) - WTF::kSystemPageSize); |
| + return !((reinterpret_cast<uintptr_t>(address) & blinkPageOffsetMask) - blinkGuardPageSize); |
| } |
| #endif |
| @@ -806,7 +817,7 @@ private: |
| PLATFORM_EXPORT inline BasePage* pageFromObject(const void* object) |
| { |
| Address address = reinterpret_cast<Address>(const_cast<void*>(object)); |
| - BasePage* page = reinterpret_cast<BasePage*>(blinkPageAddress(address) + WTF::kSystemPageSize); |
| + BasePage* page = reinterpret_cast<BasePage*>(blinkPageAddress(address) + blinkGuardPageSize); |
| ASSERT(page->contains(address)); |
| return page; |
| } |