RFR: 8258857: Zero: non-PCH release build fails after JDK-8258074

Aleksey Shipilev shade at openjdk.java.net
Tue Jan 5 08:29:00 UTC 2021


On Tue, 5 Jan 2021 00:12:58 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>>> `#include "runtime/globals_shared.hpp"` should not be removed. compiler_globals.hpp uses the `DECLARE_FLAGS` macro, which is defined by globals_shared.hpp.
>> 
>> Since globals_shared.hpp is included in compiler_globals_pd.hpp, I think it's fine to remove it.
>
> We should not rely on indirect inclusion. Otherwise, compiler_globals.hpp will break if compiler_globals_pd.hpp is changed to not include globals_shared.hpp. 
> 
> In fact, I have been fixing a lot of such problems when restructuring the header files. See https://github.com/openjdk/jdk/pull/1610 -- the vast majority of the 59 files changed in that PR were caused by relying on indirect inclusion of stubRoutines.hpp.

Yes, if something is using the definitions from the header, that header should be included directly. So, the patch is just adding the `#include "compiler/compiler_globals_pd.hpp"` then, right?

-------------

PR: https://git.openjdk.java.net/jdk/pull/1894


More information about the hotspot-compiler-dev mailing list