Bug 226401 - Non-unified build fixes, late-ish May 2021 edition redux
Summary: Non-unified build fixes, late-ish May 2021 edition redux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks: 226088
  Show dependency treegraph
 
Reported: 2021-05-28 15:45 PDT by Adrian Perez
Modified: 2021-06-03 08:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.90 KB, patch)
2021-05-28 15:47 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2021-05-28 15:45:10 PDT
☢️
Comment 1 Adrian Perez 2021-05-28 15:47:18 PDT
Created attachment 430064 [details]
Patch
Comment 2 EWS 2021-05-29 03:09:26 PDT
Committed r278237 (238274@main): <https://commits.webkit.org/238274@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430064 [details].
Comment 3 Radar WebKit Bug Importer 2021-05-29 03:10:17 PDT
<rdar://problem/78646851>
Comment 4 Mark Lam 2021-05-29 08:05:05 PDT
Comment on attachment 430064 [details]
Patch

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

> Source/JavaScriptCore/jit/JITSizeStatistics.h:31
> +#include "CCallHelpers.h"

This is the wrong thing to do because this header file doesn't really depend on CCallHelpers.h.

The right thing to do is to #include "CCallHelpers.h" in the files that actually uses JITSizeStatistics::markStart and markEnd.  AFAICT, the only files that need it are JIT.cpp and DFGSpeculativeJIT.cpp, and those files already #include CCallHelpers.h indirectly.  So, what is motivating this change?
Comment 5 Adrian Perez 2021-05-30 03:16:06 PDT
(In reply to Mark Lam from comment #4)
> Comment on attachment 430064 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=430064&action=review
> 
> > Source/JavaScriptCore/jit/JITSizeStatistics.h:31
> > +#include "CCallHelpers.h"
> 
> This is the wrong thing to do because this header file doesn't really depend
> on CCallHelpers.h.
>
> The right thing to do is to #include "CCallHelpers.h" in the files that
> actually uses JITSizeStatistics::markStart and markEnd.  AFAICT, the only
> files that need it are JIT.cpp and DFGSpeculativeJIT.cpp, and those files
> already #include CCallHelpers.h indirectly.  So, what is motivating this
> change?

In JITSizeStatistics.h there is an use of the CCallHelpers::Label
type, which is defined all the way up the class inheritance chain
in the AbstractMacroAssembler<T>. I gave it a small spin at trying
to figure out the correct “T” to use but it ended up needing to know
the particular type for the current target architecture and anyway
needed including headers that CCallHelpers.h itself is already
including… in the end it seemed easier and much more readable to
keep the CCallHelpers::Label usage as-is and include CCallHelper.h

If anybody has a better suggestion on how to get a definition for
the CCallHelpers::Label type I can try to give it a try.
Comment 6 Mark Lam 2021-06-02 14:25:11 PDT
(In reply to Adrian Perez from comment #5)
> (In reply to Mark Lam from comment #4)
> > Comment on attachment 430064 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=430064&action=review
> > 
> > > Source/JavaScriptCore/jit/JITSizeStatistics.h:31
> > > +#include "CCallHelpers.h"
> > 
> > This is the wrong thing to do because this header file doesn't really depend
> > on CCallHelpers.h.
> >
> > The right thing to do is to #include "CCallHelpers.h" in the files that
> > actually uses JITSizeStatistics::markStart and markEnd.  AFAICT, the only
> > files that need it are JIT.cpp and DFGSpeculativeJIT.cpp, and those files
> > already #include CCallHelpers.h indirectly.  So, what is motivating this
> > change?
> 
> In JITSizeStatistics.h there is an use of the CCallHelpers::Label
> type, which is defined all the way up the class inheritance chain
> in the AbstractMacroAssembler<T>. I gave it a small spin at trying
> to figure out the correct “T” to use but it ended up needing to know
> the particular type for the current target architecture and anyway
> needed including headers that CCallHelpers.h itself is already
> including… in the end it seemed easier and much more readable to
> keep the CCallHelpers::Label usage as-is and include CCallHelper.h
> 
> If anybody has a better suggestion on how to get a definition for
> the CCallHelpers::Label type I can try to give it a try.

I stand corrected.  That's unfortunate.  Thanks for explaining.  We could have just used MacroAssembler::Label, but then, we'd still be #include'ing MacroAssembler.h.  Given this, it's not worth thinking more about this issue.  Your fix is correct.  Sorry for the noise.
Comment 7 Adrian Perez 2021-06-03 08:04:44 PDT
(In reply to Mark Lam from comment #6)
> (In reply to Adrian Perez from comment #5)
> > (In reply to Mark Lam from comment #4)
> > > Comment on attachment 430064 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=430064&action=review
> > > 
> > > > Source/JavaScriptCore/jit/JITSizeStatistics.h:31
> > > > +#include "CCallHelpers.h"
> > > 
> > > This is the wrong thing to do because this header file doesn't really depend
> > > on CCallHelpers.h.
> > >
> > > The right thing to do is to #include "CCallHelpers.h" in the files that
> > > actually uses JITSizeStatistics::markStart and markEnd.  AFAICT, the only
> > > files that need it are JIT.cpp and DFGSpeculativeJIT.cpp, and those files
> > > already #include CCallHelpers.h indirectly.  So, what is motivating this
> > > change?
> > 
> > In JITSizeStatistics.h there is an use of the CCallHelpers::Label
> > type, which is defined all the way up the class inheritance chain
> > in the AbstractMacroAssembler<T>. I gave it a small spin at trying
> > to figure out the correct “T” to use but it ended up needing to know
> > the particular type for the current target architecture and anyway
> > needed including headers that CCallHelpers.h itself is already
> > including… in the end it seemed easier and much more readable to
> > keep the CCallHelpers::Label usage as-is and include CCallHelper.h
> > 
> > If anybody has a better suggestion on how to get a definition for
> > the CCallHelpers::Label type I can try to give it a try.
> 
> I stand corrected.  That's unfortunate.  Thanks for explaining.  We could
> have just used MacroAssembler::Label, but then, we'd still be #include'ing
> MacroAssembler.h.  Given this, it's not worth thinking more about this
> issue.  Your fix is correct.  Sorry for the noise.

No problem at all, that's what we are here for—making WebKit as good
as we can :)