Bug 180394

Summary: CountingLock could avoid the isHeldBit check in tryOptimizedRead
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: REOPENED    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

Filip Pizlo
Reported 2017-12-04 21:41:38 PST
As the comment in CountingLock.h says: // FIXME: We could eliminate this check, if we think it's OK to proceed with the optimistic read // path even after knowing that it must fail. That's probably good for perf since we expect // failure to be super rare. We would get rid of this check and instead of calling getCount below, // we would return currentValue ^ mask. If the lock state was empty to begin with, the result // would be a properly blessed count (both low bits set). If the lock state was anything else, we // would get an improperly blessed count that would not possibly succeed in validate. We could // actually do something like "return (currentValue | hasParkedBit) ^ isHeldBit", which would mean // that we allow parked-but-not-held-locks through.
Attachments
Filip Pizlo
Comment 1 2017-12-10 15:43:11 PST
*** This bug has been marked as a duplicate of bug 180638 ***
Filip Pizlo
Comment 2 2017-12-10 17:43:13 PST
I shouldn't have duped this.
Note You need to log in before you can comment on or make changes to this bug.