Bug 216637 - [JSC] Optimize Promise#finally by avoiding creating multiple environments
Summary: [JSC] Optimize Promise#finally by avoiding creating multiple environments
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-16 23:00 PDT by Yusuke Suzuki
Modified: 2020-09-17 01:07 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.01 KB, patch)
2020-09-16 23:07 PDT, Yusuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2020-09-16 23:00:26 PDT
[JSC] Optimize Promise#finally by avoiding creating multiple environments
Comment 1 Yusuke Suzuki 2020-09-16 23:07:21 PDT
Created attachment 408992 [details]
Patch
Comment 2 Ross Kirsling 2020-09-16 23:35:56 PDT
Comment on attachment 408992 [details]
Patch

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

Seems fine to me.

> Source/JavaScriptCore/builtins/PromisePrototype.js:74
> +        thenFinally = (0, /* prevent function name inference */ (value) => {

nit: Seems like this could be a line comment above? But I don't feel that strongly.
Comment 3 Yusuke Suzuki 2020-09-16 23:54:29 PDT
Comment on attachment 408992 [details]
Patch

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

>> Source/JavaScriptCore/builtins/PromisePrototype.js:74
>> +        thenFinally = (0, /* prevent function name inference */ (value) => {
> 
> nit: Seems like this could be a line comment above? But I don't feel that strongly.

I think this is because `(0, expr)` looks super tricky, and this inlined comment helps readers to understand why this comma expression exists. I think this prefixed comment is nice for consistency since we are using this style in the other places.
Comment 4 EWS 2020-09-17 01:06:05 PDT
Committed r267184: <https://trac.webkit.org/changeset/267184>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 408992 [details].
Comment 5 Radar WebKit Bug Importer 2020-09-17 01:07:21 PDT
<rdar://problem/69049394>