diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /js/src/jit-test/lib/gen | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/lib/gen')
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-gen.js | 71 | ||||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M.wasm | bin | 0 -> 11804 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M1.wasm | bin | 0 -> 11804 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r1M-t1.wasm | bin | 0 -> 19647 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r1M1-t1.wasm | bin | 0 -> 19647 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K.wasm | bin | 0 -> 11815 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K1.wasm | bin | 0 -> 11815 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-s10K.wasm | bin | 0 -> 258 bytes | |||
-rw-r--r-- | js/src/jit-test/lib/gen/wasm-gc-limits-s10K1.wasm | bin | 0 -> 258 bytes |
9 files changed, 71 insertions, 0 deletions
diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-gen.js b/js/src/jit-test/lib/gen/wasm-gc-limits-gen.js new file mode 100644 index 0000000000..01fd527cc3 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-gen.js @@ -0,0 +1,71 @@ +// Generates large .wasm files for use in ../limits.js. +// Make sure you are running this script from a release build or you will be sad. + +loadRelativeToScript("../wasm-binary.js"); + +function moduleNRecGroupNTypes(numRecs, numTypes) { + let types = []; + for (let i = 0; i < numTypes; i++) { + types.push({ kind: FuncCode, args: [], ret: [] }); + } + let recs = []; + for (let i = 0; i < numRecs; i++) { + recs.push(recGroup(types)); + } + return new Uint8Array(compressLZ4(new Uint8Array(moduleWithSections([typeSection(recs)])).buffer)); +} + +os.file.writeTypedArrayToFile("wasm-gc-limits-r1M-t1.wasm", moduleNRecGroupNTypes(1_000_000, 1)); +os.file.writeTypedArrayToFile("wasm-gc-limits-r1M1-t1.wasm", moduleNRecGroupNTypes(1_000_001, 1)); +os.file.writeTypedArrayToFile("wasm-gc-limits-r1-t1M.wasm", moduleNRecGroupNTypes(1, 1_000_000)); +os.file.writeTypedArrayToFile("wasm-gc-limits-r1-t1M1.wasm", moduleNRecGroupNTypes(1, 1_000_001)); +os.file.writeTypedArrayToFile("wasm-gc-limits-r2-t500K.wasm", moduleNRecGroupNTypes(2, 500_000)); +os.file.writeTypedArrayToFile("wasm-gc-limits-r2-t500K1.wasm", moduleNRecGroupNTypes(2, 500_001)); + +function moduleLargeStruct(size) { + let structInitializer = []; + for (let i = 0; i < size; i++) { + structInitializer.push(I64ConstCode); + structInitializer.push(...varU32(0)); + } + return new Uint8Array(compressLZ4(new Uint8Array(moduleWithSections([ + typeSection([ + { + kind: StructCode, + fields: Array(size).fill(I64Code) + }, + { + kind: FuncCode, + args: [], + ret: [AnyRefCode] + } + ]), + declSection([1, 1]), + exportSection([ + {name: "makeLargeStructDefault", funcIndex: 0}, + {name: "makeLargeStruct", funcIndex: 1} + ]), + bodySection([ + funcBody({ + locals: [], + body: [ + GcPrefix, + StructNewDefault, + ...varU32(0) + ], + }), + funcBody({ + locals: [], + body: [ + ...structInitializer, + GcPrefix, + StructNew, + ...varU32(0) + ], + }), + ]), + ])).buffer)); +} + +os.file.writeTypedArrayToFile("wasm-gc-limits-s10K.wasm", moduleLargeStruct(10_000)); +os.file.writeTypedArrayToFile("wasm-gc-limits-s10K1.wasm", moduleLargeStruct(10_001)); diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M.wasm Binary files differnew file mode 100644 index 0000000000..f92d36f8e3 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M1.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M1.wasm Binary files differnew file mode 100644 index 0000000000..190b522472 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r1-t1M1.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r1M-t1.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r1M-t1.wasm Binary files differnew file mode 100644 index 0000000000..5424e907ff --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r1M-t1.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r1M1-t1.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r1M1-t1.wasm Binary files differnew file mode 100644 index 0000000000..a96be86ef3 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r1M1-t1.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K.wasm Binary files differnew file mode 100644 index 0000000000..b9eb6ea929 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K1.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K1.wasm Binary files differnew file mode 100644 index 0000000000..e44b6461fe --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-r2-t500K1.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-s10K.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-s10K.wasm Binary files differnew file mode 100644 index 0000000000..5b209ab5e4 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-s10K.wasm diff --git a/js/src/jit-test/lib/gen/wasm-gc-limits-s10K1.wasm b/js/src/jit-test/lib/gen/wasm-gc-limits-s10K1.wasm Binary files differnew file mode 100644 index 0000000000..a2062abc52 --- /dev/null +++ b/js/src/jit-test/lib/gen/wasm-gc-limits-s10K1.wasm |