Bug 237173

Summary: operationMaterializeObjectInOSR should DeferTerminationForAWhile instead of just DeferTermination.
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.
none
proposed patch.
ysuzuki: review+
[fast-cq] patch for landing. none

Description Mark Lam 2022-02-24 17:57:08 PST
DeferTermination can throw the TerminationException on destruction of the scope object.  operationMaterializeObjectInOSR() was using DeferTermination resulting in the TerminationException being thrown on exit.  This trips up validateDFGExceptionHandling testing which is enabled on Debug builds.  The solution is simply to use DeferTerminationForAWhile instead, and let a more natural trap checkpoint throw the TerminationException instead.

rdar://89428235
Comment 1 Radar WebKit Bug Importer 2022-02-24 17:57:57 PST
<rdar://problem/89450245>
Comment 2 Mark Lam 2022-02-24 18:58:11 PST
Created attachment 453165 [details]
proposed patch.
Comment 3 Mark Lam 2022-02-24 19:05:48 PST
Created attachment 453167 [details]
proposed patch.
Comment 4 Yusuke Suzuki 2022-02-24 19:15:31 PST
Comment on attachment 453167 [details]
proposed patch.

r=me
Comment 5 Mark Lam 2022-02-24 20:44:40 PST
<rdar://problem/89428235>
Comment 6 Mark Lam 2022-02-24 21:27:04 PST
Turns out the watchdog timeout takes too long on a Release build, and the newly added test has ended with a StackOverflow error before a TerminationException is even thrown.  I'll just skip the test on Release builds.  It is only relevant for Debug builds anyway.
Comment 7 Mark Lam 2022-02-24 22:03:21 PST
Created attachment 453173 [details]
[fast-cq] patch for landing.
Comment 8 EWS 2022-02-25 11:04:52 PST
Committed r290517 (?): <https://commits.webkit.org/r290517>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 453173 [details].