summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js')
-rw-r--r--js/src/jit-test/tests/wasm/lazy-stubs-jitentry.js36
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();