Bug 196359

Summary: CodeBlock::jettison() should disallow repatching its own calls
Product: WebKit Reporter: Tadeu Zagallo <tzagallo>
Component: JavaScriptCoreAssignee: Tadeu Zagallo <tzagallo>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, keith_miller, mark.lam, msaboff, sbarati, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Tadeu Zagallo 2019-03-28 11:45:23 PDT
<rdar://problem/48973663>
Comment 1 Tadeu Zagallo 2019-03-28 12:05:07 PDT
Created attachment 366192 [details]
Patch
Comment 2 Saam Barati 2019-03-28 13:29:35 PDT
Comment on attachment 366192 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:12
> +        OSR exit address while unlinking all the incoming CallLinkInfos latter in

latter => later
Comment 3 Saam Barati 2019-03-28 13:33:58 PDT
Comment on attachment 366192 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:17
> +        Change it so that we set a flag, `clearedByJettison`, in all the CallLinkInfos
> +        owned by the CodeBlock being jettisoned. If the flag is set, we will avoid
> +        repatching the call during unlinking.

It took me a few minutes to agree that this is safe, but maybe it's worth expanding on in a sentence or two. The beginning of this call should never be reachable again after the CodeBlock is jettisoned.
Comment 4 Saam Barati 2019-03-28 13:34:24 PDT
Comment on attachment 366192 [details]
Patch

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

> JSTests/stress/call-link-info-osrexit-repatch.js:3
> +function foo(a, b) {

style nit: use 4 space indent
Comment 5 Tadeu Zagallo 2019-03-28 14:25:57 PDT
Created attachment 366203 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2019-03-28 15:05:40 PDT
Comment on attachment 366203 [details]
Patch for landing

Clearing flags on attachment: 366203

Committed r243626: <https://trac.webkit.org/changeset/243626>
Comment 7 WebKit Commit Bot 2019-03-28 15:05:42 PDT
All reviewed patches have been landed.  Closing bug.