summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js')
-rw-r--r--deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js b/deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js
index 3fab8c65b1..26bdf8ece8 100644
--- a/deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js
+++ b/deps/v8/test/mjsunit/wasm/ensure-wasm-binaries-up-to-date.js
@@ -7,6 +7,27 @@
// Ensure checked in wasm binaries used by integration tests from v8 hosts
// (such as chromium) are up to date.
+(function print_incrementer() {
+ if (true) return; // remove to regenerate the module
+
+ load('test/mjsunit/wasm/wasm-constants.js');
+ load('test/mjsunit/wasm/wasm-module-builder.js');
+
+ var module = new WasmModuleBuilder();
+ module.addFunction(undefined, kSig_i_i)
+ .addBody([kExprGetLocal, 0, kExprI32Const, 1, kExprI32Add])
+ .exportAs("increment");
+
+ var buffer = module.toBuffer(true);
+ var view = new Uint8Array(buffer);
+
+ print("const unsigned char module[] = {");
+ for (var i = 0; i < buffer.byteLength; i++) {
+ print(" " + view[i] + ",");
+ }
+ print("};");
+})();
+
(function ensure_incrementer() {
var buff = readbuffer("test/mjsunit/wasm/incrementer.wasm");
var mod = new WebAssembly.Module(buff);