Bug 194768

Summary: Add version number to cached bytecode
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   
Bug Depends on:    
Bug Blocks: 201118, 194769    
Attachments:
Description Flags
Patch
none
Patch none

Description Tadeu Zagallo 2019-02-17 23:16:07 PST
...
Comment 1 Tadeu Zagallo 2019-02-17 23:16:38 PST
<rdar://problem/48147968>
Comment 2 Tadeu Zagallo 2019-02-17 23:19:33 PST
Created attachment 362264 [details]
Patch
Comment 3 Saam Barati 2019-02-17 23:50:50 PST
Comment on attachment 362264 [details]
Patch

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

> Source/JavaScriptCore/runtime/CodeCache.h:152
> +        close(fd);

Nit: I’d just create an onScopeExit after the branch to make sure it’s a valid fd. I’d also remove the other close(fd)
Comment 4 Tadeu Zagallo 2019-02-17 23:58:57 PST
(In reply to Saam Barati from comment #3)
> Comment on attachment 362264 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362264&action=review
> 
> > Source/JavaScriptCore/runtime/CodeCache.h:152
> > +        close(fd);
> 
> Nit: I’d just create an onScopeExit after the branch to make sure it’s a
> valid fd. I’d also remove the other close(fd)

Not sure what do you mean by making sure it's a valid fd after the branch, we always check and return. I tried to find a helper like that before, but never did. Grepping for `onScopeExit` didn't find anything either.
Comment 5 Saam Barati 2019-02-18 00:07:19 PST
Comment on attachment 362264 [details]
Patch

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

>>> Source/JavaScriptCore/runtime/CodeCache.h:152
>>> +        close(fd);
>> 
>> Nit: I’d just create an onScopeExit after the branch to make sure it’s a valid fd. I’d also remove the other close(fd)
> 
> Not sure what do you mean by making sure it's a valid fd after the branch, we always check and return. I tried to find a helper like that before, but never did. Grepping for `onScopeExit` didn't find anything either.

What I’m proposing is: On line 137, add:
auto closeFD = makeScopeExit([&] { close(fd); })

I misremembered the name of the function
Comment 6 Tadeu Zagallo 2019-02-18 00:26:55 PST
(In reply to Saam Barati from comment #5)
> Comment on attachment 362264 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362264&action=review
> 
> >>> Source/JavaScriptCore/runtime/CodeCache.h:152
> >>> +        close(fd);
> >> 
> >> Nit: I’d just create an onScopeExit after the branch to make sure it’s a valid fd. I’d also remove the other close(fd)
> > 
> > Not sure what do you mean by making sure it's a valid fd after the branch, we always check and return. I tried to find a helper like that before, but never did. Grepping for `onScopeExit` didn't find anything either.
> 
> What I’m proposing is: On line 137, add:
> auto closeFD = makeScopeExit([&] { close(fd); })
> 
> I misremembered the name of the function

Nice! Thanks, I'll update it.
Comment 7 Tadeu Zagallo 2019-02-18 00:39:23 PST
Created attachment 362266 [details]
Patch
Comment 8 WebKit Commit Bot 2019-02-18 02:20:34 PST
Comment on attachment 362266 [details]
Patch

Clearing flags on attachment: 362266

Committed r241660: <https://trac.webkit.org/changeset/241660>
Comment 9 WebKit Commit Bot 2019-02-18 02:20:35 PST
All reviewed patches have been landed.  Closing bug.