[vm] Drop WSRs with reachable references, not just allocated.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try
Change-Id: I61ee126d93f6465db3b069723bc25d884269aced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142144
Auto-Submit: Tess Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Teagan Strickland 2020-04-02 18:15:49 +00:00 committed by commit-bot@chromium.org
parent f205141a42
commit f64f22f668

View file

@ -2050,7 +2050,7 @@ class WeakSerializationReferenceSerializationCluster
// the object ID from the heap directly.
bool ShouldDrop(RawWeakSerializationReference* ref) const {
auto const target = WeakSerializationReference::TargetOf(ref);
return Serializer::IsAllocatedReference(heap_->GetObjectId(target));
return Serializer::IsReachableReference(heap_->GetObjectId(target));
}
Heap* const heap_;