Bug 211547

Summary: Add stack checks to the DFG and FTL bytecode parser.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, keith_miller, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=211535
Attachments:
Description Flags
proposed patch.
none
proposed patch. ysuzuki: review+

Description Mark Lam 2020-05-06 20:35:17 PDT
Inlining can cause some level of recursion of the DFG bytecode parser.  We should do a stack check at each inlining check before recursing.  If a stack overflow appears to be imminent, then just refuse to inline, and therefore, don't recurse deeper into the parser.
Comment 1 Radar WebKit Bug Importer 2020-05-06 20:35:42 PDT
<rdar://problem/62958880>
Comment 2 Mark Lam 2020-05-06 21:07:19 PDT
Created attachment 398701 [details]
proposed patch.

Let's try this on the EWS first.
Comment 3 Mark Lam 2020-05-06 21:38:17 PDT
Created attachment 398702 [details]
proposed patch.
Comment 4 Yusuke Suzuki 2020-05-06 23:32:12 PDT
Comment on attachment 398702 [details]
proposed patch.

r=me
Comment 5 Mark Lam 2020-05-07 08:17:28 PDT
The ios-wk2 EWS bot failures don't look related to this patch.
Comment 6 Mark Lam 2020-05-07 12:26:35 PDT
Thanks for the review.  Landed in r261325: <http://trac.webkit.org/r261325>.