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

Quelle  grow-memory.js   Sprache: JAVA

 
function linearModule(min, max, ops, current_memory, grow_memory) {
  var opsText = ops.map(function (op) {
    if (op[0] == "CM") {
      res = `(if (result i32) (i32.ne (${current_memory}) (i32.const ${op[1]}))
                  (then (i32.load offset=10 (i32.const 4294967295)))
                  (else (i32.const 0)))`
    } else if (op[0] == "GM") {
      res = `(if (result i32) (i32.ne (${grow_memory} (i32.const ${op[1]})) (i32.const ${op[2]}))
                 (then (i32.load offset=10 (i32.const 4294967295)))
                 (else (i32.const 0)))`
    } else if (op[0] == "L") {
      var type = op[1];
      var ext = op[2];
      var off = op[3];
      var loc = op[4]
      var align = 0;
      res = `(${type}.load${ext} offset=${off} (i32.const ${op[4]}))`;
    } else if (op[0] == "S") {
      var type = op[1];
      var ext = op[2];
      var off = op[3];
      var loc = op[4]
      var align = 0;
      res = `(${type}.store${ext} offset=${off} (i32.const ${op[4]}) (i32.const 42))`;
    }
    return res;
  }).join("\n")

  let text =
    `(module
       (memory ${min} ${max})
         ` + (min != 0 ? `(data (i32.const 0) "\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f")
                          (data (i32.const 16) "\\f0\\f1\\f2\\f3\\f4\\f5\\f6\\f7\\f8\\f9\\fa\\fb\\fc\\fd\\fe\\ff")`
                      : "") +
       `
       (func (result i32)
         (drop ` + opsText + `)
         (${current_memory})
       ) (export "run" (func 0)))`;

  return text;
}

// Just grow some memory
wasmFullPass(linearModule(3,5, [["CM", 3]], "memory.size""memory.grow"), 3);    // New opcode names

Messung V0.5
C=98 H=98 G=97

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