[webkit-reviews] review granted: [Bug 226000] AbstractSlotVisitor::containsOpaqueRoot() should only declare didFindOpaqueRoot if the root is actually found. : [Attachment 429126] proposed patch.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 19 19:43:14 PDT 2021


Robin Morisset <rmorisset at apple.com> has granted Mark Lam
<mark.lam at apple.com>'s request for review:
Bug 226000: AbstractSlotVisitor::containsOpaqueRoot() should only declare
didFindOpaqueRoot if the root is actually found.
https://bugs.webkit.org/show_bug.cgi?id=226000

Attachment 429126: proposed patch.

https://bugs.webkit.org/attachment.cgi?id=429126&action=review




--- Comment #4 from Robin Morisset <rmorisset at apple.com> ---
Comment on attachment 429126
  --> https://bugs.webkit.org/attachment.cgi?id=429126
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=429126&action=review

r=me

>>> Source/JavaScriptCore/heap/AbstractSlotVisitorInlines.h:136
>>> +	 if (UNLIKELY(found && m_needsExtraOpaqueRootHandling)) {
>> 
>> Is there a reason to check found first and m_needsExtraOpaqueRootHandling
second?
>> 
>> If anything, I would expect the entire check of m_opaqueRoots.contains(ptr)
to be only done after checking m_needsExtraOpaqueRootHandling, especially if it
is UNLIKELY.
> 
> I check found first because found is already in memory.  If not found, we
save on triggering a load of m_needsExtraOpaqueRootHandling.

I had missed that we eventually return found and so we need to compute it even
if !m_needsExtraOpaqueRootHandling.


More information about the webkit-reviews mailing list