Bug 230864

Summary: Speed up setting JSFunction's "prototype" property
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Alexey Shvayka <ashvayka>
Status: RESOLVED FIXED    
Severity: Enhancement CC: ews-watchlist, keith_miller, mark.lam, msaboff, sbarati, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Alexey Shvayka 2021-09-27 15:36:17 PDT
Speed up setting JSFunction's "prototype" property
Comment 1 Alexey Shvayka 2021-09-27 15:40:00 PDT
Created attachment 439403 [details]
Patch
Comment 2 Alexey Shvayka 2021-09-27 15:41:54 PDT
(In reply to Alexey Shvayka from comment #1)
> Created attachment 439403 [details]
> Patch

                                             r283094                   patch

class-derived-creation                   38.2295+-0.3351     ^     36.3643+-0.6771        ^ definitely 1.0513x faster
class-creation                           38.2074+-0.7942     ^     27.4249+-0.4214        ^ definitely 1.3932x faster
function-prototype-put-non-reified       80.5426+-1.2450     ^     28.4549+-0.4999        ^ definitely 2.8305x faster
function-prototype-put-reified           29.1429+-0.4759     ^     25.6151+-0.3548        ^ definitely 1.1377x faster

<geometric>                              42.9347+-0.3383     ^     29.1322+-0.2186        ^ definitely 1.4738x faster
Comment 3 Yusuke Suzuki 2021-09-27 18:32:22 PDT
Comment on attachment 439403 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/JSFunction.cpp:299
> +constexpr unsigned prototypeAttributesForNonClass = PropertyAttribute::DontEnum | PropertyAttribute::DontDelete;

Let's put `static` too.
Comment 4 Alexey Shvayka 2021-09-28 06:07:07 PDT
Created attachment 439466 [details]
Patch for landing
Comment 5 Alexey Shvayka 2021-09-28 06:08:32 PDT
(In reply to Yusuke Suzuki from comment #3)
> > Source/JavaScriptCore/runtime/JSFunction.cpp:299
> > +constexpr unsigned prototypeAttributesForNonClass = PropertyAttribute::DontEnum | PropertyAttribute::DontDelete;
> 
> Let's put `static` too.

Done. I appreciate the review!
Comment 6 EWS 2021-09-28 06:37:25 PDT
Committed r283167 (242215@main): <https://commits.webkit.org/242215@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439466 [details].
Comment 7 Radar WebKit Bug Importer 2021-09-28 06:38:18 PDT
<rdar://problem/83620218>