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

Unified Diff: Source/platform/heap/Heap.cpp

Issue 1149943003: Oilpan: Rename weak callback related methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index 3fef547f1660fe8dc9a2fddf735d751d6e8f191d..9c71d3bd16054a261d89a7f0f6f2881ce0e16c4c 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -1613,7 +1613,7 @@ void Heap::init()
ThreadState::init();
s_markingStack = new CallbackStack();
s_postMarkingCallbackStack = new CallbackStack();
- s_weakCallbackStack = new CallbackStack();
+ s_globalWeakCallbackStack = new CallbackStack();
s_ephemeronStack = new CallbackStack();
s_heapDoesNotContainCache = new HeapDoesNotContainCache();
s_markingVisitor = new MarkingVisitor<Visitor::GlobalMarking>();
@@ -1648,8 +1648,8 @@ void Heap::doShutdown()
s_freePagePool = nullptr;
delete s_orphanedPagePool;
s_orphanedPagePool = nullptr;
- delete s_weakCallbackStack;
- s_weakCallbackStack = nullptr;
+ delete s_globalWeakCallbackStack;
+ s_globalWeakCallbackStack = nullptr;
delete s_postMarkingCallbackStack;
s_postMarkingCallbackStack = nullptr;
delete s_markingStack;
@@ -1802,29 +1802,29 @@ bool Heap::popAndInvokePostMarkingCallback(Visitor* visitor)
return false;
}
-void Heap::pushWeakCellPointerCallback(void** cell, WeakPointerCallback callback)
+void Heap::pushGlobalWeakCallback(void** cell, WeakCallback callback)
{
ASSERT(!Heap::orphanedPagePool()->contains(cell));
- CallbackStack::Item* slot = s_weakCallbackStack->allocateEntry();
+ CallbackStack::Item* slot = s_globalWeakCallbackStack->allocateEntry();
*slot = CallbackStack::Item(cell, callback);
}
-void Heap::pushWeakPointerCallback(void* closure, void* object, WeakPointerCallback callback)
+void Heap::pushThreadLocalWeakCallback(void* closure, void* object, WeakCallback callback)
{
BasePage* page = pageFromObject(object);
ASSERT(!page->orphaned());
ThreadState* state = page->heap()->threadState();
- state->pushWeakPointerCallback(closure, callback);
+ state->pushThreadLocalWeakCallback(closure, callback);
}
-bool Heap::popAndInvokeWeakPointerCallback(Visitor* visitor)
+bool Heap::popAndInvokeGlobalWeakCallback(Visitor* visitor)
{
// For weak processing we should never reach orphaned pages since orphaned
// pages are not traced and thus objects on those pages are never be
// registered as objects on orphaned pages. We cannot assert this here
// since we might have an off-heap collection. We assert it in
- // Heap::pushWeakPointerCallback.
- if (CallbackStack::Item* item = s_weakCallbackStack->pop()) {
+ // Heap::pushWeakCallback.
+ if (CallbackStack::Item* item = s_globalWeakCallbackStack->pop()) {
item->call(visitor);
return true;
}
@@ -2048,7 +2048,7 @@ void Heap::globalWeakProcessing(Visitor* markingVisitor)
{
TRACE_EVENT0("blink_gc", "Heap::globalWeakProcessing");
// Call weak callbacks on objects that may now be pointing to dead objects.
- while (popAndInvokeWeakPointerCallback(markingVisitor)) { }
+ while (popAndInvokeGlobalWeakCallback(markingVisitor)) { }
// It is not permitted to trace pointers of live objects in the weak
// callback phase, so the marking stack should still be empty here.
@@ -2224,7 +2224,7 @@ void Heap::resetHeapCounters()
Visitor* Heap::s_markingVisitor;
CallbackStack* Heap::s_markingStack;
CallbackStack* Heap::s_postMarkingCallbackStack;
-CallbackStack* Heap::s_weakCallbackStack;
+CallbackStack* Heap::s_globalWeakCallbackStack;
CallbackStack* Heap::s_ephemeronStack;
HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
bool Heap::s_shutdownCalled = false;
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698