Commit 6ff8cfe7 authored by Piotr Bialecki's avatar Piotr Bialecki Committed by Commit Bot

Revert "heap: Enable concurrent marking for HashTable based collections"

This reverts commit 2f69de56.

Reason for revert: bisect identified this CL as the reason for crashes on Android - see bug https://crbug.com/1059000.

Original change's description:
> 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/+/2078617
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Commit-Queue: Omer Katz <omerkatz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#746694}

TBR=haraken@chromium.org,mlippautz@chromium.org,omerkatz@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 986235
Change-Id: I6eabcf000bcb8092c33aaf5691decf58fe110c27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089965Reviewed-by: default avatarPiotr Bialecki <bialpio@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Piotr Bialecki <bialpio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747510}
parent a886ceda
......@@ -118,6 +118,9 @@ 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,6 +2140,15 @@ 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,6 +355,14 @@ 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,6 +516,13 @@ 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
......@@ -1199,6 +1206,13 @@ 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