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

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

Issue 2602363002: Always adjust container size when tracing HeapVectorBacking contents. (Closed)
Patch Set: Created 3 years, 12 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 | « no previous file | 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/TraceTraits.h
diff --git a/third_party/WebKit/Source/platform/heap/TraceTraits.h b/third_party/WebKit/Source/platform/heap/TraceTraits.h
index cf0baa0c2390db65f8c5c8c8229b92eca8b49168..15e97551e335e60f06311726aea9db1e4ab2233e 100644
--- a/third_party/WebKit/Source/platform/heap/TraceTraits.h
+++ b/third_party/WebKit/Source/platform/heap/TraceTraits.h
@@ -534,6 +534,11 @@ struct TraceInCollectionTrait<NoWeakHandlingInCollections,
// Use the payload size as recorded by the heap to determine how many
// elements to trace.
size_t length = header->payloadSize() / sizeof(T);
+#ifdef ANNOTATE_CONTIGUOUS_CONTAINER
+ // As commented above, HeapVectorBacking can trace unused slots
+ // (which are already zeroed out).
+ ANNOTATE_CHANGE_SIZE(array, length, 0, length);
+#endif
if (std::is_polymorphic<T>::value) {
char* pointer = reinterpret_cast<char*>(array);
for (unsigned i = 0; i < length; ++i) {
@@ -544,11 +549,6 @@ struct TraceInCollectionTrait<NoWeakHandlingInCollections,
array[i]);
}
} else {
-#ifdef ANNOTATE_CONTIGUOUS_CONTAINER
- // As commented above, HeapVectorBacking can trace unused slots
- // (which are already zeroed out).
- ANNOTATE_CHANGE_SIZE(array, length, 0, length);
-#endif
for (size_t i = 0; i < length; ++i)
blink::TraceIfEnabled<
T, IsTraceableInCollectionTrait<Traits>::value>::trace(visitor,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698