Chromium Code Reviews| 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 bfc4460d91b899d4ca640502cbfd625ef35ea1b4..4cdcab8a63059f9171cb44bdfc132117c23d7ca7 100644 |
| --- a/test/mjsunit/wasm/wasm-module-builder.js |
| +++ b/test/mjsunit/wasm/wasm-module-builder.js |
| @@ -36,6 +36,7 @@ function WasmModuleBuilder() { |
| this.function_table = []; |
| this.data_segments = []; |
| this.explicit = []; |
| + this.pad = null; |
| return this; |
| } |
| @@ -48,6 +49,11 @@ WasmModuleBuilder.prototype.addMemory = function(min, max, exp) { |
| return this; |
| } |
| +WasmModuleBuilder.prototype.addPad = function(size) { |
| + this.pad = size; |
| + return this; |
| +} |
| + |
| WasmModuleBuilder.prototype.addExplicitSection = function(bytes) { |
| this.explicit.push(bytes); |
| return this; |
| @@ -323,6 +329,14 @@ WasmModuleBuilder.prototype.toArray = function(debug) { |
| }); |
| } |
| + // Add an indirect function table pad section. |
| + if (wasm.pad !== null) { |
| + if (debug) print("emitting indirect function table pad @ " + bytes.length); |
|
bradn
2016/06/21 17:42:37
>80 columns
|
| + emit_section(bytes, kDeclFunctionTablePad, function(bytes) { |
| + emit_varint(bytes, wasm.pad); |
| + }); |
| + } |
| + |
| // End the module. |
| if (debug) print("emitting end @ " + bytes.length); |
| emit_section(bytes, kDeclEnd, function(bytes) {}); |