8272703: StressSeed should be set via FLAG_SET_ERGO

Reviewed-by: chagedorn, thartmann
This commit is contained in:
Tobias Holenstein 2021-09-23 12:55:42 +00:00 committed by Tobias Hartmann
parent c43452859d
commit 66ce09f51e

@ -773,8 +773,12 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
// If any phase is randomized for stress testing, seed random number
// generation and log the seed for repeatability.
if (StressLCM || StressGCM || StressIGVN || StressCCP) {
_stress_seed = FLAG_IS_DEFAULT(StressSeed) ?
static_cast<uint>(Ticks::now().nanoseconds()) : StressSeed;
if (FLAG_IS_DEFAULT(StressSeed) || (FLAG_IS_ERGO(StressSeed) && RepeatCompilation)) {
_stress_seed = static_cast<uint>(Ticks::now().nanoseconds());
FLAG_SET_ERGO(StressSeed, _stress_seed);
} else {
_stress_seed = StressSeed;
}
if (_log != NULL) {
_log->elem("stress_test seed='%u'", _stress_seed);
}