Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/memory64/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  memory-init.js   Sprache: JAVA

 
// |jit-test| heavy; allow-oom; skip-if: !canRunHugeMemoryTests()

var S = (function () {
    let s = "";
    for ( let i=0; i < 16; i++ )
        s += "0123456789abcdef"
    return s;
})();

for (let shared of ['''shared']) {
    try {
        var ins = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(`
(module
  (memory (export "mem") i64 65537 65537 ${shared})
  (data $d "${S}")
  (func (export "f") (param $p i64) (param $o i32) (param $n i32)
    (memory.init $d (local.get $p) (local.get $o) (local.get $n))))`)));
    } catch (e) {
        if (e instanceof WebAssembly.RuntimeError && String(e).match(/too many memory pages/)) {
            quit(0);
        }
        throw e;
    }

    var mem = new Uint8Array(ins.exports.mem.buffer);

    // Init above 4GB
    doit(mem, 0x1_0000_1000, 1, S.length-1);

    // Init above 4GB with OOM
    assertErrorMessage(() => ins.exports.f(0x1_0000_ff80n, 0, 256),
                       WebAssembly.RuntimeError,
                       /out of bounds/);

    // Init across 4GB
    doit(mem, 0xffff_ff80, 3, 200);
}

function doit(mem, addr, offs, n) {
    ins.exports.f(BigInt(addr), offs, n);
    for (let i=0; i < n; i++) {
        assertEq(mem[addr+i], S.charCodeAt(offs+i));
    }
}


Messung V0.5
C=92 H=91 G=91

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.