v8/test/mjsunit/wasm/wasm-dynamic-tiering.js
Clemens Backes dcd078421c Reland "[wasm] Remove all implications from --predictable"
This is a reland of 79d63a5ef3. Some fixes
landed already, and two tests need to be skipped now (one with a tracking
bug).

Original change's description:
> [wasm] Remove all implications from --predictable
>
> In predictable mode, we want to execute the same code as otherwise,
> modulo timing. Hence remove any implications which change behaviour
> (like tier-up or asynchronous compilation).
> Note that --predictable is a debugging flag, so the configurations does
> not need to "make sense" in production.
>
> R=ahaas@chromium.org
>
> Bug: v8:11848
> Change-Id: If74fbacadeb087d977922c41f33fd18738b50ded
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2940898
> Commit-Queue: Clemens Backes <clemensb@chromium.org>
> Reviewed-by: Andreas Haas <ahaas@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74973}

Bug: v8:11848
Change-Id: I3564e4351d6545bb9643d1ae44722eb2606b8961
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2944936
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75009}
2021-06-08 09:32:37 +00:00

43 lines
1.2 KiB
JavaScript

// Copyright 2019 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 --wasm-dynamic-tiering --liftoff
// Flags: --no-wasm-tier-up --no-stress-opt
// This test busy-waits for tier-up to be complete, hence it does not work in
// predictable more where we only have a single thread.
// Flags: --no-predictable
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
const num_iterations = 4;
const num_functions = 2;
const builder = new WasmModuleBuilder();
for (let i = 0; i < num_functions; ++i) {
let kFunction = builder.addFunction('f' + i, kSig_i_v)
.addBody(wasmI32Const(i))
.exportAs('f' + i)
}
let instance = builder.instantiate();
for (let i = 0; i < num_iterations - 1; ++i) {
instance.exports.f0();
instance.exports.f1();
}
assertTrue(%IsLiftoffFunction(instance.exports.f0));
assertTrue(%IsLiftoffFunction(instance.exports.f1));
instance.exports.f1();
// Busy waiting until the function is tiered up.
while (true) {
if (!%IsLiftoffFunction(instance.exports.f1)) {
break;
}
}
assertTrue(%IsLiftoffFunction(instance.exports.f0));