Bug 228003

Summary: JITWorklist::waitUntilAllPlansForVMAreReady() should also be notified when plans are cancelled.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, keith_miller, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. ysuzuki: review+

Description Mark Lam 2021-07-15 13:16:47 PDT
Previously, it only gets notified when plans are done compiling.  As a result, if JITWorklist::waitUntilAllPlansForVMAreReady() found non-ready plans and started waiting, and those plans were canceled, then JITWorklist::waitUntilAllPlansForVMAreReady() can hang indefinitely.

rdar://78314543
Comment 1 Mark Lam 2021-07-15 13:24:15 PDT
Created attachment 433619 [details]
proposed patch.
Comment 2 Yusuke Suzuki 2021-07-15 13:32:05 PDT
Comment on attachment 433619 [details]
proposed patch.

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

r=me

> Source/JavaScriptCore/jit/JITWorklist.cpp:336
> +    bool didCancelPlans = deadPlanKeys.size();

Using !isEmpty() would be better.
Comment 3 Mark Lam 2021-07-15 13:33:30 PDT
Thanks for the review.

(In reply to Yusuke Suzuki from comment #2)
> > Source/JavaScriptCore/jit/JITWorklist.cpp:336
> > +    bool didCancelPlans = deadPlanKeys.size();
> 
> Using !isEmpty() would be better.

Agreed. Will fix.
Comment 4 Mark Lam 2021-07-15 13:43:34 PDT
Landed in r279961: <http://trac.webkit.org/r279961>.