The message from this sender included one or more files which could not be scanned for virus detection; do not open these files unless you are certain of the sender's intent.
---------------------------------------------------------------------- On Tue, 7 Mar 2023 13:08:22 GMT, Coleen Phillimore <cole...@openjdk.org> wrote: >> Kim Barrett has updated the pull request incrementally with one additional >> commit since the last revision: >> >> make Debugging::_enabled a nesting counter > > src/hotspot/share/utilities/debug.hpp line 108: > >> 106: // because we need a fallback when we don't have any mechanism for >> detecting >> 107: // constant evaluation. >> 108: #if defined(TARGET_COMPILER_gcc) || defined(TARGET_COMPILER_xlc) > > All this seems like it should go in COMPILER_HEADER(globalDefinitions.hpp) > but since globalDefinitions.hpp includes debug.hpp, you can't do this. Can > we file an RFE to clean this up (if possible)? I considered that, and had two reasons for rejecting it. The include ordering problem was one. There are uses of assert and the like in globalDefinitions. Some of those might someday be moved elsewhere, but for now the order is a problem. The other is that this is really not "general purpose", but rather very specifically tailored to the use here. And it can't be general purpose, because there isn't a general fallback for testing for constexpr evaluation. I could have added `HAS_IS_CONSTANT_EVALUATED` and `::is_constant_evaluated()`, with all uses of the latter requiring protection by the former. But I couldn't think of any places where I would want to use that. Using it in, for example, count_trailing_zeros to allow it to be (sometimes) constexpr would make the question of whether it's constexpr be platform-dependent, which means it can't be used in shared required constexpr contexts. And it's even worse since the platform dependency is also currently compiler version dependent. I think that path leads nowhere good. However, I've filed this cleanup RFE: https://bugs.openjdk.org/browse/JDK-8303797 ------------- PR: https://git.openjdk.org/jdk/pull/12845