Commit 70f22dbd authored by haraken@chromium.org's avatar haraken@chromium.org

Oilpan: We shouldn't calculate allocationSizeFromSize twice

Currently we calculate allocationSizeFromSize twice in Heap::allocate()
and Heap::outOfLineAllocate(). This CL removes the redundancy.

BUG=420515

Review URL: https://codereview.chromium.org/730443002

git-svn-id: svn://svn.chromium.org/blink/trunk@185355 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0f24a5ef
......@@ -701,9 +701,8 @@ void ThreadHeap<Header>::updateRemainingAllocationSize()
}
template<typename Header>
Address ThreadHeap<Header>::outOfLineAllocate(size_t size, const GCInfo* gcInfo)
Address ThreadHeap<Header>::outOfLineAllocate(size_t payloadSize, size_t allocationSize, const GCInfo* gcInfo)
{
size_t allocationSize = allocationSizeFromSize(size);
ASSERT(allocationSize > remainingAllocationSize());
if (allocationSize > blinkPageSize / 2)
return allocateLargeObject(allocationSize, gcInfo);
......@@ -720,7 +719,7 @@ Address ThreadHeap<Header>::outOfLineAllocate(size_t size, const GCInfo* gcInfo)
setAllocationPoint(0, 0);
}
ensureCurrentAllocation(allocationSize, gcInfo);
return allocate(size, gcInfo);
return allocate(payloadSize, gcInfo);
}
template<typename Header>
......
......@@ -820,7 +820,7 @@ public:
private:
void addPageToHeap(const GCInfo*);
PLATFORM_EXPORT Address outOfLineAllocate(size_t, const GCInfo*);
PLATFORM_EXPORT Address outOfLineAllocate(size_t payloadSize, size_t allocationSize, const GCInfo*);
static size_t allocationSizeFromSize(size_t);
PLATFORM_EXPORT Address allocateLargeObject(size_t, const GCInfo*);
Address currentAllocationPoint() const { return m_currentAllocationPoint; }
......@@ -1401,7 +1401,7 @@ Address ThreadHeap<Header>::allocate(size_t size, const GCInfo* gcInfo)
ASSERT(heapPageFromAddress(headerAddress + allocationSize - 1));
return result;
}
return outOfLineAllocate(size, gcInfo);
return outOfLineAllocate(size, allocationSize, gcInfo);
}
template<typename T, typename HeapTraits>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment