v8/test/debugger/regress/regress-7421.js
Georg Neis 2257f6b145 [compiler][test] Remove --block-concurrent-recompilation
- Remove flag --block-concurrent-recompilation and its implementation,
  including %UnblockConcurrentCompilation.
- Rewrite tests that used it in terms of the primitives introduced in
  my previous CL:
  https://chromium-review.googlesource.com/c/v8/v8/+/3071400/
- Remove "sync"/"no sync" arguments from %GetOptimizationStatus,
  assertOptimized, etc. These are now always "no sync": they don't
  do any magic.
- Remove "if %IsConcurrentRecompilationSupported then quit" from some
  tests in favor of --concurrent-recompilation in their Flags line.

Bug: v8:12041, v8:7790
Change-Id: I966aae4fec85e6f9e7aeed2ba2c12e9198a3991f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3077149
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76298}
2021-08-16 10:15:53 +00:00

82 lines
1.9 KiB
JavaScript

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Debug = debug.Debug
// Test that the side-effect check is not bypassed in optimized code.
var exception = null;
var counter = 0;
function f1() {
counter++;
}
function wrapper1() {
for (var i = 0; i < 4; i++) {
// Get this function optimized before calling to increment.
// Check that that call performs the necessary side-effect checks.
%OptimizeOsr();
%PrepareFunctionForOptimization(wrapper1);
}
f1();
}
%PrepareFunctionForOptimization(wrapper1);
function f2() {
counter++;
}
function wrapper2(call) {
if (call) f2();
}
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
function success(expectation, source) {
assertEquals(expectation,
exec_state.frame(0).evaluate(source, true).value());
}
function fail(source) {
assertThrows(() => exec_state.frame(0).evaluate(source, true),
EvalError);
}
wrapper1();
wrapper1();
fail("wrapper1()");
%PrepareFunctionForOptimization(wrapper2);
wrapper2(true);
wrapper2(false);
wrapper2(true);
%OptimizeFunctionOnNextCall(wrapper2);
wrapper2(false);
fail("wrapper2(true)");
fail("%PrepareFunctionForOptimization(wrapper2); "+
"%OptimizeFunctionOnNextCall(wrapper2); wrapper2(true)");
%PrepareFunctionForOptimization(wrapper2);
%DisableOptimizationFinalization();
%OptimizeFunctionOnNextCall(wrapper2, "concurrent");
wrapper2(false);
fail("%FinalizeOptimization();" +
"wrapper2(true);");
} catch (e) {
exception = e;
print(e, e.stack);
}
};
// Add the debug event listener.
Debug.setListener(listener);
function f() {
debugger;
};
f();
assertNull(exception);