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

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

Issue 2019273002: Make reallocation of large objects reliable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/Source/platform/heap/HeapPage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/HeapPage.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapPage.cpp b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
index 26b243d70cc495b482714d4972ec5b6de0b8b080..18e7458187c12776d8922f17bca8914ea4504b28 100644
--- a/third_party/WebKit/Source/platform/heap/HeapPage.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapPage.cpp
@@ -343,6 +343,16 @@ void BaseArena::completeSweep()
ThreadHeap::reportMemoryUsageForTracing();
}
+Address BaseArena::allocateLargeObject(size_t allocationSize, size_t gcInfoIndex)
+{
+ // TODO(sof): should need arise, support eagerly finalized large objects.
+ CHECK(arenaIndex() != BlinkGC::EagerSweepArenaIndex);
+ LargeObjectArena* largeObjectArena = static_cast<LargeObjectArena*>(getThreadState()->arena(BlinkGC::LargeObjectArenaIndex));
+ Address largeObject = largeObjectArena -> allocateLargeObjectPage(allocationSize, gcInfoIndex);
+ ASAN_MARK_LARGE_VECTOR_CONTAINER(this, largeObject);
+ return largeObject;
+}
+
NormalPageArena::NormalPageArena(ThreadState* state, int index)
: BaseArena(state, index)
, m_currentAllocationPoint(nullptr)
@@ -682,14 +692,8 @@ Address NormalPageArena::outOfLineAllocate(size_t allocationSize, size_t gcInfoI
ASSERT(allocationSize >= allocationGranularity);
// 1. If this allocation is big enough, allocate a large object.
- if (allocationSize >= largeObjectSizeThreshold) {
- // TODO(sof): support eagerly finalized large objects, if ever needed.
- RELEASE_ASSERT(arenaIndex() != BlinkGC::EagerSweepArenaIndex);
- LargeObjectArena* largeObjectArena = static_cast<LargeObjectArena*>(getThreadState()->arena(BlinkGC::LargeObjectArenaIndex));
- Address largeObject = largeObjectArena->allocateLargeObjectPage(allocationSize, gcInfoIndex);
- ASAN_MARK_LARGE_VECTOR_CONTAINER(this, largeObject);
- return largeObject;
- }
+ if (allocationSize >= largeObjectSizeThreshold)
+ return allocateLargeObject(allocationSize, gcInfoIndex);
// 2. Try to allocate from a free list.
updateRemainingAllocationSize();
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapPage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698