Index: test/mjsunit/wasm/wasm-module-builder.js |
diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js |
index df6007b67a73f9c55ddcf6f08af2f803f1cf0a69..c432756207eb5d482ec22bbeb5b59dea98c931f8 100644 |
--- a/test/mjsunit/wasm/wasm-module-builder.js |
+++ b/test/mjsunit/wasm/wasm-module-builder.js |
@@ -199,8 +199,8 @@ |
this.imports.push(o); |
} |
- addDataSegment(addr, data, is_global = false) { |
- this.segments.push({addr: addr, data: data, is_global: is_global}); |
+ addDataSegment(addr, data, init) { |
+ this.segments.push({addr: addr, data: data, init: init}); |
return this.segments.length - 1; |
} |
@@ -444,15 +444,8 @@ |
section.emit_u32v(wasm.segments.length); |
for (let seg of wasm.segments) { |
section.emit_u8(0); // linear memory index 0 |
- if (seg.is_global) { |
- // initializer is a global variable |
- section.emit_u8(kExprGetGlobal); |
- section.emit_u32v(seg.addr); |
- } else { |
- // initializer is a constant |
- section.emit_u8(kExprI32Const); |
- section.emit_u32v(seg.addr); |
- } |
+ section.emit_u8(kExprI32Const); |
+ section.emit_u32v(seg.addr); |
section.emit_u8(kExprEnd); |
section.emit_u32v(seg.data.length); |
section.emit_bytes(seg.data); |