[dart/fuzzer] Add O3 as random command line switch

Also further refactors switch selection from naming.
The JIT stress execution modes don't really need
their own visible name (you cannot really control
which stress test to use anyway with --mode), so it's
cleaner to remove the idea of controlling switches
altogether.

Change-Id: I98aa71ce8653013fb45a4c482d7b4c5a02143a55
Reviewed-on: https://dart-review.googlesource.com/c/92386
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
This commit is contained in:
Aart Bik 2019-02-08 18:04:05 +00:00 committed by commit-bot@chromium.org
parent afe37d7fe0
commit d136a35244
2 changed files with 54 additions and 59 deletions

View file

@ -48,19 +48,19 @@ where
--dart-top : sets DART_TOP explicitly through command line --dart-top : sets DART_TOP explicitly through command line
--mode1 : m1 --mode1 : m1
--mode2 : m2, and values one of --mode2 : m2, and values one of
jit-[stress-][debug-]ia32 = Dart JIT (ia32) jit-[debug-]ia32 = Dart JIT (ia32)
jit-[stress-][debug-]x64 = Dart JIT (x64) jit-[debug-]x64 = Dart JIT (x64)
jit-[stress-][debug-]arm32 = Dart JIT (simarm) jit-[debug-]arm32 = Dart JIT (simarm)
jit-[stress-][debug-]arm64 = Dart JIT (simarm64) jit-[debug-]arm64 = Dart JIT (simarm64)
jit-[stress-][debug-]dbc = Dart JIT (simdbc) jit-[debug-]dbc = Dart JIT (simdbc)
jit-[stress-][debug-]dbc64 = Dart JIT (simdbc64) jit-[debug-]dbc64 = Dart JIT (simdbc64)
aot-[debug-]x64 = Dart AOT (x64) aot-[debug-]x64 = Dart AOT (x64)
aot-[debug-]arm32 = Dart AOT (simarm) aot-[debug-]arm32 = Dart AOT (simarm)
aot-[debug-]arm64 = Dart AOT (simarm64) aot-[debug-]arm64 = Dart AOT (simarm64)
kbc-int-[debug-]x64 = Dart KBC (interpreted bytecode) kbc-int-[debug-]x64 = Dart KBC (interpreted bytecode)
kbc-mix-[debug-]x64 = Dart KBC (mixed-mode bytecode) kbc-mix-[debug-]x64 = Dart KBC (mixed-mode bytecode)
kbc-cmp-[debug-]x64 = Dart KBC (compiled bytecode) kbc-cmp-[debug-]x64 = Dart KBC (compiled bytecode)
djs-x64 = dart2js + Node.JS djs-x64 = dart2js + Node.JS
If no modes are given, a random JIT and/or AOT combination is used. If no modes are given, a random JIT and/or AOT combination is used.

View file

@ -55,48 +55,55 @@ abstract class TestRunner {
String tag = getTag(mode); String tag = getTag(mode);
// Prepare extra flags. // Prepare extra flags.
List<String> extraFlags = []; List<String> extraFlags = [];
if (mode.startsWith('jit-stress')) { if (mode.startsWith('kbc-int')) {
final r = rand.nextInt(6);
if (r == 0) {
prefix += '-NOFIELDGUARDS';
extraFlags = ['--use_field_guards=false'];
} else if (r == 1) {
prefix += '-NOINTRINSIFY';
extraFlags = ['--intrinsify=false'];
} else if (r == 2) {
prefix += '-COMPACTEVERY';
extraFlags = ['--gc_every=1000', '--use_compactor=true'];
} else if (r == 3) {
prefix += '-MARKSWEEPEVERY';
extraFlags = ['--gc_every=1000', '--use_compactor=false'];
} else if (r == 4) {
prefix += '-DEPOPTEVERY';
extraFlags = ['--deoptimize_every=100'];
} else if (r == 5) {
prefix += '-STACKTRACEEVERY';
extraFlags = ['--stacktrace_every=100'];
} else if (r == 6) {
// Crashes (https://github.com/dart-lang/sdk/issues/35196):
prefix += '-OPTCOUNTER';
extraFlags = ['--optimization_counter_threshold=1'];
}
} else if (mode.contains('arm32')) {
if (rand.nextBool()) {
prefix += '-VFP';
extraFlags = ['--no-use-vfp'];
}
} else if (mode.startsWith('kbc-int')) {
prefix += '-INT'; prefix += '-INT';
extraFlags = [ extraFlags += [
'--enable-interpreter', '--enable-interpreter',
'--compilation-counter-threshold=-1' '--compilation-counter-threshold=-1'
]; ];
} else if (mode.startsWith('kbc-mix')) { } else if (mode.startsWith('kbc-mix')) {
prefix += '-MIX'; prefix += '-MIX';
extraFlags = ['--enable-interpreter']; extraFlags += ['--enable-interpreter'];
} else if (mode.startsWith('kbc-cmp')) { } else if (mode.startsWith('kbc-cmp')) {
prefix += '-CMP'; prefix += '-CMP';
extraFlags = ['--use-bytecode-compiler']; extraFlags += ['--use-bytecode-compiler'];
}
// Every once in a while, stress test JIT.
if (mode.startsWith('jit') && rand.nextInt(4) == 0) {
final r = rand.nextInt(6);
if (r == 0) {
prefix += '-NOFIELDGUARDS';
extraFlags += ['--use_field_guards=false'];
} else if (r == 1) {
prefix += '-NOINTRINSIFY';
extraFlags += ['--intrinsify=false'];
} else if (r == 2) {
prefix += '-COMPACTEVERY';
extraFlags += ['--gc_every=1000', '--use_compactor=true'];
} else if (r == 3) {
prefix += '-MARKSWEEPEVERY';
extraFlags += ['--gc_every=1000', '--use_compactor=false'];
} else if (r == 4) {
prefix += '-DEPOPTEVERY';
extraFlags += ['--deoptimize_every=100'];
} else if (r == 5) {
prefix += '-STACKTRACEEVERY';
extraFlags += ['--stacktrace_every=100'];
} else if (r == 6) {
// Crashes (https://github.com/dart-lang/sdk/issues/35196):
prefix += '-OPTCOUNTER';
extraFlags += ['--optimization_counter_threshold=1'];
}
}
// Every once in a while, disable VFP on arm32.
if (mode.contains('arm32') && rand.nextInt(4) == 0) {
prefix += '-noVFP';
extraFlags += ['--no-use-vfp'];
}
// Every once in a while, use -O3 compiler.
if (!mode.startsWith('djs') && rand.nextInt(4) == 0) {
prefix += '-O3';
extraFlags += ['--optimization_level=3'];
} }
// Construct runner. // Construct runner.
if (mode.startsWith('jit')) { if (mode.startsWith('jit')) {
@ -537,18 +544,6 @@ class DartFuzzTestSession {
'jit-arm64', 'jit-arm64',
'jit-dbc', 'jit-dbc',
'jit-dbc64', 'jit-dbc64',
'jit-stress-debug-ia32',
'jit-stress-debug-x64',
'jit-stress-debug-arm32',
'jit-stress-debug-arm64',
'jit-stress-debug-dbc',
'jit-stress-debug-dbc64',
'jit-stress-ia32',
'jit-stress-x64',
'jit-stress-arm32',
'jit-stress-arm64',
'jit-stress-dbc',
'jit-stress-dbc64',
'aot-debug-x64', 'aot-debug-x64',
'aot-x64', 'aot-x64',
'kbc-int-debug-x64', 'kbc-int-debug-x64',