v8/test/mjsunit/compiler/regress-905555-2.js
Leszek Swirski 099f438647 [test] Fix assertOptimized function name printing
In assertOptimized and assertUnoptimized, we can optionally pass in the
function name. We also used to pass in an optional 'sync' parameter, to
decide whether to wait for background compilations to finish before
checking state.

The sync parameter was removed in favour of explicit intrinsics, so fix
callers of assertOptimized to no longer try to set it. Also, use
function.name as the function name when no name was passed.

Change-Id: I8e98d4d02e2d097d059989ad78bf46b97b57bdca
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4000480
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84080}
2022-11-07 09:40:03 +00:00

28 lines
680 B
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.
// Flags: --allow-natives-syntax --noalways-turbofan
global = 1;
function boom(value) {
return global;
}
%PrepareFunctionForOptimization(boom);
assertEquals(1, boom());
assertEquals(1, boom());
%DisableOptimizationFinalization();
%OptimizeFunctionOnNextCall(boom, "concurrent");
assertEquals(1, boom());
%WaitForBackgroundOptimization();
delete this.global;
%FinalizeOptimization();
// boom should be deoptimized because the global property cell has changed.
assertUnoptimized(boom);
assertThrows(boom);