1f7861c8a9
This is a reland of 410ca4c50e
Skip new test for unsupported liftoff architecture.
Previously, if there is some unsupported liftoff functions, it fall
through Turbofan but recompilation didn't catch and count it. This CL
fixes it by using requested_tier on finished units.
Avoid to tier down asm.js.
Introduce reached recompilation tier to monitor recompilation progress.
Original change's description:
> [wasm] Tierdown wasm module upon "Debugger.enable"
>
> Put a logic in Wasm Engine to tier down all existing modules per isolate
> when debugger is enabled. This CL does not handle new module added after
> debugger is enabled yet.
>
> Bug: v8:9654
> Change-Id: I87060f5c416506543fcaf231bff9999d06ba4c0d
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013692
> Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Clemens Backes <clemensb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#66017}
TBR=szuend@chromium.org,bmeurer@chromium.org
Bug: v8:9654
Change-Id: I6014ae52d1e04726e64ee9267c5ce559090414d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2031744
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66164}
52 lines
1.4 KiB
JavaScript
52 lines
1.4 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
|
|
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
const num_functions = 200;
|
|
|
|
function create_builder(delta = 0) {
|
|
const builder = new WasmModuleBuilder();
|
|
for (let i = 0; i < num_functions; ++i) {
|
|
builder.addFunction('f' + i, kSig_i_v)
|
|
.addBody(wasmI32Const(i + delta))
|
|
.exportFunc();
|
|
}
|
|
return builder;
|
|
}
|
|
|
|
function check(instance) {
|
|
%WasmTierDownModule(instance);
|
|
for (let i = 0; i < num_functions; ++i) {
|
|
assertTrue(%IsLiftoffFunction(instance.exports['f' + i]));
|
|
}
|
|
|
|
for (let i = 0; i < num_functions; ++i) {
|
|
%WasmTierUpFunction(instance, i);
|
|
assertTrue(%IsLiftoffFunction(instance.exports['f' + i]));
|
|
}
|
|
|
|
%WasmTierUpModule(instance);
|
|
for (let i = 0; i < num_functions; ++i) {
|
|
assertFalse(%IsLiftoffFunction(instance.exports['f' + i]));
|
|
}
|
|
}
|
|
|
|
(function testTierDownToLiftoff() {
|
|
print(arguments.callee.name);
|
|
const instance = create_builder().instantiate();
|
|
check(instance);
|
|
})();
|
|
|
|
// Use slightly different module for this test to avoid sharing native module.
|
|
async function testTierDownToLiftoffAsync() {
|
|
print(arguments.callee.name);
|
|
const instance = await create_builder(num_functions).asyncInstantiate();
|
|
check(instance);
|
|
}
|
|
|
|
assertPromiseResult(testTierDownToLiftoffAsync());
|