| Index: src/heap/objects-visiting-inl.h
|
| diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
|
| index 2b82c6b29ef0a7f4ddf9e0fa80ce920535723c70..2adc9dcb23f1eab508549d79e8436ec460c1a362 100644
|
| --- a/src/heap/objects-visiting-inl.h
|
| +++ b/src/heap/objects-visiting-inl.h
|
| @@ -164,6 +164,8 @@ void StaticMarkingVisitor<StaticVisitor>::Initialize() {
|
|
|
| table_.Register(kVisitJSWeakCollection, &VisitWeakCollection);
|
|
|
| + table_.Register(kVisitJSWeakRef, &VisitWeakRef);
|
| +
|
| table_.Register(
|
| kVisitOddball,
|
| &FixedBodyVisitor<StaticVisitor, Oddball::BodyDescriptor, void>::Visit);
|
| @@ -399,6 +401,35 @@ void StaticMarkingVisitor<StaticVisitor>::VisitWeakCollection(
|
| StaticVisitor::MarkObjectWithoutPush(heap, obj);
|
| }
|
|
|
| +template <typename StaticVisitor>
|
| +void StaticMarkingVisitor<StaticVisitor>::VisitWeakRef(
|
| + Map* map, HeapObject* object) {
|
| + Heap* heap = map->GetHeap();
|
| + JSWeakRef* weak_ref =
|
| + reinterpret_cast<JSWeakRef*>(object);
|
| +
|
| + if (weak_ref->executor() != nullptr) {
|
| + StaticVisitor::MarkObject(heap, weak_ref->executor());
|
| + }
|
| + if (weak_ref->holdings() != nullptr && weak_ref->holdings()->IsHeapObject()) {
|
| + StaticVisitor::MarkObject(heap,
|
| + reinterpret_cast<HeapObject*>(weak_ref->holdings()));
|
| + }
|
| + if (weak_ref->target() != nullptr) {
|
| + StaticVisitor::MarkObject(heap, weak_ref->target());
|
| + if (weak_ref->held()) {
|
| + if (!weak_ref->target()->cleared()) {
|
| + StaticVisitor::MarkObject(heap,
|
| + reinterpret_cast<JSObject*>(weak_ref->target()->value()));
|
| + }
|
| + } else if (weak_ref->target()->cleared()) {
|
| + weak_ref->set_target(nullptr);
|
| + weak_ref->set_held(false);
|
| + weak_ref->set_queued(true);
|
| + }
|
| + }
|
| +}
|
| +
|
|
|
| template <typename StaticVisitor>
|
| void StaticMarkingVisitor<StaticVisitor>::VisitCode(Map* map,
|
|
|