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

Unified Diff: Source/wtf/Vector.h

Issue 803443002: Introduce InlinedGlobalMarkingVisitor Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/wtf/TypeTraits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Vector.h
diff --git a/Source/wtf/Vector.h b/Source/wtf/Vector.h
index 7a6421bd5bc1dab05e03044328f500687a4d5c77..0036d9cbfc64ea560c2607f528db1aa7b9aa66cc 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -745,7 +745,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
void reverse();
- void trace(typename Allocator::Visitor*);
+ template<typename VisitorDispatcher> void trace(VisitorDispatcher visitor);
private:
void expandCapacity(size_t newMinCapacity);
@@ -1210,9 +1210,10 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
// This is only called if the allocator is a HeapAllocator. It is used when
// visiting during a tracing GC.
template<typename T, size_t inlineCapacity, typename Allocator>
- void Vector<T, inlineCapacity, Allocator>::trace(typename Allocator::Visitor* visitor)
+ template<typename VisitorDispatcher>
+ void Vector<T, inlineCapacity, Allocator>::trace(VisitorDispatcher visitor)
{
- ASSERT(Allocator::isGarbageCollected); // Garbage collector must be enabled.
+ COMPILE_ASSERT(Allocator::isGarbageCollected, GarbageCollectorMustBeEnabled);
const T* bufferBegin = buffer();
const T* bufferEnd = buffer() + size();
if (ShouldBeTraced<VectorTraits<T> >::value) {
@@ -1220,7 +1221,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
Allocator::template trace<T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
}
if (this->hasOutOfLineBuffer())
- Allocator::markNoTracing(visitor, buffer());
+ visitor->markNoTracing(buffer());
}
#if !ENABLE(OILPAN)
« no previous file with comments | « Source/wtf/TypeTraits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698