Commit 791d5214 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

cppgc: Add WeakMember handler to LivenessBroker

WeakMember references are used in ephemerons which uses the ordinary
LivenessBroker for determining whether an object is dead or not.

Bug: chromium:1056170
Change-Id: I7f25da22637fba24603bccb76e266357b0371525
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2649042
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarOmer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72346}
parent a2cf158a
......@@ -49,6 +49,12 @@ class V8_EXPORT LivenessBroker final {
TraceTrait<T>::GetTraceDescriptor(object).base_object_payload);
}
template <typename T>
bool IsHeapObjectAlive(const WeakMember<T>& weak_member) const {
return (weak_member != kSentinelPointer) &&
IsHeapObjectAlive<T>(weak_member.Get());
}
template <typename T>
bool IsHeapObjectAlive(const UntracedMember<T>& untraced_member) const {
return (untraced_member != kSentinelPointer) &&
......
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