mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
6957080: MethodComparator needs stress testing
Add a stress-test flag for running MethodComparator over many inputs. Fix bugs that crop up. Reviewed-by: kvn
This commit is contained in:
parent
49cbc41c82
commit
be95b163a6
5 changed files with 40 additions and 15 deletions
|
@ -307,5 +307,19 @@ Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, objArray
|
|||
|
||||
// Set up method entry points for compiler and interpreter.
|
||||
m->link_method(m, CHECK);
|
||||
|
||||
#ifdef ASSERT
|
||||
if (StressMethodComparator) {
|
||||
static int nmc = 0;
|
||||
for (int j = i; j >= 0 && j >= i-4; j--) {
|
||||
if ((++nmc % 1000) == 0) tty->print_cr("Have run MethodComparator %d times...", nmc);
|
||||
bool z = MethodComparator::methods_EMCP(m(), (methodOop)_methods->obj_at(j));
|
||||
if (j == i && !z) {
|
||||
tty->print("MethodComparator FAIL: "); m->print(); m->print_codes();
|
||||
assert(z, "method must compare equal to itself");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //ASSERT
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue