Commit 74cb9fc2 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Simplify stress-opt

Since flags are statically stored, there's no difference between
the first runs and the second last run in stress-opt mode. This
simplifies the code to account for that.

Bug: v8:9940
Change-Id: Icc978f20476c0dffb084f7e9e6a200a5608e3515
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1898659Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64756}
parent 820e447e
...@@ -10604,29 +10604,18 @@ void Testing::PrepareStressRun(int run) { ...@@ -10604,29 +10604,18 @@ void Testing::PrepareStressRun(int run) {
"--noalways-opt"; "--noalways-opt";
static const char* kForcedOptimizations = "--always-opt"; static const char* kForcedOptimizations = "--always-opt";
// If deoptimization stressed turn on frequent deoptimization. If no value // In deopt-stress mode turn on frequent deoptimization. If no value
// is spefified through --deopt-every-n-times use a default default value. // is specified through --deopt-every-n-times use a default value.
static const char* kDeoptEvery13Times = "--deopt-every-n-times=13"; static const char* kDeoptEvery13Times = "--deopt-every-n-times=13";
if (internal::Testing::stress_type() == Testing::kStressTypeDeopt && if (internal::Testing::stress_type() == Testing::kStressTypeDeopt &&
internal::FLAG_deopt_every_n_times == 0) { internal::FLAG_deopt_every_n_times == 0) {
V8::SetFlagsFromString(kDeoptEvery13Times); V8::SetFlagsFromString(kDeoptEvery13Times);
} }
#ifdef DEBUG
// As stressing in debug mode only make two runs skip the deopt stressing
// here.
if (run == GetStressRuns() - 1) { if (run == GetStressRuns() - 1) {
V8::SetFlagsFromString(kForcedOptimizations); V8::SetFlagsFromString(kForcedOptimizations);
} else { } else {
V8::SetFlagsFromString(kLazyOptimizations); V8::SetFlagsFromString(kLazyOptimizations);
} }
#else
if (run == GetStressRuns() - 1) {
V8::SetFlagsFromString(kForcedOptimizations);
} else if (run != GetStressRuns() - 2) {
V8::SetFlagsFromString(kLazyOptimizations);
}
#endif
} }
void Testing::DeoptimizeAll(Isolate* isolate) { void Testing::DeoptimizeAll(Isolate* isolate) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment