tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

wasm-to-js-1.js (539B)


      1 // |jit-test| skip-if: !wasmIsSupported(); --fast-warmup
      2 function sample() {
      3    enableGeckoProfiling();
      4    readGeckoProfilingStack();
      5    disableGeckoProfiling();
      6 }
      7 const text = `(module
      8    (import "m" "f" (func $f))
      9    (func (export "test")
     10    (call $f)
     11 ))`;
     12 const bytes = wasmTextToBinary(text);
     13 const mod = new WebAssembly.Module(bytes);
     14 const imports = {"m": {"f": sample}};
     15 const instance = new WebAssembly.Instance(mod, imports);
     16 sample();
     17 for (let i = 0; i < 5; i++) {
     18    gc(this, "shrinking");
     19    instance.exports.test();
     20 }