[wasm][fuzzer] Remove unused arguments

The number of arguments and their values were generated and passed by
the individual fuzzers, but were unused by the caller. Instead, default
arguments are generated in {MakeDefaultInterpreterArguments} and
{MakeDefaultArguments}.
Thus this CL removes the dead parameters and assignments.

R=ahaas@chromium.org

Change-Id: I5ca5b06a0848c2a89e70ed739f44bc2161fcb2bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3003464
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75560}
This commit is contained in:
Clemens Backes 2021-07-05 16:08:41 +02:00 committed by V8 LUCI CQ
parent 4cb591e873
commit 18fbc33ea4
4 changed files with 10 additions and 36 deletions

View File

@ -18,11 +18,9 @@ namespace wasm {
namespace fuzzer {
class WasmCodeFuzzer : public WasmExecutionFuzzer {
bool GenerateModule(
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args,
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) override {
bool GenerateModule(Isolate* isolate, Zone* zone,
base::Vector<const uint8_t> data,
ZoneBuffer* buffer) override {
TestSignatures sigs;
WasmModuleBuilder builder(zone);
WasmFunctionBuilder* f = builder.AddFunction(sigs.i_iii());
@ -33,14 +31,6 @@ class WasmCodeFuzzer : public WasmExecutionFuzzer {
builder.SetMaxMemorySize(32);
builder.WriteTo(buffer);
*num_args = 3;
interpreter_args->reset(
new WasmValue[3]{WasmValue(1), WasmValue(2), WasmValue(3)});
compiler_args->reset(new Handle<Object>[3] {
handle(Smi::FromInt(1), isolate), handle(Smi::FromInt(2), isolate),
handle(Smi::FromInt(3), isolate)
});
return true;
}
};

View File

@ -1622,11 +1622,9 @@ FunctionSig* GenerateSig(Zone* zone, DataRange* data, SigKind sig_kind) {
} // namespace
class WasmCompileFuzzer : public WasmExecutionFuzzer {
bool GenerateModule(
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args,
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) override {
bool GenerateModule(Isolate* isolate, Zone* zone,
base::Vector<const uint8_t> data,
ZoneBuffer* buffer) override {
TestSignatures sigs;
WasmModuleBuilder builder(zone);
@ -1692,14 +1690,6 @@ class WasmCompileFuzzer : public WasmExecutionFuzzer {
builder.SetHasSharedMemory();
builder.WriteTo(buffer);
*num_args = 3;
interpreter_args->reset(
new WasmValue[3]{WasmValue(1), WasmValue(2), WasmValue(3)});
compiler_args->reset(new Handle<Object>[3] {
handle(Smi::FromInt(1), isolate), handle(Smi::FromInt(2), isolate),
handle(Smi::FromInt(3), isolate)
});
return true;
}
};

View File

@ -419,17 +419,13 @@ void WasmExecutionFuzzer::FuzzWasmModule(base::Vector<const uint8_t> data,
Zone zone(&allocator, ZONE_NAME);
ZoneBuffer buffer(&zone);
int32_t num_args = 0;
std::unique_ptr<WasmValue[]> interpreter_args;
std::unique_ptr<Handle<Object>[]> compiler_args;
// The first byte builds the bitmask to control which function will be
// compiled with Turbofan and which one with Liftoff.
uint8_t tier_mask = data.empty() ? 0 : data[0];
if (!data.empty()) data += 1;
uint8_t debug_mask = data.empty() ? 0 : data[0];
if (!data.empty()) data += 1;
if (!GenerateModule(i_isolate, &zone, data, &buffer, &num_args,
&interpreter_args, &compiler_args)) {
if (!GenerateModule(i_isolate, &zone, data, &buffer)) {
return;
}

View File

@ -44,11 +44,9 @@ class WasmExecutionFuzzer {
virtual size_t max_input_size() const { return 512; }
protected:
virtual bool GenerateModule(
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args,
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) = 0;
virtual bool GenerateModule(Isolate* isolate, Zone* zone,
base::Vector<const uint8_t> data,
ZoneBuffer* buffer) = 0;
};
} // namespace fuzzer