mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8253765: C2: Control randomization in StressLCM and StressGCM
Use the compilation-local seed in 'StressLCM' and 'StressGCM' rather than the global one. As a consequence, these options use by default a fresh seed in every compilation, unless 'StressSeed=N' is specified, in which case they behave deterministically. Annotate tests that use 'StressLCM' and 'StressGCM' with the 'stress' and 'randomness' keys to reflect this change in default behavior. Reviewed-by: kvn, thartmann
This commit is contained in:
parent
6620b617a7
commit
05459df0c7
18 changed files with 105 additions and 15 deletions
|
@ -729,9 +729,9 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
|
|||
if (failing()) return;
|
||||
NOT_PRODUCT( verify_graph_edges(); )
|
||||
|
||||
// If IGVN is randomized for stress testing, seed random number
|
||||
// generation and log the seed for repeatability.
|
||||
if (StressIGVN) {
|
||||
// If LCM, GCM, or IGVN are randomized for stress testing, seed
|
||||
// random number generation and log the seed for repeatability.
|
||||
if (StressLCM || StressGCM || StressIGVN) {
|
||||
_stress_seed = FLAG_IS_DEFAULT(StressSeed) ?
|
||||
static_cast<uint>(Ticks::now().nanoseconds()) : StressSeed;
|
||||
if (_log != NULL) {
|
||||
|
@ -4489,7 +4489,7 @@ int Compile::random() {
|
|||
#define RANDOMIZED_DOMAIN_MASK ((1 << (RANDOMIZED_DOMAIN_POW + 1)) - 1)
|
||||
bool Compile::randomized_select(int count) {
|
||||
assert(count > 0, "only positive");
|
||||
return (os::random() & RANDOMIZED_DOMAIN_MASK) < (RANDOMIZED_DOMAIN / count);
|
||||
return (random() & RANDOMIZED_DOMAIN_MASK) < (RANDOMIZED_DOMAIN / count);
|
||||
}
|
||||
|
||||
CloneMap& Compile::clone_map() { return _clone_map; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue