Commit af1988f1 authored by Ben Smith's avatar Ben Smith Committed by Commit Bot

[wasm] Enable bulk-memory by default

See intent to ship here: https://groups.google.com/forum/#!topic/v8-users/zM05lYEBVog

wasm-module-builder.js is also changed to use the new syntax for specifying a table
index in an element segment. In the MVP, the table index was always zero. The
reference types proposal adds support for multiple tables, and originally used this
value to specify a non-zero table index. The bulk memory proposal needed a way to
specify a passive element segment, so it re-purposed the table index as a flags field
and uses a different field for the table index.

Bug: v8:7747
Change-Id: If24f2d04e88a29b714f1a78ed417803bae702c76
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1560215
Commit-Queue: Ben Smith <binji@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60796}
parent bd7d425d
......@@ -23,7 +23,7 @@
SEPARATOR \
V(bigint, "JS BigInt support", false) \
SEPARATOR \
V(bulk_memory, "bulk memory opcodes", false) \
V(bulk_memory, "bulk memory opcodes", true) \
SEPARATOR \
V(return_call, "return call opcodes", false) \
SEPARATOR \
......
......@@ -1144,10 +1144,12 @@ class WasmModuleBuilder {
for (let init of inits) {
if (init.is_active) {
// Active segment.
// TODO(ahaas): Adjust the encoding of != 0 table indices once
// the anyref proposal and the bulk-memory-operations proposal
// agree on it.
section.emit_u32v(init.table); // table index / flags
if (init.table == 0) {
section.emit_u32v(kActiveNoIndex);
} else {
section.emit_u32v(kActiveWithIndex);
section.emit_u32v(init.table);
}
if (init.is_global) {
section.emit_u8(kExprGetGlobal);
} else {
......
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