[no-wasm] Remove wasm tests and fuzzers

Wasm tests and wasm fuzzers should not be compiled (and run) if
v8_enable_webassembly=false.

R=machenbach@chromium.org

Bug: v8:11238
Change-Id: I78bbb1d1d98179cac315411b8c2c2ecaee8ede91
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2721761
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73071}
This commit is contained in:
Clemens Backes 2021-02-26 11:52:45 +01:00 committed by Commit Bot
parent 52cc7ba9bc
commit 6fe59c0cb6
5 changed files with 182 additions and 163 deletions

211
BUILD.gn
View File

@ -5171,11 +5171,16 @@ group("v8_fuzzers") {
":v8_simple_parser_fuzzer",
":v8_simple_regexp_builtins_fuzzer",
":v8_simple_regexp_fuzzer",
":v8_simple_wasm_async_fuzzer",
":v8_simple_wasm_code_fuzzer",
":v8_simple_wasm_compile_fuzzer",
":v8_simple_wasm_fuzzer",
]
if (v8_enable_webassembly) {
data_deps += [
":v8_simple_wasm_async_fuzzer",
":v8_simple_wasm_code_fuzzer",
":v8_simple_wasm_compile_fuzzer",
":v8_simple_wasm_fuzzer",
]
}
}
if (is_component_build) {
@ -5523,127 +5528,129 @@ v8_source_set("regexp_fuzzer") {
v8_fuzzer("regexp_fuzzer") {
}
v8_source_set("wasm_test_common") {
sources = [
"test/common/wasm/wasm-interpreter.cc",
"test/common/wasm/wasm-interpreter.h",
"test/common/wasm/wasm-module-runner.cc",
"test/common/wasm/wasm-module-runner.h",
]
if (v8_enable_webassembly) {
v8_source_set("wasm_test_common") {
sources = [
"test/common/wasm/wasm-interpreter.cc",
"test/common/wasm/wasm-interpreter.h",
"test/common/wasm/wasm-module-runner.cc",
"test/common/wasm/wasm-module-runner.h",
]
deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_libbase",
":v8_shared_internal_headers",
":v8_tracing",
]
deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_libbase",
":v8_shared_internal_headers",
":v8_tracing",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [ ":v8_maybe_icu" ]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_source_set("wasm_fuzzer") {
sources = [ "test/fuzzer/wasm.cc" ]
v8_source_set("wasm_fuzzer") {
sources = [ "test/fuzzer/wasm.cc" ]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_fuzzer("wasm_fuzzer") {
}
v8_fuzzer("wasm_fuzzer") {
}
v8_source_set("wasm_async_fuzzer") {
sources = [ "test/fuzzer/wasm-async.cc" ]
v8_source_set("wasm_async_fuzzer") {
sources = [ "test/fuzzer/wasm-async.cc" ]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_fuzzer("wasm_async_fuzzer") {
}
v8_fuzzer("wasm_async_fuzzer") {
}
v8_source_set("wasm_code_fuzzer") {
sources = [
"test/common/wasm/test-signatures.h",
"test/fuzzer/wasm-code.cc",
]
v8_source_set("wasm_code_fuzzer") {
sources = [
"test/common/wasm/test-signatures.h",
"test/fuzzer/wasm-code.cc",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_fuzzer("wasm_code_fuzzer") {
}
v8_fuzzer("wasm_code_fuzzer") {
}
v8_source_set("lib_wasm_fuzzer_common") {
sources = [
"test/fuzzer/wasm-fuzzer-common.cc",
"test/fuzzer/wasm-fuzzer-common.h",
]
v8_source_set("lib_wasm_fuzzer_common") {
sources = [
"test/fuzzer/wasm-fuzzer-common.cc",
"test/fuzzer/wasm-fuzzer-common.h",
]
deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_tracing",
":wasm_test_common",
]
deps = [
":generate_bytecode_builtins_list",
":run_torque",
":v8_tracing",
":wasm_test_common",
]
public_deps = [ ":v8_maybe_icu" ]
public_deps = [ ":v8_maybe_icu" ]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_source_set("wasm_compile_fuzzer") {
sources = [
"test/common/wasm/test-signatures.h",
"test/fuzzer/wasm-compile.cc",
]
v8_source_set("wasm_compile_fuzzer") {
sources = [
"test/common/wasm/test-signatures.h",
"test/fuzzer/wasm-compile.cc",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
deps = [
":fuzzer_support",
":lib_wasm_fuzzer_common",
":wasm_test_common",
]
configs = [
":external_config",
":internal_config_base",
]
}
configs = [
":external_config",
":internal_config_base",
]
}
v8_fuzzer("wasm_compile_fuzzer") {
v8_fuzzer("wasm_compile_fuzzer") {
}
}
v8_source_set("inspector_fuzzer") {

View File

@ -75,9 +75,6 @@ v8_source_set("cctest_sources") {
### gcmole(all) ###
"../common/assembler-tester.h",
"../common/flag-utils.h",
"../common/wasm/flag-utils.h",
"../common/wasm/test-signatures.h",
"../common/wasm/wasm-macro-gen.h",
"cctest-utils.h",
"collector.h",
"compiler/c-signature.h",
@ -296,40 +293,6 @@ v8_source_set("cctest_sources") {
"trace-extension.h",
"unicode-helpers.cc",
"unicode-helpers.h",
"wasm/test-c-wasm-entry.cc",
"wasm/test-compilation-cache.cc",
"wasm/test-gc.cc",
"wasm/test-grow-memory.cc",
"wasm/test-jump-table-assembler.cc",
"wasm/test-liftoff-inspection.cc",
"wasm/test-run-wasm-64.cc",
"wasm/test-run-wasm-asmjs.cc",
"wasm/test-run-wasm-atomics.cc",
"wasm/test-run-wasm-atomics64.cc",
"wasm/test-run-wasm-bulk-memory.cc",
"wasm/test-run-wasm-exceptions.cc",
"wasm/test-run-wasm-interpreter.cc",
"wasm/test-run-wasm-js.cc",
"wasm/test-run-wasm-memory64.cc",
"wasm/test-run-wasm-module.cc",
"wasm/test-run-wasm-sign-extension.cc",
"wasm/test-run-wasm-simd-liftoff.cc",
"wasm/test-run-wasm-simd-scalar-lowering.cc",
"wasm/test-run-wasm-simd.cc",
"wasm/test-run-wasm-wrappers.cc",
"wasm/test-run-wasm.cc",
"wasm/test-streaming-compilation.cc",
"wasm/test-wasm-breakpoints.cc",
"wasm/test-wasm-codegen.cc",
"wasm/test-wasm-import-wrapper-cache.cc",
"wasm/test-wasm-metrics.cc",
"wasm/test-wasm-serialization.cc",
"wasm/test-wasm-shared-engine.cc",
"wasm/test-wasm-stack.cc",
"wasm/test-wasm-trap-position.cc",
"wasm/wasm-atomics-utils.h",
"wasm/wasm-run-utils.cc",
"wasm/wasm-run-utils.h",
]
if (v8_current_cpu == "arm") {
@ -438,11 +401,53 @@ v8_source_set("cctest_sources") {
"../..:v8_for_testing",
"../..:v8_libbase",
"../..:v8_libplatform",
"../..:wasm_test_common",
"../../tools/debug_helper:v8_debug_helper",
"//build/win:default_exe_manifest",
]
if (v8_enable_webassembly) {
sources += [
"../common/wasm/flag-utils.h",
"../common/wasm/test-signatures.h",
"../common/wasm/wasm-macro-gen.h",
"wasm/test-c-wasm-entry.cc",
"wasm/test-compilation-cache.cc",
"wasm/test-gc.cc",
"wasm/test-grow-memory.cc",
"wasm/test-jump-table-assembler.cc",
"wasm/test-liftoff-inspection.cc",
"wasm/test-run-wasm-64.cc",
"wasm/test-run-wasm-asmjs.cc",
"wasm/test-run-wasm-atomics.cc",
"wasm/test-run-wasm-atomics64.cc",
"wasm/test-run-wasm-bulk-memory.cc",
"wasm/test-run-wasm-exceptions.cc",
"wasm/test-run-wasm-interpreter.cc",
"wasm/test-run-wasm-js.cc",
"wasm/test-run-wasm-memory64.cc",
"wasm/test-run-wasm-module.cc",
"wasm/test-run-wasm-sign-extension.cc",
"wasm/test-run-wasm-simd-liftoff.cc",
"wasm/test-run-wasm-simd-scalar-lowering.cc",
"wasm/test-run-wasm-simd.cc",
"wasm/test-run-wasm-wrappers.cc",
"wasm/test-run-wasm.cc",
"wasm/test-streaming-compilation.cc",
"wasm/test-wasm-breakpoints.cc",
"wasm/test-wasm-codegen.cc",
"wasm/test-wasm-import-wrapper-cache.cc",
"wasm/test-wasm-metrics.cc",
"wasm/test-wasm-serialization.cc",
"wasm/test-wasm-shared-engine.cc",
"wasm/test-wasm-stack.cc",
"wasm/test-wasm-trap-position.cc",
"wasm/wasm-atomics-utils.h",
"wasm/wasm-run-utils.cc",
"wasm/wasm-run-utils.h",
]
public_deps += [ "../..:wasm_test_common" ]
}
defines = []
deps = [
"../..:run_torque",

View File

@ -26705,6 +26705,7 @@ TEST(AtomicsWaitCallback) {
AtomicsWaitCallbackCommon(isolate, CompileRun(init), 4, 4);
}
#if V8_ENABLE_WEBASSEMBLY
namespace v8 {
namespace internal {
namespace wasm {
@ -26783,6 +26784,7 @@ TEST(WasmI64AtomicWaitCallback) {
} // namespace wasm
} // namespace internal
} // namespace v8
#endif // V8_ENABLE_WEBASSEMBLY
TEST(BigIntAPI) {
LocalContext env;

View File

@ -5,14 +5,14 @@
[
##############################################################################
['lite_mode or variant == jitless', {
# TODO(v8:7777): Re-enable once wasm is supported in jitless mode.
# TODO(v8:7777): Change this once wasm is supported in jitless mode.
['not has_webassembly or variant == jitless', {
'multi_return/*': [SKIP],
'wasm/*': [SKIP],
'wasm_async/*': [SKIP],
'wasm_code/*': [SKIP],
'wasm_compile/*': [SKIP],
}], # lite_mode or variant == jitless
}], # not has_webassembly or variant == jitless
################################################################################
['variant == stress_snapshot', {

View File

@ -193,7 +193,6 @@ v8_source_set("unittests_sources") {
sources = [
"../../test/common/assembler-tester.h",
"../../test/common/wasm/wasm-macro-gen.h",
"../../testing/gmock-support.h",
"../../testing/gtest-support.h",
"api/access-check-unittest.cc",
@ -382,21 +381,6 @@ v8_source_set("unittests_sources") {
"utils/locked-queue-unittest.cc",
"utils/utils-unittest.cc",
"utils/vector-unittest.cc",
"wasm/control-transfer-unittest.cc",
"wasm/decoder-unittest.cc",
"wasm/function-body-decoder-unittest.cc",
"wasm/leb-helper-unittest.cc",
"wasm/loop-assignment-analysis-unittest.cc",
"wasm/module-decoder-memory64-unittest.cc",
"wasm/module-decoder-unittest.cc",
"wasm/simd-shuffle-unittest.cc",
"wasm/streaming-decoder-unittest.cc",
"wasm/subtyping-unittest.cc",
"wasm/wasm-code-manager-unittest.cc",
"wasm/wasm-compiler-unittest.cc",
"wasm/wasm-macro-gen-unittest.cc",
"wasm/wasm-module-builder-unittest.cc",
"wasm/wasm-module-sourcemap-unittest.cc",
"zone/zone-allocator-unittest.cc",
"zone/zone-chunk-list-unittest.cc",
"zone/zone-unittest.cc",
@ -404,8 +388,24 @@ v8_source_set("unittests_sources") {
if (v8_enable_webassembly) {
sources += [
"../../test/common/wasm/wasm-macro-gen.h",
"asmjs/asm-scanner-unittest.cc",
"asmjs/asm-types-unittest.cc",
"wasm/control-transfer-unittest.cc",
"wasm/decoder-unittest.cc",
"wasm/function-body-decoder-unittest.cc",
"wasm/leb-helper-unittest.cc",
"wasm/loop-assignment-analysis-unittest.cc",
"wasm/module-decoder-memory64-unittest.cc",
"wasm/module-decoder-unittest.cc",
"wasm/simd-shuffle-unittest.cc",
"wasm/streaming-decoder-unittest.cc",
"wasm/subtyping-unittest.cc",
"wasm/wasm-code-manager-unittest.cc",
"wasm/wasm-compiler-unittest.cc",
"wasm/wasm-macro-gen-unittest.cc",
"wasm/wasm-module-builder-unittest.cc",
"wasm/wasm-module-sourcemap-unittest.cc",
]
}
@ -451,8 +451,10 @@ v8_source_set("unittests_sources") {
sources += [
"assembler/turbo-assembler-x64-unittest.cc",
"compiler/x64/instruction-selector-x64-unittest.cc",
"wasm/trap-handler-x64-unittest.cc",
]
if (v8_enable_webassembly) {
sources += [ "wasm/trap-handler-x64-unittest.cc" ]
}
} else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
sources += [
"assembler/turbo-assembler-ppc-unittest.cc",
@ -465,11 +467,11 @@ v8_source_set("unittests_sources") {
]
}
if (is_posix) {
if (is_posix && v8_enable_webassembly) {
sources += [ "wasm/trap-handler-posix-unittest.cc" ]
}
if (is_win) {
if (is_win && v8_enable_webassembly) {
sources += [ "wasm/trap-handler-win-unittest.cc" ]
}
@ -485,13 +487,16 @@ v8_source_set("unittests_sources") {
"../..:v8_libbase",
"../..:v8_libplatform",
"../..:v8_shared_internal_headers",
"../..:wasm_test_common",
"../../third_party/inspector_protocol:crdtp_test",
"//build/win:default_exe_manifest",
"//testing/gmock",
"//testing/gtest",
]
if (v8_enable_webassembly) {
deps += [ "../..:wasm_test_common" ]
}
if (is_win) {
# This warning is benignly triggered by the U16 and U32 macros in
# bytecode-utils.h.