Commit 2f69de56 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Enable concurrent marking for HashTable based collections

All known data races in HashTable based collections have been resolved.

Bug: 986235
Change-Id: Ia7a22d707aaaea1ab3ebc70c47da0876fc426aa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078617Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746694}
parent 1875a728
......@@ -118,9 +118,6 @@ struct TraceTrait<HeapHashTableBacking<Table>> {
template <WTF::WeakHandlingFlag WeakHandling = WTF::kNoWeakHandling>
static void Trace(Visitor* visitor, void* self) {
if (visitor->ConcurrentTracingBailOut({self, &Trace}))
return;
static_assert(WTF::IsTraceableInCollectionTrait<Traits>::value ||
WTF::IsWeak<ValueType>::value,
"T should not be traced");
......
......@@ -2140,15 +2140,6 @@ template <typename VisitorDispatcher, typename A>
std::enable_if_t<A::kIsGarbageCollected>
HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits, Allocator>::
Trace(VisitorDispatcher visitor) {
// bail out for concurrent marking
if (visitor->ConcurrentTracingBailOut(
{this, [](blink::Visitor* visitor, void* object) {
reinterpret_cast<HashTable<Key, Value, Extractor, HashFunctions,
Traits, KeyTraits, Allocator>*>(object)
->Trace(visitor);
}}))
return;
static_assert(WTF::IsWeak<ValueType>::value ||
IsTraceableInCollectionTrait<Traits>::value,
"Value should not be traced");
......
......@@ -355,14 +355,6 @@ class LinkedHashSet {
template <typename VisitorDispatcher>
void Trace(VisitorDispatcher visitor) {
if (visitor->ConcurrentTracingBailOut(
{this, [](blink::Visitor* visitor, void* object) {
reinterpret_cast<LinkedHashSet<ValueArg, HashFunctions,
TraitsArg, Allocator>*>(object)
->Trace(visitor);
}}))
return;
impl_.Trace(visitor);
// Should the underlying table be moved by GC, register a callback
// that fixes up the interior pointers that the (Heap)LinkedHashSet keeps.
......
......@@ -516,13 +516,6 @@ class ListHashSetNode : public ListHashSetNodeBase<ValueArg, AllocatorArg> {
template <typename VisitorDispatcher, typename A = NodeAllocator>
std::enable_if_t<A::kIsGarbageCollected> Trace(VisitorDispatcher visitor) {
if (visitor->ConcurrentTracingBailOut(
{this, [](blink::Visitor* visitor, void* object) {
reinterpret_cast<ListHashSetNode<ValueArg, AllocatorArg>*>(
object)
->Trace(visitor);
}}))
return;
// The conservative stack scan can find nodes that have been removed
// from the set and destructed. We don't need to trace these, and it
// would be wrong to do so, because the class will not expect the trace
......@@ -1206,13 +1199,6 @@ template <typename T, size_t inlineCapacity, typename U, typename V>
template <typename VisitorDispatcher, typename A>
std::enable_if_t<A::kIsGarbageCollected>
ListHashSet<T, inlineCapacity, U, V>::Trace(VisitorDispatcher visitor) {
if (visitor->ConcurrentTracingBailOut(
{this, [](blink::Visitor* visitor, void* object) {
reinterpret_cast<ListHashSet<T, inlineCapacity, U, V>*>(object)
->Trace(visitor);
}}))
return;
static_assert(!IsWeak<T>::value,
"HeapListHashSet does not support weakness, consider using "
"HeapLinkedHashSet instead.");
......
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