Bug 194768 - Add version number to cached bytecode
Summary: Add version number to cached bytecode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks: 201118 194769
  Show dependency treegraph
 
Reported: 2019-02-17 23:16 PST by Tadeu Zagallo
Modified: 2019-08-24 11:22 PDT (History)
7 users (show)

See Also:


Attachments
Patch (7.06 KB, patch)
2019-02-17 23:19 PST, Tadeu Zagallo
no flags Details | Formatted Diff | Diff
Patch (9.46 KB, patch)
2019-02-18 00:39 PST, Tadeu Zagallo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.