Bug 206330

Summary: Reduce the code generated by DFGSlowPathGenerator.h
Product: WebKit Reporter: Robin Morisset <rmorisset>
Component: JavaScriptCoreAssignee: Robin Morisset <rmorisset>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ews-watchlist, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
mark.lam: review+
Patch none

Description Robin Morisset 2020-01-15 17:51:01 PST
The FunctionType parameter is only needed by CallResultAndArgumentsSlowPathGenerator, not by its base class CallSlowPathGenerator.
Moving it allows saving about 300kB from JavaScriptCore, by reducing the number of instantiations of the methods of CallSlowPathGenerator.
Comment 1 Robin Morisset 2020-01-15 17:54:17 PST
Created attachment 387880 [details]
Patch
Comment 2 Robin Morisset 2020-01-15 17:59:46 PST
(In reply to Robin Morisset from comment #0)
> The FunctionType parameter is only needed by
> CallResultAndArgumentsSlowPathGenerator, not by its base class
> CallSlowPathGenerator.
> Moving it allows saving about 300kB from JavaScriptCore, by reducing the
> number of instantiations of the methods of CallSlowPathGenerator.

NB: the 300kB were measured on a debug build, it is probably about 4x less in release mode.
Comment 3 Mark Lam 2020-01-16 14:06:39 PST
Comment on attachment 387880 [details]
Patch

r=me
Comment 4 Mark Lam 2020-01-16 14:07:33 PST
Comment on attachment 387880 [details]
Patch

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

> Source/JavaScriptCore/ChangeLog:9
> +        Moving it allows saving about 300kB from JavaScriptCore, by reducing the number of instantiations of the methods of CallSlowPathGenerator.

You should make it clear that this is on a Debug build.  The better thing to do would be to cite numbers for a Release build.
Comment 5 Robin Morisset 2020-01-16 14:32:22 PST
Created attachment 387960 [details]
Patch

Thanks for the review!
I updated the Changelog, it is 200kB in release mode.
Comment 6 WebKit Commit Bot 2020-01-16 15:04:33 PST
Comment on attachment 387960 [details]
Patch

Clearing flags on attachment: 387960

Committed r254712: <https://trac.webkit.org/changeset/254712>
Comment 7 WebKit Commit Bot 2020-01-16 15:04:35 PST
All reviewed patches have been landed.  Closing bug.