Commit 18fbc33e authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[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: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75560}
parent 4cb591e8
...@@ -18,11 +18,9 @@ namespace wasm { ...@@ -18,11 +18,9 @@ namespace wasm {
namespace fuzzer { namespace fuzzer {
class WasmCodeFuzzer : public WasmExecutionFuzzer { class WasmCodeFuzzer : public WasmExecutionFuzzer {
bool GenerateModule( bool GenerateModule(Isolate* isolate, Zone* zone,
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args, ZoneBuffer* buffer) override {
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) override {
TestSignatures sigs; TestSignatures sigs;
WasmModuleBuilder builder(zone); WasmModuleBuilder builder(zone);
WasmFunctionBuilder* f = builder.AddFunction(sigs.i_iii()); WasmFunctionBuilder* f = builder.AddFunction(sigs.i_iii());
...@@ -33,14 +31,6 @@ class WasmCodeFuzzer : public WasmExecutionFuzzer { ...@@ -33,14 +31,6 @@ class WasmCodeFuzzer : public WasmExecutionFuzzer {
builder.SetMaxMemorySize(32); builder.SetMaxMemorySize(32);
builder.WriteTo(buffer); 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; return true;
} }
}; };
......
...@@ -1622,11 +1622,9 @@ FunctionSig* GenerateSig(Zone* zone, DataRange* data, SigKind sig_kind) { ...@@ -1622,11 +1622,9 @@ FunctionSig* GenerateSig(Zone* zone, DataRange* data, SigKind sig_kind) {
} // namespace } // namespace
class WasmCompileFuzzer : public WasmExecutionFuzzer { class WasmCompileFuzzer : public WasmExecutionFuzzer {
bool GenerateModule( bool GenerateModule(Isolate* isolate, Zone* zone,
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args, ZoneBuffer* buffer) override {
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) override {
TestSignatures sigs; TestSignatures sigs;
WasmModuleBuilder builder(zone); WasmModuleBuilder builder(zone);
...@@ -1692,14 +1690,6 @@ class WasmCompileFuzzer : public WasmExecutionFuzzer { ...@@ -1692,14 +1690,6 @@ class WasmCompileFuzzer : public WasmExecutionFuzzer {
builder.SetHasSharedMemory(); builder.SetHasSharedMemory();
builder.WriteTo(buffer); 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; return true;
} }
}; };
......
...@@ -419,17 +419,13 @@ void WasmExecutionFuzzer::FuzzWasmModule(base::Vector<const uint8_t> data, ...@@ -419,17 +419,13 @@ void WasmExecutionFuzzer::FuzzWasmModule(base::Vector<const uint8_t> data,
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME);
ZoneBuffer buffer(&zone); 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 // The first byte builds the bitmask to control which function will be
// compiled with Turbofan and which one with Liftoff. // compiled with Turbofan and which one with Liftoff.
uint8_t tier_mask = data.empty() ? 0 : data[0]; uint8_t tier_mask = data.empty() ? 0 : data[0];
if (!data.empty()) data += 1; if (!data.empty()) data += 1;
uint8_t debug_mask = data.empty() ? 0 : data[0]; uint8_t debug_mask = data.empty() ? 0 : data[0];
if (!data.empty()) data += 1; if (!data.empty()) data += 1;
if (!GenerateModule(i_isolate, &zone, data, &buffer, &num_args, if (!GenerateModule(i_isolate, &zone, data, &buffer)) {
&interpreter_args, &compiler_args)) {
return; return;
} }
......
...@@ -44,11 +44,9 @@ class WasmExecutionFuzzer { ...@@ -44,11 +44,9 @@ class WasmExecutionFuzzer {
virtual size_t max_input_size() const { return 512; } virtual size_t max_input_size() const { return 512; }
protected: protected:
virtual bool GenerateModule( virtual bool GenerateModule(Isolate* isolate, Zone* zone,
Isolate* isolate, Zone* zone, base::Vector<const uint8_t> data, base::Vector<const uint8_t> data,
ZoneBuffer* buffer, int32_t* num_args, ZoneBuffer* buffer) = 0;
std::unique_ptr<WasmValue[]>* interpreter_args,
std::unique_ptr<Handle<Object>[]>* compiler_args) = 0;
}; };
} // namespace fuzzer } // namespace fuzzer
......
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