Commit 00e806ff authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

Reland "[wasm] Add --wasm-dynamic-tiering to --future"

R=jkummerow@chromium.org

Bug: v8:12281
Change-Id: If00f34053bb970a71a1826010050b79557dbb381
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3338259Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78371}
parent dd9d4c96
......@@ -984,6 +984,7 @@ DEFINE_BOOL(wasm_tier_up, true,
"have an effect)")
DEFINE_BOOL(wasm_dynamic_tiering, false,
"enable dynamic tier up to the optimizing compiler")
DEFINE_WEAK_IMPLICATION(future, wasm_dynamic_tiering)
DEFINE_INT(wasm_tiering_budget, 1800000,
"budget for dynamic tiering (rough approximation of bytes executed")
DEFINE_INT(
......
......@@ -201,6 +201,7 @@ TEST(Run_WasmModule_CompilationHintsNoTiering) {
}
TEST(Run_WasmModule_CompilationHintsTierUp) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
if (!FLAG_wasm_tier_up || !FLAG_liftoff) return;
{
EXPERIMENTAL_FLAG_SCOPE(compilation_hints);
......@@ -265,6 +266,7 @@ TEST(Run_WasmModule_CompilationHintsTierUp) {
}
TEST(Run_WasmModule_CompilationHintsLazyBaselineEagerTopTier) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
if (!FLAG_wasm_tier_up || !FLAG_liftoff) return;
{
EXPERIMENTAL_FLAG_SCOPE(compilation_hints);
......
......@@ -1236,6 +1236,7 @@ STREAM_TEST(TestModuleWithErrorAfterDataSection) {
// Test that cached bytes work.
STREAM_TEST(TestDeserializationBypassesCompilation) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
StreamTester tester(isolate);
ZoneBuffer wire_bytes = GetValidModuleBytes(tester.zone());
ZoneBuffer module_bytes =
......@@ -1251,6 +1252,7 @@ STREAM_TEST(TestDeserializationBypassesCompilation) {
// Test that bad cached bytes don't cause compilation of wire bytes to fail.
STREAM_TEST(TestDeserializationFails) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
StreamTester tester(isolate);
ZoneBuffer wire_bytes = GetValidModuleBytes(tester.zone());
ZoneBuffer module_bytes =
......@@ -1294,6 +1296,7 @@ STREAM_TEST(TestFunctionSectionWithoutCodeSection) {
}
STREAM_TEST(TestSetModuleCompiledCallback) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
StreamTester tester(isolate);
bool callback_called = false;
tester.stream()->SetModuleCompiledCallback(
......
......@@ -269,6 +269,7 @@ class MetricsRecorder : public v8::metrics::Recorder {
};
COMPILE_TEST(TestEventMetrics) {
FlagScope<bool> no_wasm_dynamic_tiering(&FLAG_wasm_dynamic_tiering, false);
std::shared_ptr<MetricsRecorder> recorder =
std::make_shared<MetricsRecorder>();
reinterpret_cast<v8::Isolate*>(isolate)->SetMetricsRecorder(recorder);
......
......@@ -31,7 +31,9 @@ namespace test_wasm_serialization {
// Approximate gtest TEST_F style, in case we adopt gtest.
class WasmSerializationTest {
public:
WasmSerializationTest() : zone_(&allocator_, ZONE_NAME) {
WasmSerializationTest()
: zone_(&allocator_, ZONE_NAME),
no_wasm_dynamic_tiering_(&FLAG_wasm_dynamic_tiering, false) {
// Don't call here if we move to gtest.
SetUp();
}
......@@ -184,6 +186,7 @@ class WasmSerializationTest {
v8::OwnedBuffer data_;
v8::MemorySpan<const uint8_t> wire_bytes_ = {nullptr, 0};
v8::MemorySpan<const uint8_t> serialized_bytes_ = {nullptr, 0};
FlagScope<bool> no_wasm_dynamic_tiering_;
};
const char* WasmSerializationTest::kFunctionName = "increment";
......
......@@ -5,6 +5,7 @@
// The test needs --no-liftoff because we can't serialize and deserialize
// Liftoff code.
// Flags: --expose-wasm --allow-natives-syntax --expose-gc --no-liftoff
// Flags: --no-wasm-dynamic-tiering
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
......
......@@ -4,7 +4,7 @@
// The test needs --wasm-tier-up because we can't serialize and deserialize
// Liftoff code.
// Flags: --allow-natives-syntax --wasm-tier-up
// Flags: --allow-natives-syntax --wasm-tier-up --no-wasm-dynamic-tiering
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
......
......@@ -4,7 +4,7 @@
// The test needs --wasm-tier-up because we can't serialize and deserialize
// Liftoff code.
// Flags: --allow-natives-syntax --wasm-tier-up
// Flags: --allow-natives-syntax --wasm-tier-up --no-wasm-dynamic-tiering
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
......
......@@ -5,6 +5,7 @@
// The test needs --wasm-tier-up because we can't serialize and deserialize
// Liftoff code.
// Flags: --allow-natives-syntax --throws --wasm-tier-up
// Flags: --no-wasm-dynamic-tiering
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
let kTableSize = 3;
......
......@@ -4,7 +4,7 @@
// Flags: --experimental-wasm-eh --allow-natives-syntax
// Disable Liftoff so we can serialize the module.
// Flags: --no-liftoff
// Flags: --no-liftoff --no-wasm-dynamic-tiering
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
......
......@@ -5,6 +5,7 @@
// The test needs --wasm-tier-up because we can't serialize and deserialize
// Liftoff code.
// Flags: --expose-wasm --allow-natives-syntax --expose-gc --wasm-tier-up
// Flags: --no-wasm-dynamic-tiering
d8.file.execute("test/mjsunit/wasm/wasm-module-builder.js");
......
......@@ -5,6 +5,7 @@
// The test needs --wasm-tier-up because we can't serialize and deserialize
// Liftoff code.
// Flags: --allow-natives-syntax --print-wasm-code --wasm-tier-up
// Flags: --no-wasm-dynamic-tiering
// Just test that printing the code of the following wasm modules does not
// crash.
......
......@@ -5,7 +5,7 @@
// The test needs --no-liftoff because we can't serialize and deserialize
// Liftoff code.
// Flags: --wasm-lazy-compilation --allow-natives-syntax --expose-gc
// Flags: --no-liftoff
// Flags: --no-liftoff --no-wasm-dynamic-tiering
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
// Flags: --allow-natives-syntax --liftoff --no-wasm-tier-up --expose-gc
// Flags: --no-wasm-dynamic-tiering
// Compile functions 0 and 2 with Turbofan, the rest with Liftoff:
// Flags: --wasm-tier-mask-for-testing=5
......
......@@ -5,7 +5,7 @@
// The test needs --no-liftoff because we can't serialize and deserialize
// Liftoff code.
// Flags: --allow-natives-syntax --wasm-lazy-compilation --expose-gc
// Flags: --no-liftoff
// Flags: --no-liftoff --no-wasm-dynamic-tiering
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js');
......
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