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

Quelle  linking.js   Sprache: JAVA

 
function linkGlobals(typeSection, exportInit, linkType) {
    let {global} = wasmEvalText(`(module
        ${typeSection}
        (global (export "global") ${linkType} ${exportInit})
    )`).exports;

    wasmEvalText(`(module
        ${typeSection}
        (import "" "global"
            (global ${linkType})
        )
    )`, {"": {global}});
}

function linkTables(typeSection, exportInit, linkType) {
    let {table} = wasmEvalText(`(module
        ${typeSection}
        (table (export "table") ${linkType} (elem (${exportInit})))
    )`).exports;

    wasmEvalText(`(module
        ${typeSection}
        (import "" "table"
            (table 0 1 ${linkType})
        )
    )`, {"": {table}});
}

function linkFuncs(typeSection, exportInit, linkType) {
    let {func} = wasmEvalText(`(module
        ${typeSection}
        (func
            (export "func")
            (param ${linkType})
            (result ${linkType})
            unreachable
        )
    )`).exports;

    wasmEvalText(`(module
        ${typeSection}
        (import "" "func"
            (func (param ${linkType}) (result ${linkType}))
        )
    )`, {"": {func}});
}

const TESTS = [
    [
        "(type (struct (field i32)))",
        "ref.null 0",
        "(ref null 0)",
    ],
    [
        "(type (array i32))",
        "ref.null 0",
        "(ref null 0)",
    ],
    [
        "(type (struct (field i32))) (type (struct (field (ref 0))))",
        "ref.null 1",
        "(ref null 1)",
    ]
];

for (let test of TESTS) {
    linkGlobals(...test);
    linkTables(...test);
    linkFuncs(...test);
}

Messung V0.5
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.11 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.