Commit a97af0b5 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][fuzzer] Fix printing locals declarations

The API in the wasm module builder changed recently
(https://crrev.com/c/2390144). The fuzzer was still emitting code for
the old API.
This CL fixes this for primitive types, and adds a TODO to implement
heap types when needed.

R=ahaas@chromium.org
CC=manoskouk@chromium.org

Bug: chromium:1127717
Change-Id: I514b6e53d0492e5706a5b06d24026da13c3a2165
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2412176Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69921}
parent e950f040
......@@ -270,9 +270,13 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
for (size_t pos = 0, count = 1, locals = decls.type_list.size();
pos < locals; pos += count, count = 1) {
ValueType type = decls.type_list[pos];
while (pos + count < locals && decls.type_list[pos + count] == type)
while (pos + count < locals && decls.type_list[pos + count] == type) {
++count;
os << ".addLocals({" << type.name() << "_count: " << count << "})";
}
// TODO(wasm): Fix this for heap types.
std::string name = type.name();
name[0] = std::toupper(name[0]);
os << ".addLocals(kWasm" << name << ", " << count << ")";
}
os << "\n";
}
......
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