[wasm] Several fixes in wasm-module-builder.js
This CL cleans up a few things as noted by binji in https://github.com/WebAssembly/spec/pull/979, plus a few more I found along the way. In particular: 1) Remove the unused and incorrect {bytesWithHeader} method. 2) Introduce kMaxVarInt32Size and kMaxVarInt64Size constants. 3) Remove redundant {ensure_space} calls (irrelevant for performance). 4) Use {toModule} method instead of duplicating code. 5) Merge two identical leb encoding implementations. R=titzer@chromium.org CC=binji@chromium.org Change-Id: Idec74e2e46a71766107c182a4176c516d883adad Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1511273 Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Reviewed-by: Ben Titzer <titzer@chromium.org> Cr-Commit-Position: refs/heads/master@{#60124}
Showing
Please
register
or
sign in
to comment