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

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

Issue 1884083002: Revert of Rename Heap to ThreadHeap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/Handle.h ('k') | third_party/WebKit/Source/platform/heap/Heap.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/Heap.h
diff --git a/third_party/WebKit/Source/platform/heap/Heap.h b/third_party/WebKit/Source/platform/heap/Heap.h
index 46310db51ac9a437ab3224dd02a4ab11e6db3724..0d268b05dcbec35ac8c3fee801d8f5733f39bdd4 100644
--- a/third_party/WebKit/Source/platform/heap/Heap.h
+++ b/third_party/WebKit/Source/platform/heap/Heap.h
@@ -171,8 +171,8 @@
double m_estimatedMarkingTimePerByte;
};
-class PLATFORM_EXPORT ThreadHeap {
- STATIC_ONLY(ThreadHeap);
+class PLATFORM_EXPORT Heap {
+ STATIC_ONLY(Heap);
public:
static void init();
static void shutdown();
@@ -234,7 +234,7 @@
return false;
ASSERT(page->arena()->getThreadState()->isSweepingInProgress());
- return !ThreadHeap::isHeapObjectAlive(const_cast<T*>(objectPointer));
+ return !Heap::isHeapObjectAlive(const_cast<T*>(objectPointer));
}
// Push a trace callback on the marking stack.
@@ -411,7 +411,7 @@
static void* allocateObject(size_t size, bool eagerlySweep)
{
- return ThreadHeap::allocate<T>(size, eagerlySweep);
+ return Heap::allocate<T>(size, eagerlySweep);
}
void operator delete(void* p)
@@ -444,7 +444,7 @@
// for a class.
//
-inline int ThreadHeap::arenaIndexForObjectSize(size_t size)
+inline int Heap::arenaIndexForObjectSize(size_t size)
{
if (size < 64) {
if (size < 32)
@@ -456,7 +456,7 @@
return BlinkGC::NormalPage4ArenaIndex;
}
-inline bool ThreadHeap::isNormalArenaIndex(int index)
+inline bool Heap::isNormalArenaIndex(int index)
{
return index >= BlinkGC::NormalPage1ArenaIndex && index <= BlinkGC::NormalPage4ArenaIndex;
}
@@ -496,7 +496,7 @@
#define EAGERLY_FINALIZE() typedef int IsEagerlyFinalizedMarker
#endif
-inline Address ThreadHeap::allocateOnArenaIndex(ThreadState* state, size_t size, int arenaIndex, size_t gcInfoIndex, const char* typeName)
+inline Address Heap::allocateOnArenaIndex(ThreadState* state, size_t size, int arenaIndex, size_t gcInfoIndex, const char* typeName)
{
ASSERT(state->isAllocationAllowed());
ASSERT(arenaIndex != BlinkGC::LargeObjectArenaIndex);
@@ -507,15 +507,15 @@
}
template<typename T>
-Address ThreadHeap::allocate(size_t size, bool eagerlySweep)
+Address Heap::allocate(size_t size, bool eagerlySweep)
{
ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(T);
- return ThreadHeap::allocateOnArenaIndex(state, size, eagerlySweep ? BlinkGC::EagerSweepArenaIndex : ThreadHeap::arenaIndexForObjectSize(size), GCInfoTrait<T>::index(), typeName);
+ return Heap::allocateOnArenaIndex(state, size, eagerlySweep ? BlinkGC::EagerSweepArenaIndex : Heap::arenaIndexForObjectSize(size), GCInfoTrait<T>::index(), typeName);
}
template<typename T>
-Address ThreadHeap::reallocate(void* previous, size_t size)
+Address Heap::reallocate(void* previous, size_t size)
{
// Not intended to be a full C realloc() substitute;
// realloc(nullptr, size) is not a supported alias for malloc(size).
@@ -537,11 +537,11 @@
arenaIndex = arenaIndexForObjectSize(size);
// TODO(haraken): We don't support reallocate() for finalizable objects.
- ASSERT(!ThreadHeap::gcInfo(previousHeader->gcInfoIndex())->hasFinalizer());
+ ASSERT(!Heap::gcInfo(previousHeader->gcInfoIndex())->hasFinalizer());
ASSERT(previousHeader->gcInfoIndex() == GCInfoTrait<T>::index());
const char* typeName = WTF_HEAP_PROFILER_TYPE_NAME(T);
HeapAllocHooks::freeHookIfEnabled(static_cast<Address>(previous));
- Address address = ThreadHeap::allocateOnArenaIndex(state, size, arenaIndex, GCInfoTrait<T>::index(), typeName);
+ Address address = Heap::allocateOnArenaIndex(state, size, arenaIndex, GCInfoTrait<T>::index(), typeName);
size_t copySize = previousHeader->payloadSize();
if (copySize > size)
copySize = size;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Handle.h ('k') | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698