8258772: Some runtime/cds tests fail with +LogCompilation or +StressX

Emit warning about TraceDependencies results in
ClassHierarchyWalker::count_find_witness_calls() only if TraceDependencies is
actually enabled. Use standard warning() function instead of ad hoc printing.
Remove warning about using Stress(LCM|GCM|IGVN) without LogCompilation in
Compile::Compile(), and add the information to the description of the StressSeed
option instead. These changes prevent false test failures when using
LogCompilation or Stress(LCM|GCM|IGVN).

Reviewed-by: chagedorn, kvn, thartmann
This commit is contained in:
Roberto Castañeda Lozano 2021-01-07 18:57:58 +00:00 committed by Vladimir Kozlov
parent 4ce83f2a3a
commit d8ad63019a
3 changed files with 7 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1312,8 +1312,8 @@ static bool count_find_witness_calls() {
bool occasional_print = ((pcount & ((1<<10) - 1)) == 0);
if (pcount < 0) pcount = 1; // crude overflow protection
deps_find_witness_print = pcount;
if (VerifyDependencies && initial_call) {
tty->print_cr("Warning: TraceDependencies results may be inflated by VerifyDependencies");
if (TraceDependencies && VerifyDependencies && initial_call) {
warning("TraceDependencies results may be inflated by VerifyDependencies");
}
if (occasional_print || final_stats) {
// Every now and then dump a little info about dependency searching.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -52,7 +52,8 @@
\
product(uint, StressSeed, 0, DIAGNOSTIC, \
"Seed for randomized stress testing (if unset, a random one is " \
"generated)") \
"generated). The seed is recorded in the compilation log, if " \
"available.") \
range(0, max_juint) \
\
develop(bool, StressMethodHandleLinkerInlining, false, \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -774,8 +774,6 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
static_cast<uint>(Ticks::now().nanoseconds()) : StressSeed;
if (_log != NULL) {
_log->elem("stress_test seed='%u'", _stress_seed);
} else if (FLAG_IS_DEFAULT(StressSeed)) {
tty->print_cr("Warning: set +LogCompilation to log the seed.");
}
}