Debian Codegraph @

js/src/jit-test/tests/wasm/js-direct-call-wasm.js

raw
1 // |jit-test| --fast-warmup; --ion-offthread-compile=off
2
3 // Test that JS frames can trace wasm anyref values when they are used for
4 // direct calls.
5 {
6 let {wasmFunc} = wasmEvalText(`(module
7 (func (import "" "gc"))
8 (func (export "wasmFunc") (param externref)
9 call 0
10 )
11 )`, {"": {gc}}).exports;
12
13 function jsFunc(i) {
14 // Call the function twice so that the conversion to externref will be
15 // GVN'ed and spilled across one of the calls
16 wasmFunc(i);
17 wasmFunc(i);
18 }
19
20 for (let i = 0; i < 100; i++) {
21 jsFunc(i);
22 }
23 }