Address comments

This commit is contained in:
Vladimir Kozlov 2025-06-12 14:57:51 -07:00
parent 3a8c8e5b7a
commit 20c80da869
3 changed files with 18 additions and 18 deletions

View File

@ -234,14 +234,7 @@ void FileMapHeader::populate(FileMapInfo *info, size_t core_region_alignment,
_narrow_klass_pointer_bits = _narrow_klass_shift = -1; _narrow_klass_pointer_bits = _narrow_klass_shift = -1;
} }
// Which JIT compier is used // Which JIT compier is used
_compiler_type = (u1)CompilerType::compiler_none; // Interpreter only _compiler_type = (u1)CompilerConfig::compiler_type();
if (CompilerConfig::is_c2_enabled()) {
_compiler_type = (u1)CompilerType::compiler_c2;
} else if (CompilerConfig::is_jvmci_compiler_enabled()) {
_compiler_type = (u1)CompilerType::compiler_jvmci;
} else if (CompilerConfig::is_c1_enabled()) {
_compiler_type = (u1)CompilerType::compiler_c1;
}
_type_profile_level = TypeProfileLevel; _type_profile_level = TypeProfileLevel;
_type_profile_args_limit = TypeProfileArgsLimit; _type_profile_args_limit = TypeProfileArgsLimit;
_type_profile_parms_limit = TypeProfileParmsLimit; _type_profile_parms_limit = TypeProfileParmsLimit;
@ -1946,17 +1939,9 @@ bool FileMapHeader::validate() {
return false; return false;
} }
bool jvmci_compiler_is_enabled = CompilerConfig::is_jvmci_compiler_enabled(); bool jvmci_compiler_is_enabled = CompilerConfig::is_jvmci_compiler_enabled();
CompilerType compiler_type = CompilerType::compiler_none; // Interpreter only CompilerType compiler_type = CompilerConfig::compiler_type();
if (CompilerConfig::is_c2_enabled()) {
compiler_type = CompilerType::compiler_c2;
} else if (jvmci_compiler_is_enabled) {
compiler_type = CompilerType::compiler_jvmci;
} else if (CompilerConfig::is_c1_enabled()) {
compiler_type = CompilerType::compiler_c1;
}
CompilerType archive_compiler_type = CompilerType(_compiler_type); CompilerType archive_compiler_type = CompilerType(_compiler_type);
// JVMCI compiler loads additional jdk.internal.vm.ci module, // JVMCI compiler does different type profiling settigns and generate
// does different type profiling settigns and generate
// different code. We can't use archive which was produced // different code. We can't use archive which was produced
// without it and reverse. // without it and reverse.
// Only allow mix when JIT compilation is disabled. // Only allow mix when JIT compilation is disabled.

View File

@ -149,6 +149,8 @@ public:
inline static bool is_c2_or_jvmci_compiler_only(); inline static bool is_c2_or_jvmci_compiler_only();
inline static bool is_c2_or_jvmci_compiler_enabled(); inline static bool is_c2_or_jvmci_compiler_enabled();
inline static CompilerType compiler_type();
private: private:
static bool is_compilation_mode_selected(); static bool is_compilation_mode_selected();
static void set_compilation_policy_flags(); static void set_compilation_policy_flags();

View File

@ -131,4 +131,17 @@ inline bool CompilerConfig::is_c2_or_jvmci_compiler_enabled() {
return is_c2_enabled() || is_jvmci_compiler_enabled(); return is_c2_enabled() || is_jvmci_compiler_enabled();
} }
// Return type of most optimizing compiler which is used
inline CompilerType CompilerConfig::compiler_type() {
CompilerType compiler_type = CompilerType::compiler_none; // Interpreter only
if (CompilerConfig::is_c2_enabled()) {
compiler_type = CompilerType::compiler_c2;
} else if (CompilerConfig::is_jvmci_compiler_enabled()) {
compiler_type = CompilerType::compiler_jvmci;
} else if (CompilerConfig::is_c1_enabled()) {
compiler_type = CompilerType::compiler_c1;
}
return compiler_type;
}
#endif // SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP #endif // SHARE_COMPILER_COMPILERDEFINITIONS_INLINE_HPP