RFR: 8265105: gc/arguments/TestSelectDefaultGC.java fails when compiler1 is disabled

Igor Veresov iveresov at openjdk.java.net
Sat Apr 17 20:11:34 UTC 2021


On Tue, 13 Apr 2021 05:46:15 GMT, SUN Guoyun <github.com+40024232+sunny868 at openjdk.org> wrote:

> On MIPS64 platform has not impliment C1,only has C2.
>  so when tiered compilation is off, it is unnecessary to set client emulation mode flags.
>  perhaps this bug be included by https://bugs.openjdk.java.net/browse/JDK-8251462

So, I would propose doing it the following way. Basically, I think we should put ```if (has_c1())``` around the whole thing because ```NeverActAsServerClassMachine``` doesn't make any sense without C1.


diff --git a/src/hotspot/share/compiler/compilerDefinitions.cpp b/src/hotspot/share/compiler/compilerDefinitions.cpp
index f8eff0a6917..7db439373a1 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.cpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.cpp
@@ -159,7 +159,8 @@ intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
   }
 }
 
-void set_client_emulation_mode_flags() {
+void CompilerConfig::set_client_emulation_mode_flags() {
+  assert(has_c1(), "Must have C1 compiler present");
   CompilationModeFlag::set_quick_only();
 
   FLAG_SET_ERGO(ProfileInterpreter, false);
@@ -560,17 +561,19 @@ void CompilerConfig::ergo_initialize() {
   return;
 #endif
 
-  if (!is_compilation_mode_selected()) {
+  if (has_c1()) {
+    if (!is_compilation_mode_selected()) {
 #if defined(_WINDOWS) && !defined(_LP64)
-    if (FLAG_IS_DEFAULT(NeverActAsServerClassMachine)) {
-      FLAG_SET_ERGO(NeverActAsServerClassMachine, true);
-    }
+      if (FLAG_IS_DEFAULT(NeverActAsServerClassMachine)) {
+        FLAG_SET_ERGO(NeverActAsServerClassMachine, true);
+      }
 #endif
-    if (NeverActAsServerClassMachine) {
+      if (NeverActAsServerClassMachine) {
+        set_client_emulation_mode_flags();
+      }
+    } else if (!has_c2() && !is_jvmci_compiler()) {
       set_client_emulation_mode_flags();
     }
-  } else if (!has_c2() && !is_jvmci_compiler()) {
-    set_client_emulation_mode_flags();
   }
 
   set_legacy_emulation_flags();
diff --git a/src/hotspot/share/compiler/compilerDefinitions.hpp b/src/hotspot/share/compiler/compilerDefinitions.hpp
index d87c892f091..2f8794ad43a 100644
--- a/src/hotspot/share/compiler/compilerDefinitions.hpp
+++ b/src/hotspot/share/compiler/compilerDefinitions.hpp
@@ -246,6 +246,7 @@ private:
   static void set_compilation_policy_flags();
   static void set_jvmci_specific_flags();
   static void set_legacy_emulation_flags();
+  static void set_client_emulation_mode_flags();
 };
 
 #endif // SHARE_COMPILER_COMPILERDEFINITIONS_HPP

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

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


More information about the hotspot-compiler-dev mailing list