diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js b/js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js new file mode 100644 index 0000000000..cb846a4d25 --- /dev/null +++ b/js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js @@ -0,0 +1,36 @@ +function test() { + var table = wasmEvalText(`(module + (func $add0 (param i32) (result i32) (i32.add (get_local 0) (i32.const 0))) + (func $add1 (param i32) (result i32) (i32.add (get_local 0) (i32.const 1))) + (func $add2 (param i32) (result i32) (i32.add (get_local 0) (i32.const 2))) + (func $add3 (param i32) (result i32) (i32.add (get_local 0) (i32.const 3))) + (func $add4 (param i32) (result i32) (i32.add (get_local 0) (i32.const 4))) + (func $add5 (param i32) (result i32) (i32.add (get_local 0) (i32.const 5))) + (func $add6 (param i32) (result i32) (i32.add (get_local 0) (i32.const 6))) + (func $add7 (param i32) (result i32) (i32.add (get_local 0) (i32.const 7))) + (func $add8 (param i32) (result i32) (i32.add (get_local 0) (i32.const 8))) + (func $add9 (param i32) (result i32) (i32.add (get_local 0) (i32.const 9))) + (table (export "table") 10 funcref) + (elem (i32.const 0) $add0) + (elem (i32.const 1) $add1) + (elem (i32.const 2) $add2) + (elem (i32.const 3) $add3) + (elem (i32.const 4) $add4) + (elem (i32.const 5) $add5) + (elem (i32.const 6) $add6) + (elem (i32.const 7) $add7) + (elem (i32.const 8) $add8) + (elem (i32.const 9) $add9) + )`).exports.table; + var exps = []; + for (var i = 0; i < 10; i++) { + exps.push(table.get(i)); + } + var res = 0; + for (var i = 0; i < 80; i++) { + var exp = exps[i % exps.length]; + res = exp(res); + } + assertEq(res, 360); +} +test(); |