Skip to content
Permalink
Browse files

8242217: Shenandoah: Enable GC mode to be diagnostic/experimental and…

… have a name

Reviewed-by: shade
  • Loading branch information
rkennke committed Apr 6, 2020
1 parent ec5ccb8 commit 843a86214e766c8b143571153a621e2fa6304ed3
@@ -406,6 +406,19 @@ void ShenandoahHeap::initialize_heuristics() {
ShouldNotReachHere();
}
_gc_mode->initialize_flags();
if (_gc_mode->is_diagnostic() && !UnlockDiagnosticVMOptions) {
vm_exit_during_initialization(
err_msg("GC mode \"%s\" is diagnostic, and must be enabled via -XX:+UnlockDiagnosticVMOptions.",
_gc_mode->name()));
}
if (_gc_mode->is_experimental() && !UnlockExperimentalVMOptions) {
vm_exit_during_initialization(
err_msg("GC mode \"%s\" is experimental, and must be enabled via -XX:+UnlockExperimentalVMOptions.",
_gc_mode->name()));
}
log_info(gc, init)("Shenandoah GC mode: %s",
_gc_mode->name());

_heuristics = _gc_mode->initialize_heuristics();

if (_heuristics->is_diagnostic() && !UnlockDiagnosticVMOptions) {
@@ -33,6 +33,9 @@ class ShenandoahMode : public CHeapObj<mtGC> {
public:
virtual void initialize_flags() const = 0;
virtual ShenandoahHeuristics* initialize_heuristics() const = 0;
virtual const char* name() = 0;
virtual bool is_diagnostic() = 0;
virtual bool is_experimental() = 0;
};

#endif // SHARE_GC_SHENANDOAH_SHENANDOAHMODE_HPP
@@ -33,6 +33,9 @@ class ShenandoahNormalMode : public ShenandoahMode {
public:
virtual void initialize_flags() const;
virtual ShenandoahHeuristics* initialize_heuristics() const;
virtual const char* name() { return "Normal"; }
virtual bool is_diagnostic() { return false; }
virtual bool is_experimental() { return false; }
};

#endif // SHARE_GC_SHENANDOAH_SHENANDOAHNORMALMODE_HPP
@@ -31,6 +31,10 @@ class ShenandoahPassiveMode : public ShenandoahNormalMode {
public:
virtual void initialize_flags() const;
virtual ShenandoahHeuristics* initialize_heuristics() const;

virtual const char* name() { return "Passive"; }
virtual bool is_diagnostic() { return true; }
virtual bool is_experimental() { return false; }
};

#endif // SHARE_GC_SHENANDOAH_SHENANDOAHNORMALMODE_HPP

0 comments on commit 843a862

Please sign in to comment.