Bug 206975 - Most of B3 and Air does not need to include CCallHelpers.h
Summary: Most of B3 and Air does not need to include CCallHelpers.h
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-29 17:19 PST by Robin Morisset
Modified: 2020-02-06 19:13 PST (History)
12 users (show)

See Also:


Attachments
Patch (25.75 KB, patch)
2020-01-29 17:21 PST, Robin Morisset
rmorisset: review-
rmorisset: commit-queue-
Details | Formatted Diff | Diff
Patch (27.55 KB, patch)
2020-01-29 17:59 PST, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (28.04 KB, patch)
2020-01-29 18:19 PST, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (27.62 KB, patch)
2020-01-29 18:23 PST, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (27.64 KB, patch)
2020-02-03 19:07 PST, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (26.52 KB, patch)
2020-02-06 16:19 PST, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2020-01-29 17:19:27 PST
They only do to use CCallHelpers::Jump or CCallHelpers::Label.
But CCallHelpers inherit those from MacroAssembler. And MacroAssembler.h is dramatically cheaper to include (since CCallHelpers includes AssemblyHelpers which includes CodeBlock.h which includes roughly the entire runtime).
Comment 1 Robin Morisset 2020-01-29 17:21:32 PST
Created attachment 389204 [details]
Patch
Comment 2 Robin Morisset 2020-01-29 17:47:54 PST
Comment on attachment 389204 [details]
Patch

My patch visibly does not apply cleanly on ToT.
Comment 3 Robin Morisset 2020-01-29 17:59:36 PST
Created attachment 389210 [details]
Patch
Comment 4 Robin Morisset 2020-01-29 18:19:45 PST
Created attachment 389213 [details]
Patch
Comment 5 Robin Morisset 2020-01-29 18:23:14 PST
Created attachment 389214 [details]
Patch
Comment 6 Robin Morisset 2020-02-03 19:07:12 PST
Created attachment 389616 [details]
Patch

Fix style nits.
Comment 7 Mark Lam 2020-02-06 15:35:05 PST
Comment on attachment 389616 [details]
Patch

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

> Source/JavaScriptCore/b3/B3Common.cpp:42
> -    return FTL::verboseCompilationEnabled() || FTL::shouldDumpDisassembly() || shouldDumpIRAtEachPhase(mode);
> +    return DFG::verboseCompilationEnabled(DFG::FTLMode) || DFG::shouldDumpDisassembly(DFG::FTLMode) || shouldDumpIRAtEachPhase(mode);

I don't think this is a good thing to do.  There's no guarantee that FTL::verboseCompilationEnabled() will always be a forwarding wrapper to DFG::verboseCompilationEnabled().  Ditto for FTL::shouldDumpDisassembly().  I suggest either:
1. Get rid of FTL::verboseCompilationEnabled() and FTL::shouldDumpDisassembly(), and use DFG versions everywhere.  Or ...
2. Create a separate header file that contains FTL::verboseCompilationEnabled() and FTL::shouldDumpDisassembly() only, and continue to use them here.  Or ...
3. Continue to #include "FTLState.h" here.

I recommend either (2) or (3).

> Source/WTF/wtf/SingleRootGraph.h:32
> +#include <wtf/StringPrintStream.h>

Isn't this already in the code base?  I see it in my local checkout.  If so, make sure to remove the ChangeLog as well.
Comment 8 Robin Morisset 2020-02-06 16:19:06 PST
Created attachment 390023 [details]
Patch

- I verified that even without unified sources this patch does not break the build
- I reverted the change that removed FTLState.h from B3Common, following Mark's comment
- I removed the wtf/Changelog since the corresponding change has already landed in the tree
Comment 9 Mark Lam 2020-02-06 16:23:11 PST
Comment on attachment 390023 [details]
Patch

r=me.  If you have a record of the build time difference on a unified build of JSC, it would be nice to include that as well in the ChangeLog for posterity.
Comment 10 Robin Morisset 2020-02-06 16:29:26 PST
(In reply to Mark Lam from comment #9)
> Comment on attachment 390023 [details]
> Patch
> 
> r=me.  If you have a record of the build time difference on a unified build
> of JSC, it would be nice to include that as well in the ChangeLog for
> posterity.

Thanks for the review. The compile time of JSC as a whole is a bit too variable to give good results here. But from what I remember, the difference when looking only at B3 files was quite significant (something like 20% in Debug builds).
Comment 11 WebKit Commit Bot 2020-02-06 19:12:38 PST
Comment on attachment 390023 [details]
Patch

Clearing flags on attachment: 390023

Committed r256003: <https://trac.webkit.org/changeset/256003>
Comment 12 WebKit Commit Bot 2020-02-06 19:12:40 PST
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2020-02-06 19:13:19 PST
<rdar://problem/59248505>