changeset 59238:4ea431f68e73

8244739: Shenandoah: break superclass dependency on ShenandoahNormalMode Reviewed-by: rkennke
author shade
date Mon, 11 May 2020 18:33:42 +0200
parents a8dd9e32110b
children 9fb4e20c6975
files src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.cpp src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.hpp src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.hpp
diffstat 3 files changed, 23 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.cpp	Mon May 11 18:33:33 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.cpp	Mon May 11 18:33:42 2020 +0200
@@ -55,3 +55,21 @@
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCASBarrier);
   SHENANDOAH_CHECK_FLAG_SET(ShenandoahCloneBarrier);
 }
+
+ShenandoahHeuristics* ShenandoahIUMode::initialize_heuristics() const {
+  if (ShenandoahGCHeuristics != NULL) {
+    if (strcmp(ShenandoahGCHeuristics, "aggressive") == 0) {
+      return new ShenandoahAggressiveHeuristics();
+    } else if (strcmp(ShenandoahGCHeuristics, "static") == 0) {
+      return new ShenandoahStaticHeuristics();
+    } else if (strcmp(ShenandoahGCHeuristics, "adaptive") == 0) {
+      return new ShenandoahAdaptiveHeuristics();
+    } else if (strcmp(ShenandoahGCHeuristics, "compact") == 0) {
+      return new ShenandoahCompactHeuristics();
+    } else {
+      vm_exit_during_initialization("Unknown -XX:ShenandoahGCHeuristics option");
+    }
+  }
+  ShouldNotReachHere();
+  return NULL;
+}
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.hpp	Mon May 11 18:33:33 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahIUMode.hpp	Mon May 11 18:33:42 2020 +0200
@@ -25,13 +25,14 @@
 #ifndef SHARE_GC_SHENANDOAH_MODE_SHENANDOAHIUMODE_HPP
 #define SHARE_GC_SHENANDOAH_MODE_SHENANDOAHIUMODE_HPP
 
-#include "gc/shenandoah/mode/shenandoahNormalMode.hpp"
+#include "gc/shenandoah/mode/shenandoahMode.hpp"
 
 class ShenandoahHeuristics;
 
-class ShenandoahIUMode : public ShenandoahNormalMode {
+class ShenandoahIUMode : public ShenandoahMode {
 public:
   virtual void initialize_flags() const;
+  virtual ShenandoahHeuristics* initialize_heuristics() const;
 
   virtual const char* name()     { return "Incremental-Update"; }
   virtual bool is_diagnostic()   { return false; }
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.hpp	Mon May 11 18:33:33 2020 +0200
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.hpp	Mon May 11 18:33:42 2020 +0200
@@ -25,9 +25,9 @@
 #ifndef SHARE_GC_SHENANDOAH_MODE_SHENANDOAHPASSIVEMODE_HPP
 #define SHARE_GC_SHENANDOAH_MODE_SHENANDOAHPASSIVEMODE_HPP
 
-#include "gc/shenandoah/mode/shenandoahNormalMode.hpp"
+#include "gc/shenandoah/mode/shenandoahMode.hpp"
 
-class ShenandoahPassiveMode : public ShenandoahNormalMode {
+class ShenandoahPassiveMode : public ShenandoahMode {
 public:
   virtual void initialize_flags() const;
   virtual ShenandoahHeuristics* initialize_heuristics() const;